INFO210_HW1_Solution

Copy and paste the statements and their output into

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: SQL> @CreateDB You will see 4 errors when you execute this script for the first time. This is expected: the script is attempting to drop some tables that do not yet exist in your schema. You can re- run the script any time for a fresh re- installation. The errors will no longer appear from the second time around. Try this to be sure: SQL> @CreateDB For the rest of this problem, take another look at CreateDB.sql and use the commands in this file as an example. (a) Write and execute SQL statements that add another INFO course, and enroll 2 students in this course. Copy and paste the statements and their output into your submission file. Solution: SQL> insert into Courses(cid, did, name, credits) values (220, 200, 'Database Systems); 1 row created. SQL> insert into Enrollment(did, cid, sid, term) values (200, 220, 2, 'Winter 2013'); 1 row created. SQL> insert into Enrollment(did, cid, sid, term, grade) values (200, 220, 1, 'Fall 2012', 3); 1 row created. (b) Write and execute SQL statements that list the contents of the database tables that were modified as a result of...
View Full Document

This note was uploaded on 01/21/2014 for the course INFO 210 taught by Professor Stoy during the Winter '13 term at Drexel.

Ask a homework question - tutors are online