1D0-541 Exam QuestionsBrowse all questions from this exam

1D0-541 Exam - Question 22


Consider the Information Engineering diagram shown in the exhibit. Building_ID, R_ID, Room_Count and Room_Num are integer numbers, whereas Bldg_Name and Res_Name are represented by variable-length strings with a maximum of 20 characters. Location can be up to 50 characters long, and no building has more than 600 rooms. Which SQL statement best implements the BUILDING relation shown in this diagram?

Show Answer
Correct Answer: D

The SQL statement should define the types and constraints for each attribute based on the specifications given. Building_ID should be an integer and the primary key, Bldg_Name should be a variable-length string with a maximum of 20 characters, Location should be a variable-length string with a maximum of 50 characters, and Room_Count should be an integer with a check constraint ensuring it is between 0 and 600. Option 'D' correctly implements these specifications.

Discussion

1 comment
Sign in to comment
jbmacOption: D
Apr 22, 2023

The correct answer is: D. CREATE TABLE BUILDING (Building_ID INTEGER NOT NULL PRIMARY KEY, Bldg_Name VARCHAR (20), Location VARCHAR (50), Room_Count INTEGER CHECK (Room_Count > Room_Count INTEGER CHECK ( -1 And Room_Count < 601)); Room_Count > -1 Or Room_Count < 601));