0
0
DBMS Theoryknowledge~10 mins

Division operation in DBMS Theory - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to perform a division operation in SQL.

DBMS Theory
SELECT 10 [1] 2 AS result;
Drag options to blanks, or click blank then click option'
A+
B-
C/
D*
Attempts:
3 left
💡 Hint
Common Mistakes
Using * instead of / causes multiplication instead of division.
Using - or + will perform subtraction or addition, not division.
2fill in blank
medium

Complete the code to find the quotient of two columns in a table.

DBMS Theory
SELECT salary [1] bonus AS total FROM employees;
Drag options to blanks, or click blank then click option'
A-
B+
C*
D/
Attempts:
3 left
💡 Hint
Common Mistakes
Using + or - will add or subtract instead of dividing.
Using * will multiply, not divide.
3fill in blank
hard

Fix the error in the division operation to avoid division by zero.

DBMS Theory
SELECT amount [1] CASE WHEN divisor = 0 THEN 1 ELSE divisor END AS result FROM transactions;
Drag options to blanks, or click blank then click option'
A*
B/
C+
D-
Attempts:
3 left
💡 Hint
Common Mistakes
Using * or + will not perform division.
Not handling division by zero causes runtime errors.
4fill in blank
hard

Fill both blanks to calculate the average price per unit.

DBMS Theory
SELECT total_price [1] total_units AS avg_price FROM sales WHERE total_units [2] 0;
Drag options to blanks, or click blank then click option'
A/
B>
C<
D*
Attempts:
3 left
💡 Hint
Common Mistakes
Using multiplication instead of division for average.
Using < instead of > causes wrong filtering.
5fill in blank
hard

Fill all three blanks to select employees with salary per hour greater than 20.

DBMS Theory
SELECT name, salary [1] hours_worked AS salary_per_hour FROM employees WHERE salary [2] hours_worked [3] 20;
Drag options to blanks, or click blank then click option'
A/
B>
D<
Attempts:
3 left
💡 Hint
Common Mistakes
Using multiplication instead of division.
Mixing up comparison operators.