0
0
DBMS Theoryknowledge~10 mins

Why SQL is the standard database language in DBMS Theory - Test Your Understanding

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

Complete the code to select all records from a table named 'employees'.

DBMS Theory
SELECT * FROM [1];
Drag options to blanks, or click blank then click option'
Aemployees
Bproducts
Corders
Dcustomers
Attempts:
3 left
💡 Hint
Common Mistakes
Using a wrong table name.
Forgetting the FROM keyword.
2fill in blank
medium

Complete the code to filter records where the age is greater than 30.

DBMS Theory
SELECT * FROM employees WHERE age [1] 30;
Drag options to blanks, or click blank then click option'
A<=
B<
C=
D>
Attempts:
3 left
💡 Hint
Common Mistakes
Using '<' instead of '>'.
Using '=' which selects only age exactly 30.
3fill in blank
hard

Fix the error in the SQL query to count the number of employees.

DBMS Theory
SELECT COUNT([1]) FROM employees;
Drag options to blanks, or click blank then click option'
A*
Bname
Cage
Dsalary
Attempts:
3 left
💡 Hint
Common Mistakes
Using COUNT(name) which ignores rows with null names.
Using COUNT(age) which ignores rows with null ages.
4fill in blank
hard

Fill both blanks to create a query that selects employee names and orders them alphabetically.

DBMS Theory
SELECT [1] FROM employees ORDER BY [2];
Drag options to blanks, or click blank then click option'
Aname
Bage
Dsalary
Attempts:
3 left
💡 Hint
Common Mistakes
Selecting one column but ordering by a different one.
Ordering by a numeric column instead of name.
5fill in blank
hard

Fill all three blanks to create a dictionary comprehension that maps employee names to their salaries if salary is above 50000.

DBMS Theory
{ [1]: [2] for [3] in employees if [3]['salary'] > 50000 }
Drag options to blanks, or click blank then click option'
Aemployee['name']
Bemployee['salary']
Cemployee
Dsalary
Attempts:
3 left
💡 Hint
Common Mistakes
Using salary as the loop variable instead of employee.
Mixing keys and values incorrectly.