Complete the code to perform a division operation in SQL.
SELECT 10 [1] 2 AS result;
The division operator in SQL is /. This divides the first number by the second.
Complete the code to find the quotient of two columns in a table.
SELECT salary [1] bonus AS total FROM employees;The division operator / divides the salary by bonus to find the quotient.
Fix the error in the division operation to avoid division by zero.
SELECT amount [1] CASE WHEN divisor = 0 THEN 1 ELSE divisor END AS result FROM transactions;
The division operator / is used here with a CASE statement to avoid dividing by zero.
Fill both blanks to calculate the average price per unit.
SELECT total_price [1] total_units AS avg_price FROM sales WHERE total_units [2] 0;
The division operator / calculates average price. The condition > 0 ensures no division by zero.
Fill all three blanks to select employees with salary per hour greater than 20.
SELECT name, salary [1] hours_worked AS salary_per_hour FROM employees WHERE salary [2] hours_worked [3] 20;
Use / (A for BLANK_1 and BLANK_2) to calculate salary per hour in both SELECT and WHERE clauses. Use > (B for BLANK_3) to filter employees where salary per hour is greater than 20.