Basic SELECT Statements
Filtering Data
Sorting & Limiting Results
Joins
Logic & Conditions
100

What SQL keyword is used to retrieve all columns from a table?

Answer: `SELECT `

100

What clause is used to filter rows in a query?

Answer: `WHERE`

100

What clause is used to sort query results?

Answer: `ORDER BY`

100

What type of join returns only matching records from both tables?

Answer: `INNER JOIN`

100

What SQL keyword is used for conditional logic within a query?

Answer: `CASE`

200

What clause is used to specify the table from which data will be retrieved?

Answer: `FROM`

200

Which operator is used to check if a value is within a specified range?

Answer: `BETWEEN ... AND ...`

200

How do you retrieve only the top 5 rows in Oracle SQL?

Answer: Use `FETCH FIRST 5 ROWS ONLY`

200

What type of join returns all records from the left table and matching records from the right table?

Answer: `LEFT JOIN`

200

What are the three main logical operators in SQL? 

Answer: `AND`, `OR`, `NOT`

300

If a table contains 10,000 rows, how many rows will `SELECT  * FROM employees;` return?

 Answer: 10,000

300

What keyword would you use to filter out duplicate values in a result set?

Answer: `DISTINCT`

300

What is the default sorting order in an `ORDER BY` clause?

Answer: Ascending (`ASC`)

300

If Table A has 10 rows and Table B has 5 rows, what is the maximum number of rows returned by an INNER JOIN on a non-key column?

Answer: It depends on matching values; if one row in A matches multiple in B, more than 5 rows can be returned.

300

If `age = 25`, what does `WHERE age < 30 AND age > 40` return?

Answer: No rows, because 25 is not greater than 40.

400

True or False: The `SELECT` statement is executed before the `ORDER BY` clause in Oracle SQL.

Answer: False – `ORDER BY` is processed last in the logical execution order.

400

What is the result of `WHERE salary > 5000 AND salary < 5000`?

Answer: No rows are returned, as no value can be both greater and less than 5000 at the same time

400

 If two rows have the same values in the `ORDER BY` column, how does SQL determine their order?

Answer: Oracle does not guarantee order for identical values unless a secondary sort column is specified.

400

True or False: A `LEFT JOIN` can return more rows than the original left table.

Answer: True – if the right table has multiple matches for a single left-table row, duplicates occur

400

If `salary = NULL`, what is the result of `WHERE salary = 5000 OR salary = NULL`?

Answer: No rows, because `NULL` cannot be compared with `=`

500

What happens if you run `SELECT department FROM employees;` but the `department` column doesn’t exist in the table?

Answer: Oracle returns an error: "invalid identifier."

500

If you filter data using `WHERE last_name = 'O'Reilly'`, what will happen?

Answer: Syntax error due to an unescaped single quote; you should use `WHERE last_name = 'O''Reilly'`

500

What happens if you use `ORDER BY column_name DESC` but the column contains `NULL` values?

Answer: `NULL` values appear first unless `NULLS LAST` is specified

500

What happens when a `JOIN` condition is missing?

A Cartesian product is produced, multiplying the row count of both tables.

500

Given the query `SELECT CASE WHEN salary > 5000 THEN 'High' ELSE 'Low' END AS SalaryGroup FROM employees;`, what happens if `salary` is NULL?

Answer: It falls into the `ELSE` category, returning "Low."

M
e
n
u