With SQL, how can you insert a new record into the "Persons" table?
The SQL INSERT INTO Statement is used to insert new records in a table.
INSERT INTO Syntax
It is possible to write the INSERT INTO statement in two different ways.
The first way specifies both the column names and the values to be inserted:
INSERT INTO table_name (column1, column2, column3, column4,...) VALUES (value1, value2, value3, value4,...);
INSERT INTO table_name VALUES (value1, value2, value3, value4,...);
INSERT INTO Example is as follows,
The following SQL statement inserts a new record in the "Slightbook" table,
INSERT INTO Slightbook (VisitorName, Address, City, PostalCode, Country) VALUES ('Author Slightbook', 'Address1', 'Bangalore', '560092', 'India');
Insert Data Only in Specified Columns,
INSERT INTO Customers (VisitorName, City, Country) VALUES ('Author Slightbook', 'Bangalore', 'India');
With SQL, how can you return all the records from a table named "Persons" sorted descending by "FirstName"?
Which SQL keyword is used to sort the result-set?
Which SQL statement is used to return only different values?
With SQL, how do you select all the records from a table named "Persons" where the "LastName" is alphabetically between (and including) "Hansen" and "Pettersen"?
With SQL, how do you select all the records from a table named "Persons" where the "FirstName" is "Peter" and the "LastName" is "Jackson"?