SQL Quiz
Results: 20/20
Your answer: 1. What does SQL refer to?
Your answer: structured Query Language
2. Which SQL statement is used to extract data from the database?
Your answer: SELECT
3. Which SQL statement is used to update data in the database?
Your answer: UPDATE
4. Which SQL statement is used to delete data from the database?
Your answer: DELETE
5. Which SQL statement is used to insert new data into the database?
Your answer: INSERT into
6. With SQL, how do you choose the "FirstName" column from the "Persons" table?
Your answer: SELECT FirstName from Persons
7. With SQL, how do you pick all the columns from the "Persons" table?
Your answer: SELECT * from Persons
8. With SQL, how do you choose All records from the "Persons" table with the value of "FirstName" column equal to "Peter"?
Your answer: SELECT * from Persons WHERE firstname= ' Peter '
9. With SQL, how do you choose All records from the "Persons" table that have the value of the "FirstName" column beginning with "a"?
Your answer: SELECT * from Persons WHERE FirstName like ' a% '
10. Determine if the following statements are correct: When a condition listed is true, the OR operator displays a record. When all of the listed conditions are true, the AND operator displays records.
Your answer: correct
11. With SQL, how do you select FirstName equals Thomas in table Persons and LastName equals all records of Carter?
Your answer: SELECT * from Persons WHERE firstname= ' Thomas ' and lastname= ' Carter '
12. With SQL, how do you select All records in the Persons table that are LastName between Adams and Carter in alphabetical order?
Your answer: SELECT * from Persons WHERE LastName between ' Adams ' and ' Carter '
13. Which SQL statement can return a unique different value?
Your answer: SELECT DISTINCT
14. Which SQL keyword is used to sort the result set?
Your answer: ORDER by
15. With SQL, how do you return all records from the "Persons" table in descending order of the "FirstName" column?
Your answer: SELECT * from Persons ORDER by FirstName DESC
16. With SQL, how do you insert a new record into the "Persons" table?
Your answer: INSERT into Persons VALUES (' Jimmy ', ' Jackson ')
17. With SQL, how do you insert "Wilson" into the "LastName" column in the "Persons" table?
Your answer: INSERT into Persons (LastName) VALUES (' Wilson ')
18. How do you change "Gates" in the "LastName" column of "Persons" to "Wilson"?
Your answer: UPDATE Persons SET lastname= ' Wilson ' WHERE lastname= ' Gates '
19. Through SQL, how do you delete "FirstName" equals "Fred" in the "Persons" table?
Your answer: DELETE from Persons WHERE FirstName = ' Fred '
20. Through SQL, how do you return the number of records in the "Persons" table?
Your answer: SELECT COUNT (*) from Persons
SQL Question Bank Answer