MySQL Database Quiz Questions

Course Name:MySQL
Chapter Name:Chapter 7 - DQL (Data Query Language)
Current Quiz Count:30
Progress
0%
Q1
True / False

In MySQL, the > operator can be used to compare two numeric values.

Q2
True / False

The < operator in MySQL cannot be used with string values.

Q3
True / False

In MySQL, 5 > 3 will return true.

Q4
True / False

In MySQL, the expression SELECT 10 > 5; will return 0.

Q5
True / False

MySQL allows the use of the > operator in the WHERE clause to filter rows.

Q6
True / False

In MySQL, the comparison NULL > 0 returns true.

Q7
True / False

In MySQL, you can use the > operator to compare the results of two subqueries.

Q8
True / False

The < operator can be used in MySQL to compare values in different columns of the same row.

Q9
True / False

In MySQL, the query SELECT * FROM table WHERE column > 100; will select rows where the value in column is greater than 100.

Q10
True / False

In MySQL, the > operator can be used with date values to compare which date is later.

Q11
Single Choice

Which MySQL query would you use to find all employees with a salary greater than 50,000?

Q12
Single Choice

What does the following MySQL query return?

SQL Code
SELECT * FROM products WHERE price < 100;
Q13
Single Choice

Which condition is true for the expression 10 > 5 in MySQL?

Q14
Single Choice

Given the table orders, which MySQL query finds orders placed before 2023-01-01?

SQL Code
+----+-------------+------------+
| id | order_date | total |
+----+-------------+------------+
| 1 | 2023-01-02 | 250.00 |
| 2 | 2022-12-15 | 500.00 |
| 3 | 2023-02-10 | 150.00 |
+----+-------------+------------+
Q15
Single Choice

Which MySQL query correctly finds all students with grades greater than 85?

SQL Code
+----+--------+-------+
| id | name | grade |
+----+--------+-------+
| 1 | Alice | 88 |
| 2 | Bob | 76 |
| 3 | Carol | 92 |
+----+--------+-------+
Q16
Single Choice

What does the following MySQL query return?

SQL Code
SELECT COUNT(*) FROM inventory WHERE quantity < 10;
Q17
Single Choice

Which MySQL query would you use to find all employees whose age is between 30 and 50 years?

SQL Code
SELECT * FROM employees WHERE age > 30 AND age < 50;
Q18
Single Choice

What is the result of the following MySQL query?

SQL Code
SELECT * FROM sales WHERE revenue > 1000 OR revenue < 500;
Q19
Single Choice

Which MySQL query correctly identifies employees whose salary is less than the average salary?

SQL Code
SELECT * FROM employees WHERE salary < (SELECT AVG(salary) FROM employees);
Q20
Single Choice

What will the following MySQL query return?

SQL Code
SELECT * FROM transactions WHERE amount > 0 AND amount < 1000;
Q21
Multiple Choice

Which query correctly retrieves records from the 'employees' table where 'salary' is greater than 50000?

SQL Code
SELECT *
FROM employees
WHERE salary > 50000;
Q22
Multiple Choice

Identify the correct SQL query that retrieves records from the 'orders' table where 'order_amount' is less than 1000.

SQL Code
SELECT *
FROM orders
WHERE order_amount < 1000;
Q23
Multiple Choice

Which query correctly selects records from the 'products' table where 'price' is greater than 50 and less than 200?

SQL Code
SELECT *
FROM products
WHERE price > 50
AND price < 200;
Q24
Multiple Choice

Determine the correct SQL query that retrieves records from the 'customers' table where 'age' is less than 30.

SQL Code
SELECT *
FROM customers
WHERE age < 30;
Q25
Multiple Choice

Which SQL query retrieves records from the 'inventory' table where 'quantity' is greater than 100?

SQL Code
SELECT *
FROM inventory
WHERE quantity > 100;
Q26
Multiple Choice

Which query correctly retrieves records from the 'sales' table where 'total_sales' is less than 5000 OR greater than 10000?

SQL Code
SELECT *
FROM sales
WHERE total_sales < 5000
OR total_sales > 10000;
Q27
Multiple Choice

Determine the correct SQL query that selects records from the 'transactions' table where 'transaction_amount' is greater than 100 AND less than 1000.

SQL Code
SELECT *
FROM transactions
WHERE transaction_amount > 100
AND transaction_amount < 1000;
Q28
Multiple Choice

Which SQL query retrieves records from the 'projects' table where 'budget' is greater than 50000?

SQL Code
SELECT *
FROM projects
WHERE budget > 50000;
Q29
Multiple Choice

Identify the correct query that retrieves records from the 'clients' table where 'revenue' is less than 200000.

SQL Code
SELECT *
FROM clients
WHERE revenue < 200000;
Q30
Multiple Choice

Which SQL query correctly retrieves records from the 'students' table where 'marks' are greater than 80 AND less than 90?

SQL Code
SELECT *
FROM students
WHERE marks > 80
AND marks < 90;