NEW
Font size
WorksheetsSQL Quiz
Total questions: 30
Worksheet time: 15mins
Which of the following is not a DDL command?
TRUNCATE
ALTER
CREATE
UPDATE
Which statement is used to delete all rows in a table without having the action logged?
DELETE
DROP
TRUNCATE
REMOVE
SQL Views are also known as
Simple Tables
Virtual Tables
Complex Tables
Actual Tables
Which of the following is not Constraint in SQL?
Not Null
Check
Union
Primary Key
Which of the following is not a valid aggregate function?
SUM
MAX
COMPUTE
COUNT
Which data manipulation command is used to combines the records from one or more tables?
SELECT
PROJECT
JOIN
PRODUCT
Which operator is used to compare a value to a specified list of values?
IN
ALL
BETWEEN
ANY
What operator tests column for absence of data
NOT operator
EXISTS operator
IS NULL operator
! (NOT operator)
In which of the following cases a DML statement is not executed?
When existing rows are modified.
When a table is deleted.
When some rows are deleted.
All of these
If we have not specified ASC or DESC after a SQL ORDER BY clause, the following is used by default
DESC
ASC
Query will not run
There is no default value
Which of the following is true about the HAVING clause?
Similar to the WHERE clause but is used for columns rather than groups.
Similar to WHERE clause but is used for rows rather than columns.
Similar to WHERE clause but is used for groups rather than rows.
Acts exactly like a WHERE clause.
_________ command makes the updates performed by the transaction permanent in the database?
COMMIT
ROLLBACK
SAVE
RECORD
Which command is used to change the definition of a table in SQL?
CREATE
ALTER
UPDATE
CHANGE
Which type of JOIN is used to returns rows that do not have matching values?
INNER JOIN
OUTER JOIN
EQUI JOIN
THETA JOIN
Which of the following is the correct order of a SQL statement?
SELECT, GROUP BY, WHERE, HAVING
SELECT, WHERE, GROUP BY, HAVING
SELECT, HAVING, WHERE, GROUP BY
SELECT, WHERE, HAVING, GROUP BY
What is the difference between a PRIMARY KEY and a UNIQUE KEY?
Primary key can store null value, whereas a unique key cannot store null value.
We can have only one primary key in a table while we can have multiple unique keys
Primary key cannot be a date variable whereas unique key can be
No difference at all. Both are same.
______ is NOT a type of constraint in SQL language?
Foreign Key
Primary Key
Unique
Alternate Key
Which statement is used to get all data from the student table whose name starts with p?
SELECT * FROM student WHERE name LIKE '%p%';
SELECT * FROM student WHERE name LIKE 'p%';
SELECT * FROM student WHERE name LIKE '_p%';
SELECT * FROM student WHERE name LIKE '%p';
The command to remove rows from a table 'CUSTOMER' is:
REMOVE FROM CUSTOMER ...
DROP FROM CUSTOMER ...
DELETE FROM CUSTOMER WHERE ...
UPDATE FROM CUSTOMER ...
The SQL WHERE clause:
limits the column data that are returned.
limits the row data are returned.
Find the location of Row in a table
Find the location of Column in a table
The wildcard in a WHERE clause is useful when?
An exact match is necessary in a SELECT statement.
An exact match is not possible in a SELECT statement.
An exact match is necessary in a CREATE statement.
An exact match is not possible in a CREATE statement.
The SQL keyword(s) ________ is used with wildcards.
LIKE only
IN only
NOT IN only
IN and NOT IN
The result of a SQL SELECT statement is a(n) ________ .
Report
Form
File
Table
Which of the following are the five built-in functions provided by SQL?
COUNT, SUM, AVG, MAX, MIN
SUM, AVG, MIN, MAX, MULT
SUM, AVG, MULT, DIV, MIN
SUM, AVG, MIN, MAX, NAME
To remove duplicate rows from the results of an SQL SELECT statement, the ________ qualifier specified must be included.
ONLY
UNIQUE
DISTINCT
SINGLE
Which of the following do you need to consider when you make a table in SQL?
Data Types
Primary Key
Default Values
All of these
Which one of the following sorts rows in SQL?
SORT BY
ALIGN BY
ORDER BY
GROUP BY
The SQL statement that queries or reads data from a table is ________ .
SELECT
READ
QUERY
None of these
The SQL keyword BETWEEN is used:
For ranges
To limit the columns displayed.
As a wildcard
None of these
SQL is:
a programming language.
an operating system.
a data sublanguage
a DBMS
