SQL Fundamentals

A comprehensive quiz covering SQL basics including DDL/DML commands, clauses, joins, functions, and database operations.

20 Questions Published

Questions

Question 1 Multiple Choice (Single Answer)

Which SQL statement selects all rows from table called Contest, with column ContestDate having values greater or equal to May 25, 2006?

  1. SELECT * FROM Contest WHERE ContestDate >= '05/25/2006'
  2. SELECT * FROM Contest HAVING ContestDate >= '05/25/2006'
  3. SELECT * FROM Contest WHERE ContestDate < '05/25/2006'
  4. SELECT * FROM Contest IN ContestDate < '05/25/2006'
Question 2 Multiple Choice (Single Answer)

Which SQL statement inserts data into a table called Projects?

  1. INSERT INTO Projects (ProjectName, ProjectDescription) VALUES ('Content Development', 'Website content development project')
  2. INSERT Projects VALUES ('Content Development', 'Website content development project')
  3. INSERT Projects ('Content Development', 'Website content development project')
  4. SAVE INTO Projects (ProjectName, ProjectDescription) VALUES ('Content Development', 'Website content development project')
Question 3 Multiple Choice (Single Answer)

Which of the following SQL statements will select all records with all their columns from a table called Sales.

  1. SELECT * FROM Sales
  2. DELETE FROM Sales
  3. SELECT * FROM SALES WHERE OrderID < 1
  4. SELECT FROM Sales
Question 4 Multiple Choice (Single Answer)

Which of the following SQL statements deletes all rows in table called SalesData?

  1. DELETE FROM SalesData
  2. DELETE * FROM SalesData
  3. DELETE SalesData
  4. DELETE ALL SalesData
Question 5 Multiple Choice (Single Answer)

What is the ABS SQL function used for?

  1. To return the minimum value of a numeric expression.
  2. To return the absolute, positive value of a numeric expression.
  3. To return the maximum value of a numeric expression.
  4. To return the average value of a numeric expression.
Question 6 Multiple Choice (Single Answer)

The HAVING clause can be used only with ...

  1. INSERT clause
  2. SELECT clause
  3. DELETE clause
  4. JOIN clause
Question 7 Multiple Choice (Single Answer)

If you join a table to itself, what kind of join are you using?

  1. Selective Join.
  2. You can't join a table to itself.
  3. Self Join
  4. Outer Join
Question 8 Multiple Choice (Single Answer)

Which SQL keyword is used to retrieve a maximum value?

  1. MAX
  2. TOP
  3. MOST
  4. UPPER
Question 9 Multiple Choice (Single Answer)

Which of the following SQL clauses specifies a search condition?

  1. WHERE
  2. SEARCH
  3. FROM
  4. WHILE
Question 10 Multiple Choice (Single Answer)

The IN SQL keyword…

  1. Determines if a value matches any of the values in a list or a sub-query.
  2. Defines the tables we are selecting or deleting data from.
  3. Is used with the DISTINCT SQL keyword only.
  4. Is used to select data from a view
Question 11 Multiple Choice (Single Answer)

A trigger is…

  1. a special type of table
  2. a special type of store procedure, executed when certain event occurs
  3. a special type of view
  4. an event
Question 12 Multiple Choice (Single Answer)

Which of the following is a SQL aggregate function

  1. LEFT
  2. LEN
  3. AVG
  4. JOIN
Question 13 Multiple Choice (Single Answer)

"select" - Belogns to

  1. DML
  2. MDL
  3. DDL
  4. All the above
Question 14 True/False

"select E_Name,E_Number from EMP order by 2" This Query is

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

Which key word is used to remove a table from the database

  1. Delete
  2. Truncate
  3. Remove
  4. Drop
Question 16 Multiple Choice (Single Answer)

To Insert new a column in a table Tbl_Test which of the following query is used

  1. Alter table Tbl_Test Insert column New_Column varchar 20
  2. Alter table Tbl_Test Alter column New_Column varchar 20
  3. Alter table Tbl_Test add New_Column varchar 20
  4. Either a or b could be used
Question 17 True/False

Calling a stored Procedure inside a view is Possible

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

In the following which is not a DDL ?

  1. Truncate
  2. Create
  3. Alter
  4. All the above
Question 19 True/False

select Project_ID,Project_Name,Project_Status from Projects group by Project_ID,Project_Status,Project_Name

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

When "Join" is used in a query which should not be used with that

  1. On
  2. Where
  3. Having
  4. Non of the Above