Basic SQL Quiz

Basic SQL Quiz

18 Questions Published

Questions

Question 1 Multiple Choice (Single Answer)

What does SQL stand for?

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

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

  1. GET
  2. OPEN
  3. EXTRACT
  4. SELECT
  5. QUERY
Question 3 Multiple Choice (Single Answer)

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

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

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

  1. TRUNCATE
  2. DELETE
  3. REMOVE
Question 5 Multiple Choice (Single Answer)

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

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

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

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

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

  1. SELECT [all] FROM Persons
  2. SELECT All Persons
  3. SELECT *.Persons
  4. SELECT * 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 [all] FROM Persons WHERE FirstName='Peter'
  2. SELECT * FROM Persons WHERE FirstName LIKE '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 LIKE '%a'
  3. SELECT * FROM Persons WHERE FirstName='a'
  4. SELECT * FROM Persons WHERE FirstName LIKE 'a%'
  5. SELECT * FROM Persons WHERE FirstName='a'"
Question 10 Multiple Choice (Single Answer)

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)

Given an employees table as follows: empid name managerid a1 bob NULL b1 jim a1 B2 tom a1 What value will select count(*) from employees return?

  1. 1
  2. 2
  3. 3
  4. none of the above
Question 12 Multiple Choice (Single Answer)

The result of a SELECT statement can contain duplicate rows.

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

Sometimes the expression "select count(*)" will return fewer rows than the expression "select count(value)".

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

What type of lock will deny users any access to a table?

  1. EXPLICIT
  2. IMPLICIT
  3. EXCLUSIVE
  4. SHARED
  5. READ ONLY
Question 15 Multiple Choice (Single Answer)

Which of the following is the correct SQL statement to use to remove rows from a table?

  1. DROP
  2. REMOVE ROW
  3. DELETE
  4. DELETE ROW
Question 16 Multiple Choice (Single Answer)

The only way to join two tables is by using standard, ANSI syntax.

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

A NULL value is treated as a blank or 0.

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

The left outer join is one type of outer join. Another one is the.

  1. right
  2. full
  3. right outer
  4. full outer
  5. all of the above