D
D
D
CHAR( 2),Zip CHAR(5),StartTerm CHAR(4),BirthDate DATE,FacultyId NUMBER(3),MajorId NUMB ER(3),Phone CHAR(10)); CREATE TABLE STUDENT(StudentId CHAR(5) PRIMARY KEY,Last VARCHAR2(15) NOT NULL,Fi rst VARCHAR2(15) NOT NULL,Street VARCHAR2(25),City VARCHAR2(15),State CHAR(2),Zi p CHAR(5),StartTerm CHAR(4),BirthDate DATE,FacultyId NUMBER(3),MajorId NUMBER(3) ,Phone CHAR(10)) * ERROR at line 1: ORA-00955: name is already used by an existing object SQL> CREATE TABLE STUDENT(StudentId CHAR(5) PRIMARY KEY,Last VARCHAR2(15) NOT NU LL,First VARCHAR2(15) NOT NULL,Street VARCHAR2(25),City VARCHAR2(15),State CHAR( 2),Zip CHAR(5),StartTerm CHAR(4),BirthDate DATE,FacultyId NUMBER(3),MajorId NUMB ER(3),Phone CHAR(10)); CREATE TABLE STUDENT(StudentId CHAR(5) PRIMARY KEY,Last VARCHAR2(15) NOT NULL,Fi rst VARCHAR2(15) NOT NULL,Street VARCHAR2(25),City VARCHAR2(15),State CHAR(2),Zi p CHAR(5),StartTerm CHAR(4),BirthDate DATE,FacultyId NUMBER(3),MajorId NUMBER(3) ,Phone CHAR(10)) * ERROR at line 1: ORA-00955: name is already used by an existing object SQL> DROP TABLE STUDENT; Table dropped. SQL> CREATE TABLE STUDENT(StudentId CHAR(5) PRIMARY KEY,Last VARCHAR2(15) NOT NU LL,First VARCHAR2(15) NOT NULL,Street VARCHAR2(25),City VARCHAR2(15),State CHAR( 2),Zip CHAR(5),StartTerm CHAR(4),BirthDate DATE,FacultyId NUMBER(3),MajorId NUMB ER(3),Phone CHAR(10)); Table created. SQL> INSERT INTO STUDENT VALUES('&StudentId','&Last','&First','&Street','&City', '&State','&Zip','&StartTerm','&BirthDate',&FacultuId,&MajorId,'&Phone'); Enter value for studentid: 00100 Enter value for last: Diaz Enter value for first: Jose Enter value for street: 1 Ford Avenue #7 Enter value for city: Hill Enter value for state: NU Enter value for zip: 08863 Enter value for startterm: WN03 Enter value for birthdate: 12-feb-1983 Enter value for facultuid: INSERT INTO STUDENT VALUES('&StudentId','&Last','&Fir st','&Street','&City','&State','&Zip','&StartTerm','&BirthDate',&FacultyId,&Majo rId,'&Phone'); Enter value for majorid: h Enter value for phone: j old 1: INSERT INTO STUDENT VALUES('&StudentId','&Last','&First','&Street','&Ci ty','&State','&Zip','&StartTerm','&BirthDate',&FacultuId,&MajorId,'&Phone') new 1: INSERT INTO STUDENT VALUES('00100','Diaz','Jose','1 Ford Avenue #7','Hi ll','NU','08863','WN03','12-feb-1983',INSERT INTO STUDENT VALUES('&StudentId','& Last','&First','&Street','&City','&State','&Zip','&StartTerm','&BirthDate',&Facu ltyId,&MajorId,'&Phone');,h,'j') SP2-0552: Bind variable "MAJORID" not declared.
SQL> INSERT INTO STUDENT VALUES('&StudentId','&Last','&First','&Street','&City', '&State','&Zip','&StartTerm','&BirthDate',&FacultyId,&MajorId,'&Phone'); Enter value for studentid: 00100 Enter value for last: Diaz Enter value for first: Jose Enter value for street: 1 Ford Avenue #7 Enter value for city: Hill Enter value for state: NJ Enter value for zip: 08863 Enter value for startterm: WN03 Enter value for birthdate: 12-feb-1983 Enter value for facultyid: 123 Enter value for majorid: 100 Enter value for phone: 9735551111 old 1: INSERT INTO STUDENT VALUES('&StudentId','&Last','&First','&Street','&Ci ty','&State','&Zip','&StartTerm','&BirthDate',&FacultyId,&MajorId,'&Phone') new 1: INSERT INTO STUDENT VALUES('00100','Diaz','Jose','1 Ford Avenue #7','Hi ll','NJ','08863','WN03','12-feb-1983',123,100,'9735551111') 1 row created. SQL> / Enter value for studentid: 00101 Enter value for last: Tyler Enter value for first: Mickey Enter value for street: 12 Morris Avenue Enter value for city: Bronx Enter value for state: NY Enter value for zip: 10468 Enter value for startterm: SP03 Enter value for birthdate: 18-mar-1984 Enter value for facultyid: 555 Enter value for majorid: 500 Enter value for phone: 7185552222 old 1: INSERT INTO STUDENT VALUES('&StudentId','&Last','&First','&Street','&Ci ty','&State','&Zip','&StartTerm','&BirthDate',&FacultyId,&MajorId,'&Phone') new 1: INSERT INTO STUDENT VALUES('00101','Tyler','Mickey','12 Morris Avenue', 'Bronx','NY','10468','SP03','18-mar-1984',555,500,'7185552222') 1 row created. SQL> / Enter value for studentid: 00102 Enter value for last: Patel Enter value for first: Rajesh Enter value for street: 25 River Road #3 Enter value for city: Edison Enter value for state: NJ Enter value for zip: 08837 Enter value for startterm: WN03 Enter value for birthdate: 12-dec-1985 Enter value for facultyid: 111 Enter value for majorid: 400 Enter value for phone: 7325553333 old 1: INSERT INTO STUDENT VALUES('&StudentId','&Last','&First','&Street','&Ci ty','&State','&Zip','&StartTerm','&BirthDate',&FacultyId,&MajorId,'&Phone') new 1: INSERT INTO STUDENT VALUES('00102','Patel','Rajesh','25 River Road #3', 'Edison','NJ','08837','WN03','12-dec-1985',111,400,'7325553333') 1 row created.
SQL> / Enter value for studentid: 00103 Enter value for last: Rickles Enter value for first: Deborah Enter value for street: 100 Main Street Enter value for city: Iselin Enter value for state: NJ Enter value for zip: 08838 Enter value for startterm: FL02 Enter value for birthdate: 20-oct-1970 Enter value for facultyid: 555 Enter value for majorid: 500 Enter value for phone: 7325554444 old 1: INSERT INTO STUDENT VALUES('&StudentId','&Last','&First','&Street','&Ci ty','&State','&Zip','&StartTerm','&BirthDate',&FacultyId,&MajorId,'&Phone') new 1: INSERT INTO STUDENT VALUES('00103','Rickles','Deborah','100 Main Street ','Iselin','NJ','08838','FL02','20-oct-1970',555,500,'7325554444') 1 row created. SQL> / Enter value for studentid: 00104 Enter value for last: Lee Enter value for first: Brian Enter value for street: 2845 First Lane Enter value for city: Hope Enter value for state: NY Enter value for zip: 11373 Enter value for startterm: WN03 Enter value for birthdate: 28-nov-1985 Enter value for facultyid: 345 Enter value for majorid: 600 Enter value for phone: 2125555555 old 1: INSERT INTO STUDENT VALUES('&StudentId','&Last','&First','&Street','&Ci ty','&State','&Zip','&StartTerm','&BirthDate',&FacultyId,&MajorId,'&Phone') new 1: INSERT INTO STUDENT VALUES('00104','Lee','Brian','2845 First Lane','Hop e','NY','11373','WN03','28-nov-1985',345,600,'2125555555') 1 row created. SQL> / Enter value for studentid: 00105 Enter value for last: Khan Enter value for first: Amir Enter value for street: 213 Broadway Enter value for city: Clifton Enter value for state: NJ Enter value for zip: 07222 Enter value for startterm: WN03 Enter value for birthdate: 07-jul-1984 Enter value for facultyid: 222 Enter value for majorid: 200 Enter value for phone: 2017585555 old 1: INSERT INTO STUDENT VALUES('&StudentId','&Last','&First','&Street','&Ci ty','&State','&Zip','&StartTerm','&BirthDate',&FacultyId,&MajorId,'&Phone') new 1: INSERT INTO STUDENT VALUES('00105','Khan','Amir','213 Broadway','Clifto n','NJ','07222','WN03','07-jul-1984',222,200,'2017585555') 1 row created.
SQL> CREATE TABLE FACULTY(FacultyId NUMBER(3) PRIMARY KEY,Name VARCHAR2(15) NOT NULL,RoomId NUMBER(2),Phone CHAR(3) UNIQUE,DeptId NUMBER(1)); Table created. SQL> INSERT INTO FACULTY VALUES(&FacultyId,'&Name',&RoomId,'&Phone',&DeptId); Enter value for facultyid: 111 Enter value for name: Jones Enter value for roomid: 11 Enter value for phone: 525 Enter value for deptid: 1 old 1: INSERT INTO FACULTY VALUES(&FacultyId,'&Name',&RoomId,'&Phone',&DeptId) new 1: INSERT INTO FACULTY VALUES(111,'Jones',11,'525',1) 1 row created. SQL> / Enter value for Enter value for Enter value for Enter value for Enter value for old 1: INSERT new 1: INSERT 1 row created. SQL> / Enter value for Enter value for Enter value for Enter value for Enter value for old 1: INSERT new 1: INSERT 1 row created. SQL> / Enter value for Enter value for Enter value for Enter value for Enter value for old 1: INSERT new 1: INSERT 1 row created. SQL> / Enter value for Enter value for Enter value for Enter value for Enter value for old 1: INSERT new 1: INSERT 1 row created. facultyid: 345 name: Sen roomid: 12 phone: 579 deptid: 3 INTO FACULTY VALUES(&FacultyId,'&Name',&RoomId,'&Phone',&DeptId) INTO FACULTY VALUES(345,'Sen',12,'579',3) facultyid: 235 name: Vajpayee roomid: 12 phone: 577 deptid: 2 INTO FACULTY VALUES(&FacultyId,'&Name',&RoomId,'&Phone',&DeptId) INTO FACULTY VALUES(235,'Vajpayee',12,'577',2) facultyid: 123 name: Mobley roomid: 11 phone: 529 deptid: 1 INTO FACULTY VALUES(&FacultyId,'&Name',&RoomId,'&Phone',&DeptId) INTO FACULTY VALUES(123,'Mobley',11,'529',1) facultyid: 222 name: Williams roomid: 20 phone: 533 deptid: 2 INTO FACULTY VALUES(&FacultyId,'&Name',&RoomId,'&Phone',&DeptId) INTO FACULTY VALUES(222,'Williams',20,'533',2)
SQL> / Enter value for Enter value for Enter value for Enter value for Enter value for old 1: INSERT new 1: INSERT 1 row created. SQL> / Enter value for Enter value for Enter value for Enter value for Enter value for old 1: INSERT new 1: INSERT 1 row created. SQL> / Enter value for Enter value for Enter value for Enter value for Enter value for old 1: INSERT new 1: INSERT 1 row created.
facultyid: 444 name: Rivera roomid: 21 phone: 544 deptid: 4 INTO FACULTY VALUES(&FacultyId,'&Name',&RoomId,'&Phone',&DeptId) INTO FACULTY VALUES(444,'Rivera',21,'544',4)
facultyid: 555 name: Chang roomid: 17 phone: 587 deptid: 5 INTO FACULTY VALUES(&FacultyId,'&Name',&RoomId,'&Phone',&DeptId) INTO FACULTY VALUES(555,'Chang',17,'587',5)
facultyid: 333 name: Collins roomid: 17 phone: 599 deptid: 3 INTO FACULTY VALUES(&FacultyId,'&Name',&RoomId,'&Phone',&DeptId) INTO FACULTY VALUES(333,'Collins',17,'599',3)
SQL> CREATE TABLE CRSSECTION(CsId NUMBER(4) PRIMARY KEY,CourseId VARCHAR2(6) NOT NULL,Section CHAR(2) NOT NULL,TermId CHAR(4) NOT NULL,FacultyId NUMBER(3),Day V ARCHAR2(2),StartTime VARCHAR2(5),EndTime VARCHAR2(5),RoomId NUMBER(2),MaxCount N UMBER(2)); Table created. SQL> INSERT INTO CRSSECTION VALUES(&CsId,'&CourseId','&Section','&TermId',&Facul tyId,'&Day','&StartTime','&EndTime',&RoomId,&MaxCount); Enter value for csid: 1101 Enter value for courseid: CIS265 Enter value for section: 01 Enter value for termid: WN03 Enter value for facultyid: 111 Enter value for day: MW Enter value for starttime: 09:00 Enter value for endtime: 10:30 Enter value for roomid: 13 Enter value for maxcount: 30 old 1: INSERT INTO CRSSECTION VALUES(&CsId,'&CourseId','&Section','&TermId',&F acultyId,'&Day','&StartTime','&EndTime',&RoomId,&MaxCount) new 1: INSERT INTO CRSSECTION VALUES(1101,'CIS265','01','WN03',111,'MW','09:00 ','10:30',13,30) 1 row created.
SQL> / Enter value for csid: 1102 Enter value for courseid: CIS253 Enter value for section: 01 Enter value for termid: WN03 Enter value for facultyid: 123 Enter value for day: TR Enter value for starttime: 09:00 Enter value for endtime: 10:30 Enter value for roomid: 18 Enter value for maxcount: 40 old 1: INSERT INTO CRSSECTION VALUES(&CsId,'&CourseId','&Section','&TermId',&F acultyId,'&Day','&StartTime','&EndTime',&RoomId,&MaxCount) new 1: INSERT INTO CRSSECTION VALUES(1102,'CIS253','01','WN03',123,'TR','09:00 ','10:30',18,40) 1 row created. SQL> / Enter value for csid: 1103 Enter value for courseid: MA150 Enter value for section: 02 Enter value for termid: WN03 Enter value for facultyid: 444 Enter value for day: F Enter value for starttime: 09:00 Enter value for endtime: 12:00 Enter value for roomid: 15 Enter value for maxcount: 25 old 1: INSERT INTO CRSSECTION VALUES(&CsId,'&CourseId','&Section','&TermId',&F acultyId,'&Day','&StartTime','&EndTime',&RoomId,&MaxCount) new 1: INSERT INTO CRSSECTION VALUES(1103,'MA150','02','WN03',444,'F','09:00', '12:00',15,25) 1 row created. SQL> / Enter value for csid: 1104 Enter value for courseid: AC101 Enter value for section: 10 Enter value for termid: WN03 Enter value for facultyid: 345 Enter value for day: MW Enter value for starttime: 10:30 Enter value for endtime: 12:00 Enter value for roomid: 16 Enter value for maxcount: 35 old 1: INSERT INTO CRSSECTION VALUES(&CsId,'&CourseId','&Section','&TermId',&F acultyId,'&Day','&StartTime','&EndTime',&RoomId,&MaxCount) new 1: INSERT INTO CRSSECTION VALUES(1104,'AC101','10','WN03',345,'MW','10:30' ,'12:00',16,35) 1 row created. SQL> / Enter value Enter value Enter value Enter value Enter value for for for for for csid: 1205 courseid: CIS265 section: 01 termid: SP03 facultyid: NULL
Enter value for day: MW Enter value for starttime: 09:00 Enter value for endtime: 10:30 Enter value for roomid: 14 Enter value for maxcount: 35 old 1: INSERT INTO CRSSECTION VALUES(&CsId,'&CourseId','&Section','&TermId',&F acultyId,'&Day','&StartTime','&EndTime',&RoomId,&MaxCount) new 1: INSERT INTO CRSSECTION VALUES(1205,'CIS265','01','SP03',NULL,'MW','09:0 0','10:30',14,35) 1 row created. SQL> / Enter value for csid: 1206 Enter value for courseid: CIS265 Enter value for section: 02 Enter value for termid: SP03 Enter value for facultyid: 111 Enter value for day: TR Enter value for starttime: 09:00 Enter value for endtime: 10:30 Enter value for roomid: 18 Enter value for maxcount: 30 old 1: INSERT INTO CRSSECTION VALUES(&CsId,'&CourseId','&Section','&TermId',&F acultyId,'&Day','&StartTime','&EndTime',&RoomId,&MaxCount) new 1: INSERT INTO CRSSECTION VALUES(1206,'CIS265','02','SP03',111,'TR','09:00 ','10:30',18,30) 1 row created. SQL> / Enter value for csid: 1207 Enter value for courseid: LA123 Enter value for section: 05 Enter value for termid: SP03 Enter value for facultyid: NULL Enter value for day: MW Enter value for starttime: 09:00 Enter value for endtime: 10:30 Enter value for roomid: 15 Enter value for maxcount: 30 old 1: INSERT INTO CRSSECTION VALUES(&CsId,'&CourseId','&Section','&TermId',&F acultyId,'&Day','&StartTime','&EndTime',&RoomId,&MaxCount) new 1: INSERT INTO CRSSECTION VALUES(1207,'LA123','05','SP03',NULL,'MW','09:00 ','10:30',15,30) 1 row created. SQL> / Enter value for Enter value for Enter value for Enter value for Enter value for Enter value for Enter value for Enter value for Enter value for Enter value for old 1: INSERT csid: 1208 courseid: CIS253 section: 21 termid: SP03 facultyid: 123 day: TR starttime: 09:00 endtime: 10:30 roomid: 14 maxcount: 40 INTO CRSSECTION VALUES(&CsId,'&CourseId','&Section','&TermId',&F
acultyId,'&Day','&StartTime','&EndTime',&RoomId,&MaxCount) new 1: INSERT INTO CRSSECTION VALUES(1208,'CIS253','21','SP03',123,'TR','09:00 ','10:30',14,40) 1 row created. SQL> / Enter value for csid: 1209 Enter value for courseid: CIS253 Enter value for section: 11 Enter value for termid: SP03 Enter value for facultyid: 111 Enter value for day: MW Enter value for starttime: 09:00 Enter value for endtime: 10:30 Enter value for roomid: 18 Enter value for maxcount: 40 old 1: INSERT INTO CRSSECTION VALUES(&CsId,'&CourseId','&Section','&TermId',&F acultyId,'&Day','&StartTime','&EndTime',&RoomId,&MaxCount) new 1: INSERT INTO CRSSECTION VALUES(1209,'CIS253','11','SP03',111,'MW','09:00 ','10:30',18,40) 1 row created. SQL> / Enter value for csid: 1210 Enter value for courseid: CIS253 Enter value for section: 31 Enter value for termid: SP03 Enter value for facultyid: 123 Enter value for day: F Enter value for starttime: TBA Enter value for endtime: TBA Enter value for roomid: 19 Enter value for maxcount: 2 old 1: INSERT INTO CRSSECTION VALUES(&CsId,'&CourseId','&Section','&TermId',&F acultyId,'&Day','&StartTime','&EndTime',&RoomId,&MaxCount) new 1: INSERT INTO CRSSECTION VALUES(1210,'CIS253','31','SP03',123,'F','TBA',' TBA',19,2) 1 row created. SQL> CREATE TABLE COURSE(CourseId VARCHAR2(6) PRIMARY KEY,Title VARCHAR2(20) UNI QUE,Credits NUMBER(1) CHECK(Credits>=0),PreReq VARCHAR2(6)); Table created. SQL> INSERT INTO COURSE VALUES('&CourseId','&Title',&Credits,'&PreReq'); Enter value for courseid: EN100 Enter value for title: Basic English Enter value for credits: 0 Enter value for prereq: NULL old 1: INSERT INTO COURSE VALUES('&CourseId','&Title',&Credits,'&PreReq') new 1: INSERT INTO COURSE VALUES('EN100','Basic English',0,'NULL') 1 row created. SQL> / Enter value for courseid: LA123 Enter value for title: English Literature
credits: 3 prereq: EN100 INTO COURSE VALUES('&CourseId','&Title',&Credits,'&PreReq') INTO COURSE VALUES('LA123','English Literature',3,'EN100')
1 row created. SQL> / Enter value for Enter value for Enter value for Enter value for old 1: INSERT new 1: INSERT 1 row created. SQL> / Enter value for Enter value for Enter value for Enter value for old 1: INSERT new 1: INSERT 1 row created. SQL> / Enter value for Enter value for Enter value for Enter value for old 1: INSERT new 1: INSERT 1 row created. SQL> / Enter value for Enter value for Enter value for Enter value for old 1: INSERT new 1: INSERT 1 row created. SQL> CREATE TABLE REGISTRATION(StudentId CHAR(5),CsId NUMBER(4),Midterm CHAR CHE CK(Midterm!=G),Final CHAR CHECK(Final!=1),RegStatus CHAR CHECK(RegStatus!=2),CON STRAINT C1 PRIMARY KEY(StudentId,CsId)); CREATE TABLE REGISTRATION(StudentId CHAR(5),CsId NUMBER(4),Midterm CHAR CHECK(Mi dterm!=G),Final CHAR CHECK(Final!=1),RegStatus CHAR CHECK(RegStatus!=2),CONSTRAI NT C1 PRIMARY KEY(StudentId,CsId)) * ERROR at line 1: ORA-02438: Column check constraint cannot reference other columns SQL> CREATE TABLE REGISTRATION(StudentId CHAR(5),CsId NUMBER(4),Midterm CHAR CHE courseid: AC101 title: Accounting credits: 3 prereq: NULL INTO COURSE VALUES('&CourseId','&Title',&Credits,'&PreReq') INTO COURSE VALUES('AC101','Accounting',3,'NULL') courseid: MA150 title: College Algebra credits: 3 prereq: NULL INTO COURSE VALUES('&CourseId','&Title',&Credits,'&PreReq') INTO COURSE VALUES('MA150','College Algebra',3,'NULL') courseid: CIS265 title: Systems Analysis credits: 3 prereq: CIS253 INTO COURSE VALUES('&CourseId','&Title',&Credits,'&PreReq') INTO COURSE VALUES('CIS265','Systems Analysis',3,'CIS253') courseid: CIS253 title: Database Systems credits: 3 prereq: NULL INTO COURSE VALUES('&CourseId','&Title',&Credits,'&PreReq') INTO COURSE VALUES('CIS253','Database Systems',3,'NULL')
CK(Midterm!=G),Final CHAR CHECK(Final!=G),RegStatus CHAR CHECK(RegStatus!=G),CON STRAINT C1 PRIMARY KEY(StudentId,CsId)); CREATE TABLE REGISTRATION(StudentId CHAR(5),CsId NUMBER(4),Midterm CHAR CHECK(Mi dterm!=G),Final CHAR CHECK(Final!=G),RegStatus CHAR CHECK(RegStatus!=G),CONSTRAI NT C1 PRIMARY KEY(StudentId,CsId)) * ERROR at line 1: ORA-02438: Column check constraint cannot reference other columns SQL> CREATE TABLE REGISTRATION(StudentId CHAR(5),CsId NUMBER(4),Midterm CHAR CHE CK(Midterm IN('A','B','C','F','D')),Final CHAR CHECK(Final IN('A','B','D','F','W ')),RegStatus CHAR CHECK(RegStatus IN ('R','W','X')),CONSTRAINT C1 PRIMARY KEY(S tudentId,CsId)); CREATE TABLE REGISTRATION(StudentId CHAR(5),CsId NUMBER(4),Midterm CHAR CHECK(Mi dterm IN('A','B','C','F','D')),Final CHAR CHECK(Final IN('A','B','D','F','W')),R egStatus CHAR CHECK(RegStatus IN ('R','W','X')),CONSTRAINT C1 PRIMARY KEY(Studen tId,CsId)) * ERROR at line 1: ORA-02264: name already used by an existing constraint SQL> ALTER TABLE REGISTRATION DROP CONSTRAINT C1; ALTER TABLE REGISTRATION DROP CONSTRAINT C1 * ERROR at line 1: ORA-00942: table or view does not exist SQL> CREATE TABLE REGISTRATION(StudentId CHAR(5),CsId NUMBER(4),Midterm CHAR CHE CK(Midterm IN('A','B','C','F','D')),Final CHAR CHECK(Final IN('A','B','D','F','W ')),RegStatus CHAR CHECK(RegStatus IN ('R','W','X')),CONSTRAINT C8 PRIMARY KEY(S tudentId,CsId)); Table created. SQL> INSERT INTO REGISTRATION VALUES('&StudentId',&CsId,'&Midterm','&Final','&Re gStatus'); Enter value for studentid: 00100 Enter value for csid: 1103 Enter value for midterm: C Enter value for final: F Enter value for regstatus: R old 1: INSERT INTO REGISTRATION VALUES('&StudentId',&CsId,'&Midterm','&Final', '&RegStatus') new 1: INSERT INTO REGISTRATION VALUES('00100',1103,'C','F','R') 1 row created. SQL> / Enter value for Enter value for Enter value for Enter value for Enter value for old 1: INSERT studentid: 00100 csid: 1102 midterm: B final: B regstatus: R INTO REGISTRATION VALUES('&StudentId',&CsId,'&Midterm','&Final',
'&RegStatus') new 1: INSERT INTO REGISTRATION VALUES('00100',1102,'B','B','R') 1 row created. SQL> / Enter value for Enter value for Enter value for Enter value for Enter value for old 1: INSERT '&RegStatus') new 1: INSERT 1 row created. SQL> / Enter value for Enter value for Enter value for Enter value for Enter value for old 1: INSERT '&RegStatus') new 1: INSERT 1 row created. SQL> / Enter value for Enter value for Enter value for Enter value for Enter value for old 1: INSERT '&RegStatus') new 1: INSERT 1 row created. SQL> / Enter value for Enter value for Enter value for Enter value for Enter value for old 1: INSERT '&RegStatus') new 1: INSERT 1 row created. SQL> / Enter value for Enter value for Enter value for Enter value for Enter value for old 1: INSERT studentid: 00103 csid: 1104 midterm: D final: D regstatus: R INTO REGISTRATION VALUES('&StudentId',&CsId,'&Midterm','&Final', studentid: 00103 csid: 1101 midterm: F final: W regstatus: W INTO REGISTRATION VALUES('&StudentId',&CsId,'&Midterm','&Final', INTO REGISTRATION VALUES('00103',1101,'F','W','W') studentid: 00102 csid: 1103 midterm: A final: A regstatus: R INTO REGISTRATION VALUES('&StudentId',&CsId,'&Midterm','&Final', INTO REGISTRATION VALUES('00102',1103,'A','A','R') studentid: 00102 csid: 1102 midterm: F final: D regstatus: R INTO REGISTRATION VALUES('&StudentId',&CsId,'&Midterm','&Final', INTO REGISTRATION VALUES('00102',1102,'F','D','R') studentid: 00100 csid: 1104 midterm: B final: A regstatus: R INTO REGISTRATION VALUES('&StudentId',&CsId,'&Midterm','&Final', INTO REGISTRATION VALUES('00100',1104,'B','A','R')
'&RegStatus') new 1: INSERT INTO REGISTRATION VALUES('00103',1104,'D','D','R') 1 row created. SQL> / Enter value for studentid: 00100 Enter value for csid: 1207 Enter value for midterm: NULL Enter value for final: NULL Enter value for regstatus: X old 1: INSERT INTO REGISTRATION VALUES('&StudentId',&CsId,'&Midterm','&Final', '&RegStatus') new 1: INSERT INTO REGISTRATION VALUES('00100',1207,'NULL','NULL','X') INSERT INTO REGISTRATION VALUES('00100',1207,'NULL','NULL','X') * ERROR at line 1: ORA-12899: value too large for column "SYSTEM"."REGISTRATION"."MIDTERM" (actual: 4, maximum: 1) SQL> / Enter value for Enter value for Enter value for Enter value for Enter value for old 1: INSERT '&RegStatus') new 1: INSERT 1 row created. SQL> 00103 SP2-0226: Invalid line number SQL> / Enter value for studentid: 00103 Enter value for csid: 1206 Enter value for midterm: Enter value for final: Enter value for regstatus: W old 1: INSERT INTO REGISTRATION VALUES('&StudentId',&CsId,'&Midterm','&Final', '&RegStatus') new 1: INSERT INTO REGISTRATION VALUES('00103',1206,'','','W') 1 row created. SQL> / Enter value for Enter value for Enter value for Enter value for Enter value for old 1: INSERT '&RegStatus') new 1: INSERT 1 row created. SQL> / studentid: 00104 csid: 1206 midterm: final: regstatus: X INTO REGISTRATION VALUES('&StudentId',&CsId,'&Midterm','&Final', INTO REGISTRATION VALUES('00104',1206,'','','X')
studentid: 00100 csid: 1207 midterm: final: regstatus: X INTO REGISTRATION VALUES('&StudentId',&CsId,'&Midterm','&Final', INTO REGISTRATION VALUES('00100',1207,'','','X')
Enter value for Enter value for Enter value for Enter value for Enter value for old 1: INSERT '&RegStatus') new 1: INSERT 1 row created. SQL> / Enter value for Enter value for Enter value for Enter value for Enter value for old 1: INSERT '&RegStatus') new 1: INSERT 1 row created. SQL> / Enter value for Enter value for Enter value for Enter value for Enter value for old 1: INSERT '&RegStatus') new 1: INSERT 1 row created. SQL> / Enter value for Enter value for Enter value for Enter value for Enter value for old 1: INSERT '&RegStatus') new 1: INSERT 1 row created. SQL> / Enter value for Enter value for Enter value for Enter value for Enter value for old 1: INSERT '&RegStatus') new 1: INSERT 1 row created. SQL> /
studentid: 00104 csid: 1207 midterm: final: regstatus: R INTO REGISTRATION VALUES('&StudentId',&CsId,'&Midterm','&Final', INTO REGISTRATION VALUES('00104',1207,'','','R')
studentid: 00104 csid: 1210 midterm: final: regstatus: R INTO REGISTRATION VALUES('&StudentId',&CsId,'&Midterm','&Final', INTO REGISTRATION VALUES('00104',1210,'','','R')
studentid: 00105 csid: 1208 midterm: final: regstatus: R INTO REGISTRATION VALUES('&StudentId',&CsId,'&Midterm','&Final', INTO REGISTRATION VALUES('00105',1208,'','','R')
studentid: 00105 csid: 1209 midterm: final: regstatus: X INTO REGISTRATION VALUES('&StudentId',&CsId,'&Midterm','&Final', INTO REGISTRATION VALUES('00105',1209,'','','X')
studentid: 00101 csid: 1205 midterm: final: regstatus: X INTO REGISTRATION VALUES('&StudentId',&CsId,'&Midterm','&Final', INTO REGISTRATION VALUES('00101',1205,'','','X')
Enter value for Enter value for Enter value for Enter value for Enter value for old 1: INSERT '&RegStatus') new 1: INSERT 1 row created. SQL> / Enter value for Enter value for Enter value for Enter value for Enter value for old 1: INSERT '&RegStatus') new 1: INSERT 1 row created. SQL> / Enter value for Enter value for Enter value for Enter value for Enter value for old 1: INSERT '&RegStatus') new 1: INSERT 1 row created.
studentid: 00102 csid: 1210 midterm: final: regstatus: R INTO REGISTRATION VALUES('&StudentId',&CsId,'&Midterm','&Final', INTO REGISTRATION VALUES('00102',1210,'','','R')
studentid: 00102 csid: 1207 midterm: final: regstatus: X INTO REGISTRATION VALUES('&StudentId',&CsId,'&Midterm','&Final', INTO REGISTRATION VALUES('00102',1207,'','','X')
studentid: 00102 csid: 1206 midterm: final: regstatus: R INTO REGISTRATION VALUES('&StudentId',&CsId,'&Midterm','&Final', INTO REGISTRATION VALUES('00102',1206,'','','R')
SQL> CREATE TABLE ROOM(RoomType CHAR PRIMARY KEY,RoomDesc VARCHAR2(9)); Table created. SQL> INSERT INTO ROOM VALUES('&RoomType','&RoomDesc'); Enter value for roomtype: L Enter value for roomdesc: Lab old 1: INSERT INTO ROOM VALUES('&RoomType','&RoomDesc') new 1: INSERT INTO ROOM VALUES('L','Lab') 1 row created. SQL> / Enter value for Enter value for old 1: INSERT new 1: INSERT 1 row created. SQL> / Enter value for Enter value for old 1: INSERT new 1: INSERT roomtype: roomdesc: INTO ROOM INTO ROOM O Office VALUES('&RoomType','&RoomDesc') VALUES('O','Office') roomtype: roomdesc: INTO ROOM INTO ROOM C Classroom VALUES('&RoomType','&RoomDesc') VALUES('C','Classroom')
1 row created. SQL> CREATE TABLE LOCATION(RoomId NUMBER(2) PRIMARY KEY,Building VARCHAR2(7) NOT NULL,RoomNo CHAR(3) NOT NULL,RoomNo CHAR(3) UNIQUE,Capacity NUMBER(2) CHECK(Cap acity<=50),RoomType CHAR); CREATE TABLE LOCATION(RoomId NUMBER(2) PRIMARY KEY,Building VARCHAR2(7) NOT NULL ,RoomNo CHAR(3) NOT NULL,RoomNo CHAR(3) UNIQUE,Capacity NUMBER(2) CHECK(Capacity <=50),RoomType CHAR) * ERROR at line 1: ORA-00957: duplicate column name SQL> CREATE TABLE LOCATION(RoomId NUMBER(2) PRIMARY KEY,Building VARCHAR2(7) NOT NULL,RoomNo CHAR(3) ,Capacity NUMBER(2) CHECK(Capacity<=50),RoomType CHAR,CONST RAINT C9 NOT NULL(RoomNo),CONSTRAINT C10 UNIQUE(RoomNo)); CREATE TABLE LOCATION(RoomId NUMBER(2) PRIMARY KEY,Building VARCHAR2(7) NOT NULL ,RoomNo CHAR(3) ,Capacity NUMBER(2) CHECK(Capacity<=50),RoomType CHAR,CONSTRAINT C9 NOT NULL(RoomNo),CONSTRAINT C10 UNIQUE(RoomNo)) * ERROR at line 1: ORA-00904: : invalid identifier SQL> CREATE TABLE LOCATION(RoomId NUMBER(2) PRIMARY KEY,Building VARCHAR2(7) NOT NULL,RoomNo CHAR(3) NOT NULL ,Capacity NUMBER(2) CHECK(Capacity<=50),RoomType C HAR); Table created. SQL> ALTER TABLE LOCATION ADD COSTRAINT C9 UNIQUE(RoomNo); ALTER TABLE LOCATION ADD COSTRAINT C9 UNIQUE(RoomNo) * ERROR at line 1: ORA-01735: invalid ALTER TABLE option SQL> CREATE TABLE LOCATION(RoomId NUMBER(2) PRIMARY KEY,Building VARCHAR2(7) NOT NULL,RoomNo CHAR(3) NOT NULL AND UNIQUE ,Capacity NUMBER(2) CHECK(Capacity<=50) ,RoomType CHAR); CREATE TABLE LOCATION(RoomId NUMBER(2) PRIMARY KEY,Building VARCHAR2(7) NOT NULL ,RoomNo CHAR(3) NOT NULL AND UNIQUE ,Capacity NUMBER(2) CHECK(Capacity<=50),Room Type CHAR) * ERROR at line 1: ORA-00907: missing right parenthesis SQL> CREATE TABLE LOCATION(RoomId NUMBER(2) PRIMARY KEY,Building VARCHAR2(7) NOT NULL,RoomNo CHAR(3) CONSTRAINT C9 NOT NULL ,Capacity NUMBER(2) CHECK(Capacity<= 50),RoomType CHAR); CREATE TABLE LOCATION(RoomId NUMBER(2) PRIMARY KEY,Building VARCHAR2(7) NOT NULL ,RoomNo CHAR(3) CONSTRAINT C9 NOT NULL ,Capacity NUMBER(2) CHECK(Capacity<=50),R oomType CHAR) *
ERROR at line 1: ORA-00955: name is already used by an existing object SQL> DROP TABLE LOCATION; Table dropped. SQL> CREATE TABLE LOCATION(RoomId NUMBER(2) PRIMARY KEY,Building VARCHAR2(7) NOT NULL,RoomNo CHAR(3) CONSTRAINT C9 NOT NULL ,Capacity NUMBER(2) CHECK(Capacity<= 50),RoomType CHAR); Table created. SQL> ALTER TABLE LOCATION ADD CONSTRAINT C10 UNIQUE(RoomN0); ALTER TABLE LOCATION ADD CONSTRAINT C10 UNIQUE(RoomN0) * ERROR at line 1: ORA-00904: "ROOMN0": invalid identifier SQL> ALTER TABLE LOCATION ADD CONSTRAINT C10 UNIQUE(RoomNo); Table altered. SQL> INSERT INTO LOCATION VALUES(&RoomId,'&Building','&RoomNo',&Capacity,'&RoomT ype'); Enter value for roomid: 11 Enter value for building: Gandhi Enter value for roomno: 101 Enter value for capacity: 2 Enter value for roomtype: O old 1: INSERT INTO LOCATION VALUES(&RoomId,'&Building','&RoomNo',&Capacity,'&R oomType') new 1: INSERT INTO LOCATION VALUES(11,'Gandhi','101',2,'O') 1 row created. SQL> / Enter value for Enter value for Enter value for Enter value for Enter value for old 1: INSERT oomType') new 1: INSERT 1 row created. SQL> / Enter value for Enter value for Enter value for Enter value for Enter value for old 1: INSERT oomType') new 1: INSERT roomid: 13 building: Kennedy roomno: 202 capacity: 35 roomtype: L INTO LOCATION VALUES(&RoomId,'&Building','&RoomNo',&Capacity,'&R INTO LOCATION VALUES(13,'Kennedy','202',35,'L') roomid: 12 building: Gandhi roomno: 103 capacity: 2 roomtype: O INTO LOCATION VALUES(&RoomId,'&Building','&RoomNo',&Capacity,'&R INTO LOCATION VALUES(12,'Gandhi','103',2,'O')
1 row created. SQL> / Enter value for Enter value for Enter value for Enter value for Enter value for old 1: INSERT oomType') new 1: INSERT 1 row created. SQL> / Enter value for Enter value for Enter value for Enter value for Enter value for old 1: INSERT oomType') new 1: INSERT 1 row created. SQL> / Enter value for Enter value for Enter value for Enter value for Enter value for old 1: INSERT oomType') new 1: INSERT 1 row created. SQL> / Enter value for Enter value for Enter value for Enter value for Enter value for old 1: INSERT oomType') new 1: INSERT 1 row created. SQL> / Enter value for Enter value for Enter value for Enter value for Enter value for old 1: INSERT oomType') new 1: INSERT roomid: 18 building: Kennedy roomno: 206 capacity: 40 roomtype: L INTO LOCATION VALUES(&RoomId,'&Building','&RoomNo',&Capacity,'&R INTO LOCATION VALUES(18,'Kennedy','206',40,'L') roomid: 17 building: Gandhi roomno: 105 capacity: 2 roomtype: O INTO LOCATION VALUES(&RoomId,'&Building','&RoomNo',&Capacity,'&R INTO LOCATION VALUES(17,'Gandhi','105',2,'O') roomid: 16 building: Nehru roomno: 309 capacity: 45 roomtype: C INTO LOCATION VALUES(&RoomId,'&Building','&RoomNo',&Capacity,'&R INTO LOCATION VALUES(16,'Nehru','309',45,'C') roomid: 15 building: Nehru roomno: 301 capacity: 50 roomtype: C INTO LOCATION VALUES(&RoomId,'&Building','&RoomNo',&Capacity,'&R INTO LOCATION VALUES(15,'Nehru','301',50,'C') roomid: 14 building: Kennedy roomno: 204 capacity: 50 roomtype: L INTO LOCATION VALUES(&RoomId,'&Building','&RoomNo',&Capacity,'&R INTO LOCATION VALUES(14,'Kennedy','204',50,'L')
1 row created. SQL> / Enter value for roomid: 19 Enter value for building: Kennedy Enter value for roomno: 2210 Enter value for capacity: 30 Enter value for roomtype: L old 1: INSERT INTO LOCATION VALUES(&RoomId,'&Building','&RoomNo',&Capacity,'&R oomType') new 1: INSERT INTO LOCATION VALUES(19,'Kennedy','2210',30,'L') INSERT INTO LOCATION VALUES(19,'Kennedy','2210',30,'L') * ERROR at line 1: ORA-12899: value too large for column "SYSTEM"."LOCATION"."ROOMNO" (actual: 4, maximum: 3) SQL> / Enter value for Enter value for Enter value for Enter value for Enter value for old 1: INSERT oomType') new 1: INSERT 1 row created. SQL> / Enter value for Enter value for Enter value for Enter value for Enter value for old 1: INSERT oomType') new 1: INSERT 1 row created. SQL> / Enter value for Enter value for Enter value for Enter value for Enter value for old 1: INSERT oomType') new 1: INSERT 1 row created. SQL> commit; Commit complete. SQL> spool off roomid: 21 building: Gandhi roomno: 109 capacity: 2 roomtype: O INTO LOCATION VALUES(&RoomId,'&Building','&RoomNo',&Capacity,'&R INTO LOCATION VALUES(21,'Gandhi','109',2,'O') roomid: 20 building: Gandhi roomno: 107 capacity: 2 roomtype: O INTO LOCATION VALUES(&RoomId,'&Building','&RoomNo',&Capacity,'&R INTO LOCATION VALUES(20,'Gandhi','107',2,'O')
roomid: 19 building: Kennedy roomno: 210 capacity: 30 roomtype: L INTO LOCATION VALUES(&RoomId,'&Building','&RoomNo',&Capacity,'&R INTO LOCATION VALUES(19,'Kennedy','210',30,'L')