Question: Consider the following database instance. Table name: Student Primary key: SID SID SNAME 1 Joe 2 Susan 3 Ed Table name: Course Primary key: CID
Consider the following database instance.
Table name: Student
Primary key: SID
| SID | SNAME |
| 1 | Joe |
| 2 | Susan |
| 3 | Ed |
Table name: Course
Primary key: CID
| CID | CNAME |
| 1 | Accounting |
| 2 | CIS |
Table name: Register
Primary key: SID,CID
Foreign key: SID references Student(SID)
on delete cascade
Foreign key: CID references Course(CID)
on update cascade
| SID | CID |
| 1 | 2 |
| 2 | 1 |
Questions on next page:
For each of the following questions, show the contents of the database (i,e, re-draw the tables showing the data) after performing the given SQL statements. Assume each SQL statement is performed on the original database instance without considering the effect of the previous statements.
5.1) (3 Points)
delete from Student where sid = 2;
commit;
5.2)(3 Points)
update Course set cid = 3 where cid = 1;
commit;
5.3) (3 Points)
update Register set sid = 1 where sid = 4;
commit;
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
