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 is used to check if two values are not equal.

Q2
True / False

The '!=' operator in MySQL cannot be used to compare string values.

Q3
True / False

Using '!=' in MySQL is equivalent to using '<>'.

Q4
True / False

In MySQL, the query SELECT * FROM employees WHERE salary != 5000 returns all employees with a salary different from 5000.

Q5
True / False

In MySQL, NULL != NULL returns TRUE.

Q6
True / False

The '<>' operator in MySQL can be used within a CASE statement to handle conditional logic based on inequality.

Q7
True / False

In MySQL, the query SELECT * FROM products WHERE price != 0 AND price IS NOT NULL ensures that the price is neither zero nor NULL.

Q8
True / False

MySQL optimizes the use of '!=' and '<>' operators equally in query execution plans.

Q9
True / False

In MySQL, the '!=' operator can be used with the IN clause to exclude specific values.

Q10
True / False

In MySQL, using '!=' in a JOIN condition can produce the same results as using an inner join with an inequality condition.

Q11
Single Choice

Which MySQL operator is used to compare two values for inequality?

Q12
Single Choice

What will this query return?

SQL Code
Consider the following MySQL statement:
SELECT * FROM employees WHERE salary <> 50000;
Q13
Single Choice

Which of the following queries would correctly return all rows where the status column is not equal to 'active'

Q14
Single Choice

Given the table orders, which SQL query will return orders where the quantity is not equal to 10?

SQL Code
SELECT * FROM orders WHERE quantity ______ 10;
Q15
Single Choice

What will the following MySQL query return?

SQL Code
SELECT name FROM products WHERE price <> 100 AND price <> 200;
Q16
Single Choice

Which query will select rows where the column discount is not equal to zero?

SQL Code
SELECT * FROM sales WHERE discount ______ 0;
Q17
Single Choice

Given the table student_scores with columns name and score, which query will return students who did not score 75 or 85?

SQL Code
SELECT name FROM student_scores WHERE score ______ 75 AND score ______ 85;
Q18
Single Choice

What does it return?

SQL Code
Analyze the following SQL query:
SELECT id FROM inventory WHERE stock != 0 AND stock != 10;
Q19
Single Choice

Given a table transactions, which of the following SQL queries will list all transactions where the amount is not 500 or 1000?

SQL Code
SELECT * FROM transactions WHERE amount <> 500 AND amount <> 1000;
Q20
Single Choice

You have a table customers with a column age. Which query will return customers who are not exactly 18 years old?

SQL Code
SELECT * FROM customers WHERE age ______ 18;
Q21
Multiple Choice

Which query correctly retrieves records from the 'employees' table where 'department_id' is not equal to 3?

SQL Code
SELECT *
FROM employees
WHERE department_id <> 3;
Q22
Multiple Choice

Identify the correct SQL query that retrieves records from the 'orders' table where 'order_status' is not equal to 'Shipped'.

SQL Code
SELECT *
FROM orders
WHERE order_status != 'Shipped';
Q23
Multiple Choice

Which query correctly selects records from the 'products' table where 'category_id' is not equal to 10?

SQL Code
SELECT *
FROM products
WHERE category_id <> 10;
Q24
Multiple Choice

Determine the correct SQL query that retrieves records from the 'customers' table where 'country' is not equal to 'USA'.

SQL Code
SELECT *
FROM customers
WHERE country <> 'USA';
Q25
Multiple Choice

Which SQL query retrieves records from the 'inventory' table where 'quantity' is not equal to 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 not equal to 5000?

SQL Code
SELECT *
FROM sales
WHERE total_sales != 5000;
Q27
Multiple Choice

Determine the correct SQL query that selects records from the 'transactions' table where 'transaction_amount' is not equal to 100.

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

Which SQL query retrieves records from the 'projects' table where 'budget' is not equal to 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 not equal to 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 not equal to 85?

SQL Code
SELECT *
FROM students
WHERE marks <> 85;