ER Diagram Examples – Questions

 ER Diagram Examples Some ER Diagram Examples : Question 1 : (a) Construct an E-R diagram for the registrar’s office. Document all assumptions you make about the mapping constraints. Assumptions: A class meets only at one particular place and time. This diagram does not attempt to model a class meeting at different places or at…

Functional Dependency Set Closure (F+)

Functional Dependency Set Closure (F+) Functional Dependency Set Closure of F is the set of all functional dependencies that are determined by it. Example of Functional Dependency Set Closure : Consider a relation R(ABC) having following functional dependencies : F = { A → B, B → C } To find the Functional Dependency Set closure of…

Relational Calculus

 Relational Calculus Relational calculus is non procedural, it is a language for expressing what we want without expressing. Relational calculus has a variable. For tuple relational calculus, the variable ranges over the tuples of a relation. For domain relational calculus, the variables ranges over the values of the domain. Tuple Oriented Relational Calculus The basic…

Questions on Timestamp Ordering

 Questions on Timestamp Ordering Question 1 : Which of the following TS order allow to execute the above schedule using BTSO (Basic Timestamp Ordering) Protocol ? R1(A); R2(B); W1(C); R3(B); R3(C); W2(B); W3(A) a) (T1,T2,T3) = (10,20,30) b) (T1,T2,T3) = (30,10,20) c) (T1,T2,T3) = (30,20,10) d) (T1,T2,T3) = (20,30,10) e) (T1,T2,T3) = (10,30,20) Solution :…

Questions on View Serializable

 Questions on View Serializable Question 1 : Check whether the schedules is View serializable or not ? R2(A); R1(A); W1(C); R3(C); W1(B); R4(B); W3(A); R4(C); W2(D); R2(B); W4(A); W4(B) Solution : Check for View Equivalent Schedule : Step 1 : Final Updation on data items : A : T3 T4 B : T1 T4 C…

Questions on Conflict Serializable

 Questions on Conflict Serializable Question 1 : Check whether the schedules is conflict serializable or not ? S : R2(A); W2(A); R3(C); W2(B); W3(A); W3(C); R1(A); R1(B); W1(A); W1(B) Solution : Conflict Pairs Dependency Relation W2(A) W3(A) T2 → T3 W3(A) R1(A) T3 → T1 W2(B) R1(B) T2 → T1  ⇒ No cycle formed. Therefore, conflict…

Questions Based on Relational Algebra (Gate Questions Included)

Questions Based on Relational Algebra (Gate Questions Included) -Part 2 Question 21: Consider the relation Student(name,sex, marks) where the primary key is shown underlined, pertaining to students in a class that has at least one boy and one girl. What does the following relational algebra expression produce? a) names of girl students with the highest…

Questions on Relational Algebra (Part 1)

 Questions on Relational Algebra (Part 1) Consider the relations: Suppliers(SID, Sname, Rating) Parts(PID, Pname, Color) Catalog( SID, PID, Cost) Query 1: Retrieve SIDs of Suppliers whose rating > 10. Solution: Query 2: Retrieve SIDs of Suppliers who supplied red parts. Solution: Query 3: Retrieve Sname of Suppliers who supplied red parts. Solution: From optimization point of…

Questions Based on SQL – Part 6

Questions Based on SQL – Part 6 Question 1 : Consider the following relations: Student(snum: integer, sname: string, major: string, level: string, age: integer) Class(name: string, meets at: string, room: string, fid: integer) Enrolled(snum: integer, cname: string) Faculty(fid: integer, fname: string, deptid: integer) The meaning of these relations is straightforward; for example, Enrolled has one…

Questions related to SQL – Part 5

Questions related to SQL – Part 5 Question 1 : Consider the instance of the Sailors relation Sid Sname rating Age 18 Jones 3 30.0 41 Jonah 6 56.0 22 Ahab 7 44.0 63 Moby Null 15.0 Table 5.1 1. Write SQL queries to compute the average rating, using AVG; the sum of the ratings, using…