Alien head

Basic SQL Quiz

Description: Basic SQL Quiz
Number of Questions: 18
Created by:
Tags: sql

What does SQL stand for?

sql
  1. Strong Question Language

  2. Structured Question Language

  3. Structured Query Language

Answer: 3

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

sql
  1. GET

  2. OPEN

  3. EXTRACT

  4. SELECT

  5. QUERY

Answer: 4

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

sql
  1. UPDATE

  2. SAVE AS

  3. MODIFY

  4. SAVE

Answer: 1

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

sql
  1. TRUNCATE

  2. DELETE

  3. REMOVE

Answer: 2

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

sql
  1. ADD RECORD

  2. ADD INTO

  3. INSERT

  4. ADD NEW

Answer: 3

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

sql
  1. EXTRACT FirstName FROM Persons

  2. SELECT FirstName FROM Persons

  3. SELECT Persons.FirstName

Answer: 2

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

sql
  1. SELECT [all] FROM Persons

  2. SELECT All Persons

  3. SELECT *.Persons

  4. SELECT * FROM Persons

Answer: 4

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

sql
  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'

Answer: 4

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

sql
  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'"

Answer: 4

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

sql
  1. True

  2. False

Answer: 1

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?

sql
  1. 1

  2. 2

  3. 3

  4. none of the above

Answer: 3

The result of a SELECT statement can contain duplicate rows.

sql
  1. True

  2. False

Answer: 1

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

sql
  1. True

  2. False

Answer: 2

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

sql
  1. EXPLICIT

  2. IMPLICIT

  3. EXCLUSIVE

  4. SHARED

  5. READ ONLY

Answer: 3

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

sql
  1. DROP

  2. REMOVE ROW

  3. DELETE

  4. DELETE ROW

Answer: 3

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

sql
  1. True

  2. False

Answer: 2

A NULL value is treated as a blank or 0.

sql
  1. True

  2. False

Answer: 2

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

sql
  1. right

  2. full

  3. right outer

  4. full outer

  5. all of the above

Answer: 5
+ View questions