MySQL Database Quiz Questions

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

In MySQL, the DISTINCT keyword is used to remove duplicate rows from the result set.

Q2
True / False

Using DISTINCT in MySQL can be applied to multiple columns in a single query.

Q3
True / False

In MySQL, the DISTINCT keyword can only be used with numeric columns.

Q4
True / False

In MySQL, using DISTINCT with ORDER BY can change the order of the result set.

Q5
True / False

In MySQL, when using DISTINCT, the column alias can be used in the ORDER BY clause.

Q6
True / False

In MySQL, the DISTINCT keyword can be used with aggregate functions like SUM and COUNT.

Q7
True / False

In MySQL, using DISTINCT on a column with NULL values will return only one NULL in the result set.

Q8
True / False

In MySQL, you can use the DISTINCT keyword in a subquery within the FROM clause.

Q9
True / False

In MySQL, the DISTINCT keyword can be used with the GROUP BY clause to further filter unique groups.

Q10
True / False

In MySQL certification exams, it's stated that using DISTINCT with LIMIT will always return the exact number of unique rows specified by LIMIT.

Q11
Single Choice

Which keyword is used in MySQL to eliminate duplicate rows from the result set?

Q12
Single Choice

What will this query return?

SQL Code
Consider the following MySQL query :
SELECT DISTINCT city FROM customers;
Q13
Single Choice

Which of the following statements is true about the MySQL DISTINCT keyword?

Q14
Single Choice

Which of the following best describes the result set?

SQL Code
Given the following MySQL query: SELECT DISTINCT first_name, last_name FROM employees;
Q15
Single Choice

What is the output of the following MySQL query if the table orders contains 10 rows with 2 distinct order_date values?

Q16
Single Choice

Which of the following will be true about the output?

SQL Code
Consider the following MySQL query:SELECT DISTINCT department_id FROM employees ORDER BY department_id DESC;
Q17
Single Choice

If the employees table has 1000 rows, what does this query return?

SQL Code
Given the following MySQL query:SELECT DISTINCT salary FROM employees WHERE salary > 50000 ORDER BY salary;
Q18
Single Choice

How does MySQL handle NULL values when using the DISTINCT keyword?

Q19
Single Choice

What will be the result of the following MySQL query:

SQL Code
SELECT DISTINCT COUNT(product_id) FROM sales WHERE amount > 100;
Q20
Single Choice

In a certification exam scenario, which MySQL query will return the number of distinct employee_id values from the attendance table?

Q21
Multiple Choice

Which query correctly selects unique values for the 'department' column from the 'employees' table?

SQL Code
SELECT DISTINCT department
FROM employees;
Q22
Multiple Choice

Identify the correct SQL query that retrieves unique combinations of 'department' and 'position' from the 'employees' table.

SQL Code
SELECT DISTINCT department, position
FROM employees;
Q23
Multiple Choice

Which query correctly retrieves unique 'customer_id' values from the 'orders' table?

SQL Code
SELECT DISTINCT customer_id
FROM orders;
Q24
Multiple Choice

Determine the correct query to select distinct values from the 'product_name' column in the 'products' table.

SQL Code
SELECT DISTINCT product_name
FROM products;
Q25
Multiple Choice

Which query retrieves distinct 'category' values from the 'items' table, sorted by 'category' in ascending order?

SQL Code
SELECT DISTINCT category
FROM items
ORDER BY category ASC;
Q26
Multiple Choice

Which query retrieves unique combinations of 'city' and 'state' from the 'customers' table, sorted by 'state'?

SQL Code
SELECT DISTINCT city, state
FROM customers
ORDER BY state;
Q27
Multiple Choice

Determine the correct query to retrieve distinct 'supplier_name' and 'contact_name' pairs from the 'suppliers' table.

SQL Code
SELECT DISTINCT supplier_name, contact_name
FROM suppliers;
Q28
Multiple Choice

Which query retrieves distinct 'order_status' values from the 'orders' table, limited to the first 5 unique values?

SQL Code
SELECT DISTINCT order_status
FROM orders
LIMIT 5;
Q29
Multiple Choice

Which SQL query correctly retrieves unique 'employee_id' and 'project_id' combinations from the 'assignments' table?

SQL Code
SELECT DISTINCT employee_id, project_id
FROM assignments;
Q30
Multiple Choice

Identify the correct SQL query to retrieve distinct 'country' values from the 'suppliers' table, ordered by 'country' in descending order.

SQL Code
SELECT DISTINCT country
FROM suppliers
ORDER BY country DESC;