SQL Fundamentals Quiz

Test your knowledge of SQL commands, database operations, views, indexes, and query techniques including SELECT, UPDATE, JOIN, and WHERE clauses.

15 Questions Published

Questions

Question 1 Multiple Choice (Single Answer)

We refer to a join as a self-join when…

  1. we are joining more than 2 tables
  2. we are joining table to itself
  3. we are using left and right join together
  4. none of the above
Question 2 Multiple Choice (Single Answer)

What is the correct order of the ">" and the "=" operators, when we want to specify greater or equal search condition?

  1. >=
  2. Neither of the other two.
  3. =>
  4. !>=
Question 3 Multiple Choice (Single Answer)

What does the HAVING clause do?

  1. The HAVING keyword specifies a search condition for an aggregate or a group
  2. The HAVING keyword is used to select distinct values
  3. The HAVING keyword is used to join 2 or more tables.
  4. None of the above
Question 4 Multiple Choice (Single Answer)

What does follow after the SQL SELECT clause?

  1. The JOIN SQL clause.
  2. List of columns that will be selected or the * symbol.
  3. The name of the table we are selecting from.
  4. None of the above
Question 5 Multiple Choice (Single Answer)

What is an index?

  1. An index is the same as alias.
  2. An index is a special way to join 2 or more tables.
  3. An index is a database table attribute, which speeds-up data search within a table.
  4. None of the above
Question 6 Multiple Choice (Single Answer)

What is a view?

  1. A view is a special stored procedure executed when certain event occurs.
  2. A view is a database diagram.
  3. A view is a virtual table which results of executing a pre-compiled query. A view is not part of the physical database schema, while the regular tables are
  4. None of the above
Question 7 Multiple Choice (Single Answer)

How can you change "Hansen" into "Nilsen" in the "LastName" column in the Persons table

  1. UPDATE Persons SET LastName='Hansen' WHERE LastName='Nilsen'
  2. MODIFY Persons SET LastName='Hansen' WHERE LastName='Nilsen'
  3. UPDATE Persons SET LastName='Nilsen' WHERE LastName='Hansen'
  4. MODIFY Persons SET LastName='Nilsen' WHERE LastName='Hansen'
Question 8 Multiple Choice (Single Answer)

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 9 Multiple Choice (Single Answer)

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

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

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

  1. SELECT * FROM Persons ORDER BY FirstName DESC
  2. SELECT * FROM Persons SORT BY 'FirstName' DESC
  3. SELECT * FROM Persons SORT 'FirstName' DESC
  4. SELECT * FROM Persons ORDER FirstName DESC
Question 11 Multiple Choice (Single Answer)

Which SQL statement is used to return only different values

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

Which of the following can be a valid column name?

  1. Column
  2. 123_Invoices
  3. Catch_#22
  4. #Invoices
  5. None of the above
Question 13 True/False

The TRUNCATE command writes user data to Rollback segments

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

To produce a meaningful result set without any cartesian products, what is the minimum number of conditions that should appear in the WHERE clause of a that joins 'N' tables?

  1. 4
  2. 3
  3. N - 1
  4. N + 1
Question 15 Multiple Choice (Single Answer)

When a user creates an object without a TABLESPACE clause, where will Oracle store the segment?

  1. System tablespace
  2. Users tablespace
  3. Default tablespace for the user
  4. Oracle will give an error