MySQL Database Quiz Questions

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

In MySQL, the LIKE keyword is used to perform pattern matching in a SELECT statement.

Q2
True / False

MySQL LIKE keyword can be used without wildcards (% or _) to match patterns.

Q3
True / False

In MySQL, the wildcard character % in a LIKE pattern represents zero or more characters.

Q4
True / False

MySQL LIKE keyword is case-sensitive by default.

Q5
True / False

The _ wildcard in MySQL LIKE pattern represents exactly one character.

Q6
True / False

In MySQL, you can use the LIKE keyword with numeric data types.

Q7
True / False

In MySQL, the pattern LIKE 'A%' will match any string that starts with the letter 'A' and has zero or more characters following it.

Q8
True / False

MySQL allows combining LIKE with NOT to exclude certain patterns.

Q9
True / False

MySQL LIKE keyword supports regular expressions for more complex pattern matching.

Q10
True / False

In MySQL, using LIKE BINARY with the LIKE keyword makes the pattern match case-sensitive.

Q11
Single Choice

Which of the following SQL statements uses the LIKE operator correctly to find all rows where the name starts with the letter 'A'?

Q12
Single Choice

What will be the result of the following query?

SQL Code
SELECT * FROM employees WHERE title LIKE '%Manager';
Q13
Single Choice

Which of the following patterns will match any single character in the LIKE operator?

Q14
Single Choice

Given the table products, how can you find all product names that contain the word 'book' regardless of their position in the name?

Q15
Single Choice

How would you write a query to find all rows in the customers table where the email field does not start with 'info'?

Q16
Single Choice

In which scenario would you use the LIKE operator with a pattern like '___a%'?

Q17
Single Choice

Given the following query, what will be returned?

SQL Code
SELECT * FROM employees WHERE phone LIKE '12%3_5';
Q18
Single Choice

How can you search for all product codes in the inventory table where the code starts with either 'A' or 'B' and ends with the digit '3'?

Q19
Single Choice

You need to filter out rows where the description field contains exactly 10 characters, starting with 'Pro' and ending with 'ct'. Which query would you use?

Q20
Single Choice

In the employees table, how can you find all email addresses that have exactly one character before the '@' symbol?

Q21
Multiple Choice

Which query retrieves records from the 'employees' table where the 'name' starts with the letter 'J'?

SQL Code
SELECT *
FROM employees
WHERE name LIKE 'J%';
Q22
Multiple Choice

Identify the correct SQL query that retrieves records from the 'orders' table where 'order_id' ends with '123'.

SQL Code
SELECT *
FROM orders
WHERE order_id LIKE '%123';
Q23
Multiple Choice

Which query correctly selects records from the 'products' table where 'product_name' contains the word 'Pro'?

SQL Code
SELECT *
FROM products
WHERE product_name LIKE '%Pro%';
Q24
Multiple Choice

Determine the correct SQL query that retrieves records from the 'customers' table where the 'email' contains the domain 'example.com'.

SQL Code
SELECT *
FROM customers
WHERE email LIKE '%@example.com';
Q25
Multiple Choice

Which SQL query retrieves records from the 'inventory' table where 'item_code' starts with 'A' and ends with 'Z'?

SQL Code
SELECT *
FROM inventory
WHERE item_code LIKE 'A%Z';
Q26
Multiple Choice

Which query correctly retrieves records from the 'sales' table where 'sales_rep' contains the letters 'ann'?

SQL Code
SELECT *
FROM sales
WHERE sales_rep LIKE '%ann%';
Q27
Multiple Choice

Determine the correct SQL query that selects records from the 'transactions' table where 'transaction_id' starts with 'TX' and ends with '99'.

SQL Code
SELECT *
FROM transactions
WHERE transaction_id LIKE 'TX%99';
Q28
Multiple Choice

Which SQL query retrieves records from the 'projects' table where 'project_name' starts with 'Dev'?

SQL Code
SELECT *
FROM projects
WHERE project_name LIKE 'Dev%';
Q29
Multiple Choice

Identify the correct query that retrieves records from the 'clients' table where 'client_name' contains the word 'Corp'.

SQL Code
SELECT *
FROM clients
WHERE client_name LIKE '%Corp%';
Q30
Multiple Choice

Which SQL query correctly retrieves records from the 'students' table where 'student_id' starts with 'S' and ends with '1'?

SQL Code
SELECT *
FROM students
WHERE student_id LIKE 'S%1';