Exam 2 Questions - Database System | CS 487, Exams of Deductive Database Systems

Material Type: Exam; Class: DATABASE SYSTEMS; Subject: Computer Science; University: University of Alabama - Huntsville; Term: Fall 2004;

Typology: Exams

Pre 2010

Uploaded on 07/23/2009

koofers-user-p9r-1
koofers-user-p9r-1 🇺🇸

5

(1)

10 documents

1 / 2

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Name:
CS 487 Test 2
October 21, 2004
Student
SID: int major: int email : text name : text
Exam
EID: int QID : int
Question
SID: int QID : int Answer : text Grade : int
Grade
SID: int Eid : int Grade : int
{s.name q.grade |Student(s)Question(q)E xam(e)e.id = 2 e.q id =q.qid q .sid =s.sid
((r)(not(Question(r)) q.qid 6=r.qid q.grade r.grade ((t)not(S tudent(t)) t.major 6=s.maj or))) }
What does the above query do?
Write the same query in SQL.
Assume that there are four questions on test 2. Could the division operator be used to identify students who
correctly answered questions 1, 2, and 4 on test 2? If so, demonstrate, else describe why not?
pf2

Partial preview of the text

Download Exam 2 Questions - Database System | CS 487 and more Exams Deductive Database Systems in PDF only on Docsity!

Name:

CS 487 Test 2 October 21, 2004

Student SID: int major: int email : text name : text

Exam EID: int QID : int Question SID: int QID : int Answer : text Grade : int

Grade SID: int Eid : int Grade : int

{ s.name q.grade |Student(s) ∧ Question(q) ∧ Exam(e) ∧ e.id = 2 ∧ e.qid = q.qid ∧ q.sid = s.sid ∧ ((∀r)(not(Question(r)) ∨ q.qid 6 = r.qid ∨ q.grade ≥ r.grade ∨ ((∀t)not(Student(t)) ∨ t.major 6 = s.major))) }

What does the above query do?

Write the same query in SQL.

Assume that there are four questions on test 2. Could the division operator be used to identify students who correctly answered questions 1, 2, and 4 on test 2? If so, demonstrate, else describe why not?

Name:

CS 487 Test 2 October 21, 2004

What can you infer about the structure of the ER model based upon the tables? Describe the rules that are applicable. Sketch the ER diagram.

From your derived ER model add a superclass to student, voter, and another entity worker that is a subclass of voter. Describe what changes would need to be made to the tables.

Explain which is more important referential integrity constraints or entity integrity constraints.