Home > Databases > Quizzes > MySQL Basics Practice Test: MySQL Conditional Evaluation, Condition Types
MySQL Basics Practice Test: MySQL Conditional Evaluation, Condition Types
Fast practice, instant feedback. Timer auto-submits when time’s up.
Avg score: 60% Most missed: “Select odd one out?”
MySQL has two conditional control statements: IF and CASE, which have similar functions. The IF statement verifies a condition and executes a set of SQL statements based on the condition. The CASE expression performs if-then-else logic in SQL and can be used in various contexts like SELECT, WHERE, and ORDER BY clauses.  The IF statement has three types: IF-THEN and IF-THEN-ELSEIF-ELSE.  The IF statement returns one of the three values True, False, or NULL. The CASE expression checks all conditions and returns a value if the first condition is met.  The syntax for the IF statement is: IF... Show more
MySQL Basics Practice Test: MySQL Conditional Evaluation, Condition Types
Time left 00:00
25 Questions

1. What is the meaning of “Inequality Condition”?
2. Which of the following statements is/are correct?
3. What will be the output of the following MySQL statement?
SELECT *
FROM employee
WHERE lname LIKE %t%f%n%;
4. What will be the result of the following MySQL command?
WHERE end_date IS NULL
AND NOT (title=’teller’ OR start_date < ‘2007-01-01’)
5. What will be the output of the following MySQL statement?
SELECT emp_id, fname, lname
FROM employee
WHERE LEFT (fname, 1) =’F’ OR LEFT (lname, 1) =’F’;
6. Which of the following statements is/are correct?
7. What will be the output of the following MySQL statement?
SELECT *
FROM employee
WHERE lname LIKE ‘_a%e%’;
8. Consider a database name “Fatskills” whose attributes are intern_id (primary key), subject.
Intern_id = {1, 2, 3, 4, 5, 6}
Subject = {sql, oop, sql, oop, c, c++}
If these are one to one relation then what will be the output of the following MySQL statement?
SELECT intern_id
FROM fatskills
WHERE subject NOT IN (c, c++, oop);
9. Which among the following operators is/are belongs to “Inequality conditions”?
10. What will be the output of the following MySQL statement?
SELECT emp_id, fname, lname
FROM employee
WHERE LEFT (lname, 1) =’F’;
11. Which of the following statements is/are correct?
12. llowing MySQL command?
WHERE end_date IS NULL
AND (title=’teller’ OR start_date < ‘2007-01-01’)"
13. Consider a database name “Fatskills” whose attributes are intern_id (primary key), subject.
Intern_id = {1, 2, 3, 4, 5, 6}
Subject = {sql, oop, sql, oop, c, c++}
If these are one to one relation then what will be the output of the following MySQL statement?
SELECT intern_id
FROM fatskills
WHERE subject IN (c, c++, oop);
14. Which among the following operators is/are belongs to “Equality conditions”?
15. Which of the following statements is/are correct?
16. Select odd one out?
17. What will be the output of the following MySQL statement?
SELECT *
FROM employee
WHERE lname LIKE %bas% OR fname LIKE %bbs%;
18. What will be the output of the following MySQL statement?
SELECT emp_id, fname, lname
FROM employee
WHERE LEFT (fname, 1) =’F’;
19. What will be the output of the following MySQL statement?
SELECT *
FROM employee
WHERE lname LIKE ‘F%’ AND lname LIKE ‘%T’;
20. Consider a database name “Fatskills” whose attributes are intern_id (primary key), subject.
Intern_id = {1, 2, 3, 4, 5, 6}
Subject = {sql, oop, sql, oop, c, c++}
If these are one to one relation then what will be the output of the following MySQL statement?
SELECT intern_id
FROM fatskills
WHERE subject IN (c, c++);
21. What will be the output of the following MySQL statement?
SELECT *
FROM employee
WHERE lname LIKE ‘F%’ OR lname LIKE ‘%T’;
22. Consider a database name “Fatskills” whose attributes are intern_id (primary key), subject, subject_value.
Intern_id = {1, 2, 3, 4, 5, 6}
Subject = {sql, oop, sql, oop, c, c++}
Subject_value = {0, 0, 1, 1, 2, 2, 3, 3}
If these are one to one relation then what will be the output of the following MySQL statement?
SELECT intern_id
FROM fatskills
WHERE subject IN (SELECT subject FROM fatskills WHERE subject_value IN (3, 2));
23. What will be the output of the following MySQL statement?
SELECT emp_id, fname, lname
FROM employee
WHERE LEFT (lname, 1) =’T’;
24. Consider a database name “Fatskills” whose attributes are intern_id (primary key), subject.
Intern_id = {1, 2, 3, 4, 5, 6}
Subject = {sql, oop, sql, oop, c, c++}
If these are one to one relation then what will be the output of the following MySQL statement?
SELECT intern_id
FROM fatskills
WHERE subject IN (c, c++, oop, SQL);
25. Which among the following data types can be used with “Range Condition”?