Vidyalelo
SQL · all questions

SQL
practice.

Practice every MCQ with options. Use Show answers when you want the correct option and solution.

79

Questions

2/4

Page

Pick an option on a question to see the right answer and solution.

Table Employee has 10 records. It has a non-NULL SALARY column which is also UNIQUE.
The SQL statement
SELECT COUNT(*) FROM Employee WHERE SALARY > ANY (SELECT SALARY FROM EMPLOYEE);
prints

Select an option to see the answer and solution.

The SQL statement
SELECT SUBSTR('abcdefghij', INSTR('123321234', '2', 3, 2), 2) FROM DUAL;
prints

Select an option to see the answer and solution.

The SQL statement
SELECT ROUND(45.926, -1) FROM DUAL;

Select an option to see the answer and solution.

Which of the following must be enclosed in double quotes?

Select an option to see the answer and solution.

Which of the following command makes the updates performed by the transaction permanent in the database?

Select an option to see the answer and solution.

Which command undo all the updates performed by the SQL in the transaction?

Select an option to see the answer and solution.

Find all the cities whose humidity is 89, Table Name weather

Select an option to see the answer and solution.

Find the temperature in increasing order of all cities, Table Name 'weather'

Select an option to see the answer and solution.

What is the meaning of LIKE '%0%0%'

Select an option to see the answer and solution.

Find the names of these cities with temperature and condition whose condition is neither sunny nor cloudy

Select an option to see the answer and solution.

Find the name of those cities with temperature and condition whose condition is either sunny or cloudy but temperature must be greater than 70oF.

Select an option to see the answer and solution.

Find all the tuples having temperature greater than 'Paris'.

Select an option to see the answer and solution.

Find all the cities with temperature, condition and humidity whose humidity is in the range of 63 to 79

Select an option to see the answer and solution.

Find the names of the countries whose condition is sunny.

Select an option to see the answer and solution.

Find the name of all cities with their temperature, humidity and countries.

Select an option to see the answer and solution.

Find the name of cities with all entries whose temperature is in the range of 71 and 89

Select an option to see the answer and solution.

Which of the following query finds the names of the sailors who have reserved at least one boat?

Select an option to see the answer and solution.

Which of the following query finds colors of boats reserved by "Dustin"?

Select an option to see the answer and solution.

What does the following query find?
(SELECT DISTINCT r.sid
FROM boats b, reserves r
WHERE b.bid = r.bid
AND b.color = 'red')
MINUS
(SELECT DISTINCT r.sid
FROM boats b, reserves r
WHERE b.bid = r.bid
AND b.color = 'green')

Select an option to see the answer and solution.

Which of the following query finds the name of the sailors who have reserved at least two boats?

Select an option to see the answer and solution.