Consider the Information Engineering diagram shown in the exhibit. Building_ID, R_ID,
Room_Count and Room_Num are integer numbers, whereas Bldg_Name, Location and
Res_Name are all represented by variable-length strings with a maximum of 20 characters.
Which SQL statement best implements the RESIDENT relation shown in this diagram?
A.
CREATE TABLE RESIDENT (
R_ID INTEGER NULL PRIMARY KEY,
Room_NumFLOAT,
Res_NameVARCHAR,
Building_IDINTEGER NULL,
FOREIGN KEY Building_ID REFERENCES BUILDING (Building_ID));
B.
CREATE TABLE RESIDENT (
R_ID INTEGER NOT NULL PRIMARY KEY,
Room_NumBINARY,
Res_NameVARCHAR (20),
Building_IDINTEGER NOT NULL,
FOREIGN KEY Building_ID REFERENCES BUILDING (Building_ID));
C.
CREATE TABLE RESIDENT (
R_ID INTEGER NOT NULL PRIMARY KEY,
Room_NumINTEGER,
Res_NameVARCHAR (20),
Building_IDINTEGER NOT NULL);
D.
CREATE TABLE RESIDENT (
R_ID INTEGER NOT NULL PRIMARY KEY,
Room_NumINTEGER,
Res_NameVARCHAR (20),
Building_IDINTEGER NOT NULL,
FOREIGN KEY Building_ID REFERENCES BUILDING (Building_ID));