SQL- Insert Table | Corona Updates

Insert Table


In SQL INSERT INTO statement is used to insert new records in a table.

Syntax :- 


INSERT INTO table_name(column1, column2,.......columnN)


VALUES (value1, value2,........valueN);


ExampleI will show how to insert data in table.

Query :

INSERT INTO my_tb (Name, Roll, address)

VALUES ('RAM', '01', 'Delhi'); 

Output :                        

Now, you can see  inserted data in table and also used SELECT Statement to see table data.

Syntax :-
SELECT * FROM table_name;
Query :
SELECT * FROM my_tb;
Output :

You can insert multiple records in table at a one time.

Example :

INSERT INTO my_tb (Name, Roll, address)

 VALUES ('Mohan', '02', 'Mumbai'),


  ('Amit', '03', 'Kanpur'),


               ('Madhur', '04', 'Meerut'),


               ('Pradeep', '05', 'Nepal'),


              ('Vikas', '06', 'Meerut'),


              ('Deepak', '07', 'Delhi'),


             ('Kapil', '08', 'Goa'),


             ('Ankur', '09', 'Mumbai'),


            ('Vibhu', '10', 'Banglore');


Output :


Post a Comment

0 Comments