Insertion, deletion and modification of database content

First, there are two ways to insert database content: 

 1. Single row insert: 

E.g: 

         use Student // run the created database

         INSERT  INTO   Authors(AuthorName,Sex,Age, Email, )

              VALUES('Zhang San', 1, '18', '[email protected]',)

2. Multi-line insert:

E.g:

           use Student // run the created database

           INSERT  INTO   Authors(AuthorName,Sex,Age, Email, )

           SELECT 'Zhang San', 1, '18', '[email protected]' UNION

           SELECT 'Li Si', 1, '20', '[email protected]' UNION

           SELECT 'Wang Wu', 1, '23', '[email protected]'    


2. Deletion of database content:

E.g:

        DELETE    FROM   Books    WHERE   BookCode='9875644'


3. Modification of database content:

E.g:

        UPDATE Authors SET Age =36 WHERE AuthorID=2 //Change the age of AuthorID 2 to 36

        

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324693907&siteId=291194637