|
INSERT INTO: - It is used to insert records in the table.
Syntax: -
insert into <table name> [(<column i, . . . , column j>)]values (<value i, . . . , value j>);
Examples: -
Insert data in Teacher Table: -
Insert into Teacher (TeacherID, TeacherName, Qualification, Subject, ContactNumber)Values(1, "Harris", "M.Sc. (Math)", "Math", 4235678);
OR
Insert into Teacher Values (1, "Harris", "M.Sc. (Math)", "Math", 4235678);
In the above examples data will be inserted in the corresponding fields. And there will be one tuple (row) in the table. Similarly you can insert more tuples in the table. As you can see the components in the [ ] brackets are optional and we can insert the data without giving the attributes. |