Question 51
MediumWhich pair of relational algebra operations can express R ∩ S?
- A.
σ(R) ∪ π(S)
- B.
R × S
- C.
R − (R − S)
- D.
R ∪ (R − S)
Sign up free to see the answer and a step-by-step explanation.
Popular companies
Prepare company by company
Hiring pattern, syllabus, past questions and mocks for each company.
All companiesPractice by subject
DBMS
Which pair of relational algebra operations can express R ∩ S?
σ(R) ∪ π(S)
R × S
R − (R − S)
R ∪ (R − S)
Sign up free to see the answer and a step-by-step explanation.
Employee(emp_id, manager_id) has manager_id referring to emp_id in the same table. What is this?
A composite key
A self-referencing foreign key
A weak entity
A candidate key
Sign up free to see the answer and a step-by-step explanation.
In tuple relational calculus, what does { t | t ∈ Employee ∧ t.salary > 50000 } return?
All employee tuples with salary above 50000
Only the salary column
Employees with salary 50000
The count of employees
Sign up free to see the answer and a step-by-step explanation.
A table is created with PRIMARY KEY (order_id, line_no). Which pair of rows can both be inserted?
(NULL, 1) and (102, 1)
(101, NULL) and (101, 2)
(101, 1) and (101, 1)
(101, 1) and (101, 2)
Sign up free to see the answer and a step-by-step explanation.
Relation R has 3 attributes and 10 tuples; relation S has 4 attributes and 5 tuples. What are the degree and cardinality of R × S?
Degree 12, cardinality 50
Degree 7, cardinality 50
Degree 12, cardinality 15
Degree 7, cardinality 15
Sign up free to see the answer and a step-by-step explanation.
A relation R(A, B, C, D) has candidate keys {A} and {B, C}. How many super keys does it have?
16
11
8
10
Sign up free to see the answer and a step-by-step explanation.
Which relational algebra operation does the natural join (⋈) combine?
A union and a difference
A Cartesian product, then selection on equal common attributes, then projection to remove the duplicate columns
Two projections
A selection only
Sign up free to see the answer and a step-by-step explanation.
Which relational algebra operator is used for queries such as 'find students who have taken ALL the courses'?
Rename (ρ)
Projection (π)
Division (÷)
Union (∪)
Sign up free to see the answer and a step-by-step explanation.
Can a foreign key column contain NULL?
No, never
Yes, unless it is declared NOT NULL; NULL means the row refers to nothing yet
Only if it is also a primary key
Only in NoSQL databases
Sign up free to see the answer and a step-by-step explanation.
Which statement about primary keys and unique keys is true?
A table has one primary key but may have several unique keys, and unique columns may (in most DBMSs) contain NULLs
Unique keys can never contain NULLs
Primary keys can contain NULLs
A table can have several primary keys
Sign up free to see the answer and a step-by-step explanation.