SQL Question Bank Answer

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.