CS FundamentalsModerateProduct placement · DBMS interview
Which tuple relational calculus expression is UNSAFE (may produce an infinite result)?
- A. { t | Emp(t) ∧ ¬ ∃ m (Emp(m) ∧ m.boss = t.id) }
- B. { t | ¬ Emp(t) }
- C. { t | Emp(t) ∧ t.salary > 50000 }
- D. { t.name | Emp(t) ∧ ∃ d (Dept(d) ∧ d.id = t.dept) }
Correct answer: B. { t | ¬ Emp(t) }
{ t | ¬ Emp(t) } asks for every possible tuple not in Emp, which is infinite. The others draw t from Emp, so their results are finite.
More DBMS and SQL questions
- On R(A, B, C, D, E), F = {BE → CD, D → B, AC → D} and G = {B → C, AC → B, E → A}. Which statement is correct? ("F covers G" means every FD…
- R(A, B, C, D) has FDs A → B, B → C, C → D and D → A. Every attribute is a candidate key. A designer still decomposes R into R1(A, B) and…
- Optimistic (validation-based) concurrency control runs each transaction in three phases. In which order, and when are its writes applied…
- R(A, B, C, D, E) has functional dependencies DE → B, AC → E, AD → E, BD → CE, C → A. How many prime attributes does R have?
- A file has 50,000 records of 200 bytes stored unspanned in 2048-byte blocks, NOT ordered on attribute X. A dense secondary index on X (a…
- A table Teach(course, teacher, book) records that each course is taught by several teachers and uses several books, independently of each…