0
0
DBMS Theoryknowledge~10 mins

Why indexing speeds up data retrieval 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 show how an index helps find data faster.

DBMS Theory
SELECT * FROM employees WHERE employee_id = [1];
Drag options to blanks, or click blank then click option'
A'12345'
B12345
Cemployee_id
Dname
Attempts:
3 left
💡 Hint
Common Mistakes
Adding quotes around numeric values, causing potential type mismatch.
Using column names instead of values.
2fill in blank
medium

Complete the code to create an index on the 'name' column.

DBMS Theory
CREATE INDEX idx_name ON employees([1]);
Drag options to blanks, or click blank then click option'
Aname
Bemployee_id
Csalary
Ddepartment
Attempts:
3 left
💡 Hint
Common Mistakes
Creating index on wrong column.
Using table name instead of column name.
3fill in blank
hard

Fix the error in the query that tries to use an index.

DBMS Theory
SELECT * FROM employees WHERE [1] = 'John';
Drag options to blanks, or click blank then click option'
Asalary
BName
Cemployee_id
Dname
Attempts:
3 left
💡 Hint
Common Mistakes
Using wrong case for column names.
Using a column without an index.
4fill in blank
hard

Fill both blanks to create a query that uses an index to find employees with salary greater than 50000.

DBMS Theory
SELECT * FROM employees WHERE [1] [2] 50000;
Drag options to blanks, or click blank then click option'
Asalary
B>
C<
Demployee_id
Attempts:
3 left
💡 Hint
Common Mistakes
Using wrong column for filtering.
Using wrong comparison operator.
5fill in blank
hard

Fill all three blanks to create a dictionary comprehension that maps employee names to their salaries, but only for salaries above 60000.

DBMS Theory
{ [3]['[1]']: [3]['[2]'] for [3] in employees if [3]['[2]'] > 60000 }
Drag options to blanks, or click blank then click option'
Aname
Bsalary
Cemployee
Demployee_id
Attempts:
3 left
💡 Hint
Common Mistakes
Mixing up keys and values.
Using wrong variable names.
Not filtering correctly.