Department (DeptId, DeptName, DeptAddress, Chair); PK: DeptId; FK: Chair refs Fa
ID: 3755806 • Letter: D
Question
Department (DeptId, DeptName, DeptAddress, Chair); PK: DeptId; FK: Chair refs Faculty.
Faculty (FacName, FacSSNo, OfficeAddress, Worksfor); PK: FacSSNo; FK: Worksfor refs Department.
DegreeProgram (ProgId, ProgramName, ProgType, Coordinator, UnivReq, CollReq); PK: ProgId; FK: Coordinator refs Faculty.
Student (Sid, SSNo, Sname, CurAddress, Major, StuLevel, Gpa); PK: Sid; FK: Major refs DegreeProgram; UNIQUE: SSNo.
DDoffers (DeptId, ProgId, DeptReqrmnt), PK: (DeptId, ProgId); FK: DeptId refs Department, ProgId refs DegreeProgram.
Keywords in Query Condition to Recognize Multi-unit Queries
Once we find the query condition in the query requirement (assuming there is one), we will check for the existence of one or more keywords in the query condition. For now, we only consider the following keywords: AND, OR and NOT. If any of the keywords is found in the query condition, then the query is multi-unit. Otherwise, it is single unit.
Query: Return records of all faculty members who work for the department with ID 'CS'.
a) Is the query multi-unit? Why or why not?
Answer:
Query: Return program IDs of those degree programs offered by both 'CS' and 'EE' departments. Note that 'CS' and 'EE' are department IDs.
b) Is the query multi-unit? Why or why not?
Answer:
Query: Return names and GPAs of all students.
c) Is the query multi-unit? Why or why not?
Answer:
Query: For students majoring in program ID 'P000' or 'P001', return their names.
d) Is the query multi-unit? Why or why not?
Answer:
Explanation / Answer
Note: When a query requirement does not have a query condition, it is a single-unit query.
Query: Return records of all faculty members who work for the department with ID 'CS'.
a) Is the query multi-unit? Why or why not?
Answer: In the question there is a condition that deptId should 'CS'. As there is a condition it is a multi-unit.
Query: Return program IDs of those degree programs offered by both 'CS' and 'EE' departments. Note that 'CS' and 'EE' are department IDs.
b) Is the query multi-unit? Why or why not?
Answer:In the question there is a condition that deptId should 'CS' and 'EE'. As there is a condition it is a multi-unit.
Query: Return names and GPAs of all students.
c) Is the query multi-unit? Why or why not?
Answer: The query is asked to return name and GPA of all students and it has no filters for that. So this is single-unit query as there are no conditions.
Query: For students majoring in program ID 'P000' or 'P001', return their names.
d) Is the query multi-unit? Why or why not?
Answer: Here in the query there is condition that progId = 'P000' or ProgId = 'P001'. As there is condition this is a multi-unit query.
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.