CS FundamentalsHardGATE CS · TCS Digital
An ER diagram has entities Student, Course and Prof. Student and Course are related by Enrols (many-to-many, with attribute grade). Each Course is taught by exactly one Prof, and a Prof can teach many courses. What is the minimum number of tables in the relational schema?
- A. 3
- B. 4
- C. 5
- D. 6
Correct answer: B. 4
Student, Course (holding the Prof foreign key because the relationship is many-to-one with total participation) and Prof need one table each, and Enrols needs its own table: 4.
More DBMS and SQL questions
- T(g, x) holds (a, 1), (NULL, 2), (a, 3), (NULL, 4), (b, 5). How many rows does SELECT g, COUNT() FROM T GROUP BY g return?
- Ed(a, b) holds the edges (1, 2), (2, 3), (3, 1), (3, 4). How many rows does the following return? WITH RECURSIVE p(n, d) AS (SELECT 1, 0…
- The set F = {A -> BC, B -> C, A -> B, AB -> C} on R(A, B, C) is given. How many functional dependencies are there in a minimal (canonical)…
- Basic timestamp ordering is used with timestamps TS(T1) = 1, TS(T2) = 2, TS(T3) = 3. The schedule on one item A is R2(A), W3(A), R1(A)…
- Relation R has 1,000 tuples with 100 distinct values of attribute A, and S has 500 tuples with 50 distinct values of A, all of which…
- A B+ tree is built so that every node is completely full: a leaf holds 100 keys and an internal node has 101 children. It indexes…