0
0
DBMS Theoryknowledge~10 mins

Closure of attributes 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 find the closure of attribute set A under functional dependencies F.

DBMS Theory
SELECT closure FROM attribute_closure WHERE attributes = '[1]';
Drag options to blanks, or click blank then click option'
AA+
BA
Cclosure
DF
Attempts:
3 left
💡 Hint
Common Mistakes
Using just 'A' instead of 'A+' for closure notation.
Confusing the closure with the set of functional dependencies.
2fill in blank
medium

Complete the code to check if attribute B is in the closure of attribute set A.

DBMS Theory
IF '[1]' IN closure_of_A THEN RETURN TRUE ELSE RETURN FALSE;
Drag options to blanks, or click blank then click option'
AC
BB
CA
DF
Attempts:
3 left
💡 Hint
Common Mistakes
Checking for attribute A instead of B.
Using the set of dependencies F instead of an attribute.
3fill in blank
hard

Fix the error in the code to compute the closure of attribute set X under F.

DBMS Theory
closure = [1](X, F)
Drag options to blanks, or click blank then click option'
Acompute_closure
Bclosure_compute
Cclosure
Dcompute
Attempts:
3 left
💡 Hint
Common Mistakes
Using incomplete or incorrect function names.
Using variable names instead of function names.
4fill in blank
hard

Fill both blanks to complete the code that computes closure of attributes in set S under dependencies D.

DBMS Theory
closure = [1]([2], D)
Drag options to blanks, or click blank then click option'
Acompute_closure
BS
CX
DF
Attempts:
3 left
💡 Hint
Common Mistakes
Swapping the function name and attribute set.
Using incorrect variable names.
5fill in blank
hard

Fill all three blanks to create a dictionary comprehension that maps each attribute in attrs to its closure under F.

DBMS Theory
closures = [1]: [2](attr, [3]) for attr in attrs
Drag options to blanks, or click blank then click option'
Aattr
Bcompute_closure
CF
Dclosure
Attempts:
3 left
💡 Hint
Common Mistakes
Using wrong keys or values in the dictionary comprehension.
Confusing the function name or dependency set.