Identify the SQL Statements

Test your knowledge of SQL statements including SELECT, INSERT, UPDATE, DELETE, and various clauses like WHERE, ORDER BY, and LIKE.

15 Questions Published

Questions

Question 1 Multiple Choice (Single Answer)

What does SQL stand for?

  1. Structured Question Language
  2. Strong Question Language
  3. Structured Query Language
  4. Structured Query Limited
Question 2 Multiple Choice (Single Answer)

Which SQL statement is used to extract data from a database?

  1. FETCH
  2. GET
  3. SELECT
  4. EXTRACT
Question 3 Multiple Choice (Single Answer)

Which SQL statement is used to update data in a database?

  1. UPDATE
  2. MODIFY
  3. SAVE AS
  4. SAVE
Question 4 Multiple Choice (Single Answer)

Which SQL statement is used to delete data from a database?

  1. REMOVE
  2. COLLAPSE
  3. DELETE
  4. REMOVE ALL
Question 5 Multiple Choice (Single Answer)

Which SQL statement is used to insert new data in a database?

  1. ADD NEW
  2. ADD RECORD
  3. INSERT NEW
  4. INSERT INTO
Question 6 Multiple Choice (Single Answer)

With SQL, how do you select a column named "FirstName" from a table named "Persons"?

  1. SELECT Persons.FirstName
  2. EXTRACT FirstName FROM Persons
  3. SELECT FirstName FROM Persons
  4. SELECT FROM FirstName IN Persons
Question 7 Multiple Choice (Single Answer)

With SQL, how do you select all the columns from a table named "Persons"?

  1. SELECT *.Persons
  2. SELECT Persons
  3. SELECT * FROM Persons
  4. SELECT [all] FROM Persons
Question 8 Multiple Choice (Single Answer)

With SQL, how do you select all the records from a table named "Persons" where the value of the column "FirstName" is "Peter"?

  1. SELECT * FROM Persons WHERE FirstName='Peter'
  2. SELECT [all] FROM Persons WHERE FirstName='Peter'
  3. SELECT [all] FROM Persons WHERE FirstName LIKE 'Peter'
  4. SELECT * FROM Persons WHERE FirstName<>'Peter'
Question 9 Multiple Choice (Single Answer)

With SQL, how do you select all the records from a table named "Persons" where the value of the column "FirstName" starts with an "a"?

  1. SELECT * FROM Persons WHERE FirstName='%a%'
  2. SELECT * FROM Persons WHERE FirstName='a_'
  3. SELECT * FROM Persons WHERE FirstName LIKE 'a%'
  4. SELECT * FROM Persons WHERE FirstName LIKE '%a'
Question 10 True/False

The OR operator displays a record if ANY conditions listed are true. The AND operator displays a record if ALL of the conditions listed are true

  1. True
  2. False
Question 11 Multiple Choice (Single Answer)

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

  1. SELECT FirstName='Peter', LastName='Jackson' FROM Persons
  2. SELECT * FROM Persons WHERE FirstName='Peter' AND LastName='Jackson'
  3. SELECT * FROM Persons WHERE FirstName<>'Peter' AND LastName<>'Jackson'
  4. SELECT WHERE FirstName='Peter' AND LastName='Jackson' FROM Persons
Question 12 Multiple Choice (Single Answer)

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

  1. SELECT LastName>'Hansen' AND LastName<'Pettersen' FROM Persons
  2. SELECT * FROM Persons WHERE LastName>'Hansen' AND LastName<'Pettersen'
  3. SELECT * FROM Persons WHERE LastName BETWEEN 'Hansen' AND 'Pettersen'
  4. SELECT * FROM Persons WHERE LastName IN 'Hansen' AND 'Pettersen'
Question 13 Multiple Choice (Single Answer)

Which SQL statement is used to return only different values?

  1. SELECT UNIQUE
  2. SELECT DISTINCT
  3. SELECT DIFFERENT
  4. SELECT SAME
Question 14 Multiple Choice (Single Answer)

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

  1. SORT
  2. SORT BY
  3. ORDER
  4. ORDER BY
Question 15 Multiple Choice (Single Answer)

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

  1. SELECT * FROM Persons ORDER FirstName DESC
  2. SELECT * FROM Persons SORT BY 'FirstName' DESC
  3. SELECT * FROM Persons ORDER BY FirstName DESC
  4. SELECT * FROM Persons SORT 'FirstName' DESC