Question: Case 2 Assume you have set up a relational database using only the 2 tables shown below. Student Hall Hall ID Name Age Address Hall_ID

Case 2

Assume you have set up a relational database using only the 2 tables shown below.

Student Hall

Hall ID Name Age Address Hall_ID Hall_ID Hall Name Tutor

001 CHEN Biming 17 Chongqing 01 01 Zhuo Ya Dr. Hanks

002 LIU Nuan 18 Tianjin 02 02 Huan Ya Dr. Chen

003 ZHANG Xiu 21 Wuhan 03 03 Wen Ya Dr. Wang

004 SONG Jian 19 Chengdu 01

a) What are the two entities for the relational database? (4 Marks)

b) What is the primary key and foreign key in the table STUDENT? (4 Marks)

c) Please draw the entity-relationship diagram to illustrate the relationship(s) among the entities in the above database. (4 Marks)

d) What are the query results that would be displayed if you wrote this SQL statement: (4 Marks)

e) Please write down the SQL statement: o To find the student who lived in Hall 1 and display their information, including their ID, Name, Age, and address. (2 marks) o To insert a new student record where ID is 006, Name is Chen Qing, Age is 18, and Address is Changsha and assign her to Hall 3. (2 marks).

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related General Management Questions!