INF60009 Test 2 - Practice Questions Database Analysis & Design INF60009 Test 2 - Sample Questions The test questions will be a combination of · Fill in the blank · Multiple Choice · Combine the code segments (see Q21) The questions cover all weeks 1-7 but primarily concentrating on weeks 5 to 7 (but no SQL aggregate functions / group by / having). These questions are typical of those that may be found in the test. 1. Consider the following ER Diagram :. AId AName BId BName A HAS B a) What is the identifier of the Entity named A? Answer: AId b) What is the identifier of the Entity named B? Answer: Bld c) What is the FK (if any) in any of the following Entities? Entity A: no fk Entity B: AId d) Write the relational schema based on this ERD. Indicate all PKs and FKs A(AId, AName) Primary Key (AId) B(BId,BName, AId) Primary Key (BId) Foreign Key (AId) Reference A
INF60009 Test 2 - Practice Questions 2. Consider the following ER Diagram :. EId FId EName FName E DO-HAS F a) What is the identifier of the Entity named E? Answer: FId+EId b) What is the identifier of the Entity named F? Answer: FId c) What is the FK (if any) of the following Entities? E(EId, EName, FId) Primary Key (EId) Foreign Key (FId) Reference F F(FId,FName) Primary Key (FId) Entity E: FId Entity F: no fk d) Write the relational schema based on this ERD. Indicate all PKs and FKs 3. Consider the following ER Diagram :. Xid XName Yid YName Zid ZName X DO-HAS Y DO HAS- Z a) What is the identifier of the Entity named X? Answer: Xid b) What is the identifier of the Entity named Y? Answer: Yid c) What is the identifier of the Entity named Z? Answer: Zid. d) What is the FK (if any) of the following Entities? Entity X: Yid+Zid Entity Y: Zid Entity Z: no fk
INF60009 Test 2 - Practice Questions 4. Consider the following ER Diagram :. Xid XName Yid YName Zid ZName X HAS- Y HAS- Z a) What is the identifier of the Entity named X? Answer: Xid b) What is the identifier of the Entity named Y? Answer: Xid+Zid+Yid c) What is the identifier of the Entity named Z? Answer: Zid d) What is the FK (if any) of the following Entities? Entity X: no fk Entity Y: Xid, Zid Entity Z: no fk e) Write the relational schema based on this ERD. Indicate all PKs and FKs X(XId, XName) Primary Key (XId) Y(YId,YName,Xid, Zid) Primary Key (YId) Foreign Key (XId) reference X Foreign Key (ZId) reference Z