SQL Multiple choices


Total available count: 51
Subject - Databases
Subsubject - SQL

With SQL, how can you insert a new record into the "Persons" table?


 

 

 

 



A


Solution:-

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');

 




Next 5 multiple choice(s)

1

With SQL, how can you return all the records from a table named "Persons" sorted descending by "FirstName"?

2

Which SQL keyword is used to sort the result-set?

3

Which SQL statement is used to return only different values?

4

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"?

5

With SQL, how do you select all the records from a table named "Persons" where the "FirstName" is "Peter" and the "LastName" is "Jackson"?

Comments