A quiz to test basic SQL skillz
TRIM
REPLACE
TRUNC
SELECT CUSTOMER_ID, CUSTOMER_NAME FROM CUSTOMERS WHERE POSTAL_CODE CONTAINS NULL
SELECT CUSTOMER_ID, CUSTOMER_NAME FROM CUSTOMERS WHERE POSTA_CODE = ''
SELECT CUSTOMER_ID, CUSTOMER_NAME FROM CUSTOMERS WHERE POSTAL_CODE IS NULL
SELECT CUSTOMER_ID, CUSTOMER_NAME FROM CUSTOMERS WHERE POSTAL_CODE = NULL
Constraints make complex queries easy
Constraints enforce rules at the view level
Constraints enforce rules at the table level
Constraints prevent the deletion of a table if there are dependencies
The main query executes with the first value returned by the subquery
The main query executes with the last value returned by the subquery
The main query executes with all the values returned by the subquery
The main query fails because the multiple row sub query cannot be used with the comparison operator
SELECT NAME FROM EMPLOYEE WHERE DATEDIFF('YYYY', GETDATE(), HIRE_DATE) > 5
SELECT NAME FROM EMPLOYEE WHERE (GETDATE()-HIRE_DATE)/365 > 5
SELECT NAME FROM EMPLOYEE WHERE DATEDIFF('YYYY', HIRE_DATE, GETDATE()) > 5
SELECT NAME FROM EMPLOYEE WHERE (HIRE_DATE-GETDATE())/*365 > 5
MAX
MIN
SUM
COUNT
Create groups of data
Sort data in a specific order
Convert data to a different format
Retrieve data based on an unknown condition
SELECT EMPLOYEE_ID, MEAL_ID, CALORIES FROM DIET RANGE ON CALORIES(800 AND 1000) INCLUSIVE
SELECT EMPLOYEE_ID, MEAL_ID, CALORIES FROM DIET HAVING CALORIES BETWEEN 800 AND 1000
SELECT EMPLOYEE_ID, MEAL_ID, CALORIES FROM DIET WHERE CALORIES BETWEEN 800 AND 1000
SELECT EMPLOYEE_ID, MEAL_ID, CALORIES FROM DIET WHERE CALORIES >= 800 AND
Removes the table
Removes all the rows from a table
Shortens tail of the table by the specified number of rows
Removes all columns from the table
The inner query always sorts the results of the outer query
The outer query always sorts the results of the inner query
The outer query must return a value to the inner query
The inner query returns a value to the outer query
N+2
N+1
N-2
N-1
Takes many rows as input and gives one output
Takes one row as input and gives one output
Takes many rows as input and gives many output
Takes many rows as input and gives no output
Quiz Review Timeline +
Our quizzes are rigorously reviewed, monitored and continuously updated by our expert board to maintain accuracy, relevance, and timeliness.
Wait!
Here's an interesting quiz for you.