MySQL Basics Practice Test: MySQL Conditional Evaluation, Condition Types — Flashcards | Databases | FatSkills

MySQL Basics Practice Test: MySQL Conditional Evaluation, Condition Types — Flashcards

Fast review mode: answers are shown by default so you can skim quickly. Hide them if you want to self-test.

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 condition THEN: Code to execute if the condition is true
ELSE: Code to execute if the condition is false 

Here are some conditional operators in MySQL:
IF() Function:
Returns "YES" if the condition is true, and "NO" if the condition is false
COALESCE () Function: Returns the first non-null value in a list
ISNULL () Function: Returns 1 if the expression is NULL, and 0 otherwise

1 of 30 Ready
Which of the following operators is/are used in “Condition Evaluation”?
All of these
Shortcuts
Prev Space Show / hide Next
Turn this into a study set.
Sign in with Google to save tricky questions to your reminder list and resume on any device.
Sign in with Google Free • no extra password