Create Table Address
CREATE TABLE Address
("StudentID" varchar2(6) PRIMARY KEY, "Number" varchar2(4), "Street" varchar2(13), "City" varchar2(15), "PostalCode" int)
Table created.
Insert values to Address
INSERT ALL
INTO Address ("StudentID", "Number", "Street", "City", "PostalCode")
VALUES ('HOG119', '23', 'Apple St', 'Manchester', 123456789)
INTO Address ("StudentID", "Number", "Street", "City", "PostalCode")
VALUES ('HOG136', '456', 'Orange St', 'Sunderland', 234557329)
INTO Address ("StudentID", "Number", "Street", "City", "PostalCode")
VALUES ('HOG139', '78', 'Grape Rd', 'London', 234252342)
INTO Address ("StudentID", "Number", "Street", "City", "PostalCode")
VALUES ('HOG387', '234', 'Mango Blvd', 'Norwich', 234252525)
INTO Address ("StudentID", "Number", "Street", "City", "PostalCode")
VALUES ('HOG437', '45', 'Cherry Rd', 'Anfield', 235254534)
INTO Address ("StudentID", "Number", "Street", "City", "PostalCode")
VALUES ('HOG697', '985A', 'Banana Ave', 'London', 255423645)
INTO Address ("StudentID", "Number", "Street", "City", "PostalCode")
VALUES ('HOG988', '35', 'Pear Ln', 'London', 346347564)
INTO Address ("StudentID", "Number", "Street", "City", "PostalCode")
VALUES ('HOG563', '235', 'Pineapple Rd', 'Portsmouth', 736495730)
INTO Address ("StudentID", "Number", "Street", "City", "PostalCode")
VALUES ('HOG239', '642', 'Strawberry Ln', 'London', 726354859)
INTO Address ("StudentID", "Number", "Street", "City", "PostalCode")
VALUES ('HOG720', '24', 'Blueberry Ave', 'Burnley', 825485029)
INTO Address ("StudentID", "Number", "Street", "City", "PostalCode")
VALUES ('HOG902', '894', 'Blackberry Rd', 'Brighton', 245826940)
SELECT * FROM dual
11 row(s) inserted.
Show Address table
SELECT * FROM Address
StudentID | Number | Street | City | PostalCode | HOG119 | 23 | Apple St | Manchester | 123456789 | HOG136 | 456 | Orange St | Sunderland | 234557329 | HOG139 | 78 | Grape Rd | London | 234252342 | HOG387 | 234 | Mango Blvd | Norwich | 234252525 | HOG437 | 45 | Cherry Rd | Anfield | 235254534 | HOG697 | 985A | Banana Ave | London | 255423645 | HOG988 | 35 | Pear Ln | London | 346347564 | HOG563 | 235 | Pineapple Rd | Portsmouth | 736495730 | HOG239 | 642 | Strawberry Ln | London | 726354859 | HOG720 | 24 | Blueberry Ave | Burnley | 825485029 | HOG902 | 894 | Blackberry Rd | Brighton | 245826940 |
---|
Create Class table
CREATE TABLE Class
("ClassID" varchar2(5) PRIMARY KEY, "ClassTitle" varchar2(29), "Term" varchar2(6), "Seats" int)
Table created.
Insert values to Class table
INSERT ALL
INTO Class ("ClassID", "ClassTitle", "Term", "Seats")
VALUES ('C1111', 'Potions', 'Fall', 30)
INTO Class ("ClassID", "ClassTitle", "Term", "Seats")
VALUES ('C1010', 'Flying', 'Summer', 30)
INTO Class ("ClassID", "ClassTitle", "Term", "Seats")
VALUES ('C2222', 'Defence against the dark arts', 'Fall', 25)
INTO Class ("ClassID", "ClassTitle", "Term", "Seats")
VALUES ('C3333', 'Divination', 'Fall', 30)
INTO Class ("ClassID", "ClassTitle", "Term", "Seats")
VALUES ('C4444', 'Quiddich', 'Spring', 25)
INTO Class ("ClassID", "ClassTitle", "Term", "Seats")
VALUES ('C5555', 'Care for Magical Creatures', 'Spring', 35)
INTO Class ("ClassID", "ClassTitle", "Term", "Seats")
VALUES ('C6666', 'Herbology', 'Spring', 15)
INTO Class ("ClassID", "ClassTitle", "Term", "Seats")
VALUES ('C7777', 'Charms', 'Summer', 10)
INTO Class ("ClassID", "ClassTitle", "Term", "Seats")
VALUES ('C8888', 'Apparition', 'Summer', 10)
INTO Class ("ClassID", "ClassTitle", "Term", "Seats")
VALUES ('C9999', 'Muggle Studies', 'Summer', 15)
INTO Class ("ClassID", "ClassTitle", "Term", "Seats")
VALUES ('C0000', 'The Force', 'Winter', 0)
SELECT * FROM DUAL
11 row(s) inserted.
Show Class table
SELECT * FROM Class
ClassID | ClassTitle | Term | Seats | C1111 | Potions | Fall | 30 | C1010 | Flying | Summer | 30 | C2222 | Defence against the dark arts | Fall | 25 | C3333 | Divination | Fall | 30 | C4444 | Quiddich | Spring | 25 | C5555 | Care for Magical Creatures | Spring | 35 | C6666 | Herbology | Spring | 15 | C7777 | Charms | Summer | 10 | C8888 | Apparition | Summer | 10 | C9999 | Muggle Studies | Summer | 15 | C0000 | The Force | Winter | 0 |
---|
Create Date of Birth table
CREATE TABLE DateOfBirth
("InstructorID" varchar2(6) PRIMARY KEY, "DoB" date)
Table created.
Insert values to Date of Birth table
INSERT ALL
INTO DateOfBirth ("InstructorID", "DoB")
VALUES ('GA2345', TO_DATE('29/04/1931', 'DD/MM/YYYY'))
INTO DateOfBirth ("InstructorID", "DoB")
VALUES ('SA3456', TO_DATE('30/03/1935', 'DD/MM/YYYY'))
INTO DateOfBirth ("InstructorID", "DoB")
VALUES ('GA4567', TO_DATE('19/11/1953', 'DD/MM/YYYY'))
INTO DateOfBirth ("InstructorID", "DoB")
VALUES ('XA5678', TO_DATE('24/01/1965', 'DD/MM/YYYY'))
INTO DateOfBirth ("InstructorID", "DoB")
VALUES ('RB1234', TO_DATE('10/08/1932', 'DD/MM/YYYY'))
INTO DateOfBirth ("InstructorID", "DoB")
VALUES ('GB2345', TO_DATE('23/06/1960', 'DD/MM/YYYY'))
INTO DateOfBirth ("InstructorID", "DoB")
VALUES ('RB3456', TO_DATE('10/02/1940', 'DD/MM/YYYY'))
INTO DateOfBirth ("InstructorID", "DoB")
VALUES ('RB4567', TO_DATE('09/07/1969', 'DD/MM/YYYY'))
INTO DateOfBirth ("InstructorID", "DoB")
VALUES ('SB5678', TO_DATE('02/12/1969', 'DD/MM/YYYY'))
INTO DateOfBirth ("InstructorID", "DoB")
VALUES ('GC1234', TO_DATE('07/10/1962', 'DD/MM/YYYY'))
INTO DateOfBirth ("InstructorID", "DoB")
VALUES ('SC2345', TO_DATE('17/09/1962', 'DD/MM/YYYY'))
INTO DateOfBirth ("InstructorID", "DoB")
VALUES ('SA1234', TO_DATE('14/05/1958', 'DD/MM/YYYY'))
INTO DateOfBirth ("InstructorID", "DoB")
VALUES ('HA6789', TO_DATE('19/07/1952', 'DD/MM/YYYY'))
INTO DateOfBirth ("InstructorID", "DoB")
VALUES ('MY6666', TO_DATE('06/06/0896', 'DD/MM/YYYY'))
SELECT * FROM dual
14 row(s) inserted.
Show Date of Birth table
SELECT * FROM DateOfBirth
InstructorID | DoB | GA2345 | 29-APR-31 | SA3456 | 30-MAR-35 | GA4567 | 19-NOV-53 | XA5678 | 24-JAN-65 | RB1234 | 10-AUG-32 | GB2345 | 23-JUN-60 | RB3456 | 10-FEB-40 | RB4567 | 09-JUL-69 | SB5678 | 02-DEC-69 | GC1234 | 07-OCT-62 | SC2345 | 17-SEP-62 | SA1234 | 14-MAY-58 | HA6789 | 19-JUL-52 | MY6666 | 06-JUN-96 |
---|
Create Email table
CREATE TABLE Email
("StudentID" varchar2(6) PRIMARY KEY, "EmailID" varchar2(31))
Table created.
Add values to Email table
INSERT ALL
INTO Email ("StudentID", "EmailID")
VALUES ('HOG119', 'Malfoy-Drago@hogwarts.edu')
INTO Email ("StudentID", "EmailID")
VALUES ('HOG136', 'Lovegood-Luna@hogwarts.edu')
INTO Email ("StudentID", "EmailID")
VALUES ('HOG139', 'Granger-Hermione@hogwarts.edu')
INTO Email ("StudentID", "EmailID")
VALUES ('HOG387', 'Longbottom-Neville@hogwarts.edu')
INTO Email ("StudentID", "EmailID")
VALUES ('HOG437', 'Potter-Harry@hogwarts.edu')
INTO Email ("StudentID", "EmailID")
VALUES ('HOG697', 'Weasley-Ron@hogwarts.edu')
INTO Email ("StudentID", "EmailID")
VALUES ('HOG988', 'Weasley-Ginny@hogwarts.edu')
INTO Email ("StudentID", "EmailID")
VALUES ('HOG563', 'Lavender-Brown@hogwarts.edu')
INTO Email ("StudentID", "EmailID")
VALUES ('HOG239', 'Seamus-Finnigan@hogwarts.edu')
INTO Email ("StudentID", "EmailID")
VALUES ('HOG720', 'Cho-Chang@hogwarts.edu')
INTO Email ("StudentID", "EmailID")
VALUES ('HOG902', 'Cedric-Diggory@hogwarts.edu')
SELECT * FROM dual
11 row(s) inserted.
Show Email tabke
SELECT * FROM Email
StudentID | EmailID | HOG119 | Malfoy-Drago@hogwarts.edu | HOG136 | Lovegood-Luna@hogwarts.edu | HOG139 | Granger-Hermione@hogwarts.edu | HOG387 | Longbottom-Neville@hogwarts.edu | HOG437 | Potter-Harry@hogwarts.edu | HOG697 | Weasley-Ron@hogwarts.edu | HOG988 | Weasley-Ginny@hogwarts.edu | HOG563 | Lavender-Brown@hogwarts.edu | HOG239 | Seamus-Finnigan@hogwarts.edu | HOG720 | Cho-Chang@hogwarts.edu | HOG902 | Cedric-Diggory@hogwarts.edu |
---|
Create HogwartsHouse table
CREATE TABLE HogwartsHouse
("HouseID" varchar2(2) PRIMARY KEY, "House" varchar2(10), "Founder" varchar2(17), "Relic" varchar2(20))
Table created.
Add values to HogwartsHouse table
INSERT ALL
INTO HogwartsHouse ("HouseID", "House", "Founder", "Relic")
VALUES ('H1', 'Gryffindor', 'Godric Gryffindor', 'Sword')
INTO HogwartsHouse ("HouseID", "House", "Founder", "Relic")
VALUES ('H2', 'Hufflepuff', 'Helga Hufflepuff', 'Cup')
INTO HogwartsHouse ("HouseID", "House", "Founder", "Relic")
VALUES ('H3', 'Ravenclaw', 'Rowena Ravenclaw', 'Diadem')
INTO HogwartsHouse ("HouseID", "House", "Founder", "Relic")
VALUES ('H4', 'Slytherin', 'Salazar Slytherin', 'Locket')
INTO HogwartsHouse ("HouseID", "House", "Founder", "Relic")
VALUES ('H5', 'Jedi', 'Master Yeoda', 'Light Sabre')
SELECT * FROM dual
5 row(s) inserted.
Show HogwartsHouse table
SELECT * FROM HogwartsHouse
HouseID | House | Founder | Relic | H1 | Gryffindor | Godric Gryffindor | Sword | H2 | Hufflepuff | Helga Hufflepuff | Cup | H3 | Ravenclaw | Rowena Ravenclaw | Diadem | H4 | Slytherin | Salazar Slytherin | Locket | H5 | Jedi | Master Yeoda | Light Sabre |
---|
Create Instructor table
CREATE TABLE Instructor
("InstructorID" varchar2(6) PRIMARY KEY, "InstructorFName" varchar2(8), "InstructorLName" varchar2(10), "HouseID" varchar2(2))
Table created.
Insert values to Instructor table
INSERT ALL
INTO Instructor ("InstructorID", "InstructorFName", "InstructorLName", "HouseID")
VALUES ('GA2345', 'Albus', 'Dumbledore', 'H1')
INTO Instructor ("InstructorID", "InstructorFName", "InstructorLName", "HouseID")
VALUES ('SA3456', 'Dolores', 'Umbridge', 'H4')
INTO Instructor ("InstructorID", "InstructorFName", "InstructorLName", "HouseID")
VALUES ('GA4567', 'Serius', 'Black', 'H1')
INTO Instructor ("InstructorID", "InstructorFName", "InstructorLName", "HouseID")
VALUES ('XA5678', 'Firenze', 'Centaur', NULL)
INTO Instructor ("InstructorID", "InstructorFName", "InstructorLName", "HouseID")
VALUES ('RB1234', 'Filius', 'Flitwick', 'H3')
INTO Instructor ("InstructorID", "InstructorFName", "InstructorLName", "HouseID")
VALUES ('GB2345', 'Rubeus', 'Hagrid', NULL)
INTO Instructor ("InstructorID", "InstructorFName", "InstructorLName", "HouseID")
VALUES ('RB3456', 'Gilderoy', 'Lockhart', 'H3')
INTO Instructor ("InstructorID", "InstructorFName", "InstructorLName", "HouseID")
VALUES ('RB4567', 'Sybill', 'Trelawney', 'H3')
INTO Instructor ("InstructorID", "InstructorFName", "InstructorLName", "HouseID")
VALUES ('SB5678', 'Alecto', 'Carrow', 'H4')
INTO Instructor ("InstructorID", "InstructorFName", "InstructorLName", "HouseID")
VALUES ('GC1234', 'Remus', 'Lupin', 'H1')
INTO Instructor ("InstructorID", "InstructorFName", "InstructorLName", "HouseID")
VALUES ('SC2345', 'Horace', 'Slughorn', 'H4')
INTO Instructor ("InstructorID", "InstructorFName", "InstructorLName", "HouseID")
VALUES ('SA1234', 'Severus', 'Snape', 'H4')
INTO Instructor ("InstructorID", "InstructorFName", "InstructorLName", "HouseID")
VALUES ('HA6789', 'Poppy', 'Pomfrey', 'H2')
INTO Instructor ("InstructorID", "InstructorFName", "InstructorLName", "HouseID")
VALUES ('MY6666', 'Master', 'Yeoda', 'H5')
SELECT * FROM dual
14 row(s) inserted.
Show Instructor table
SELECT * FROM Instructor
InstructorID | InstructorFName | InstructorLName | HouseID | GA2345 | Albus | Dumbledore | H1 | SA3456 | Dolores | Umbridge | H4 | GA4567 | Serius | Black | H1 | XA5678 | Firenze | Centaur | - | RB1234 | Filius | Flitwick | H3 | GB2345 | Rubeus | Hagrid | - | RB3456 | Gilderoy | Lockhart | H3 | RB4567 | Sybill | Trelawney | H3 | SB5678 | Alecto | Carrow | H4 | GC1234 | Remus | Lupin | H1 | SC2345 | Horace | Slughorn | H4 | SA1234 | Severus | Snape | H4 | HA6789 | Poppy | Pomfrey | H2 | MY6666 | Master | Yeoda | H5 |
---|
Create InstructorClass table
CREATE TABLE InstructorClass
("InstructorClass" varchar2(12) PRIMARY KEY, "InstructorID" varchar2(6), "ClassID" varchar2(5))
Table created.
Insert values to InstructorClass table
INSERT ALL
INTO InstructorClass ("InstructorClass", "InstructorID", "ClassID")
VALUES ('SA1234-C1111', 'SA1234', 'C1111')
INTO InstructorClass ("InstructorClass", "InstructorID", "ClassID")
VALUES ('SB5678-C1010', 'SB5678', 'C1010')
INTO InstructorClass ("InstructorClass", "InstructorID", "ClassID")
VALUES ('GA2345-C2222', 'GA2345', 'C2222')
INTO InstructorClass ("InstructorClass", "InstructorID", "ClassID")
VALUES ('SA1234-C4444', 'SA1234', 'C4444')
INTO InstructorClass ("InstructorClass", "InstructorID", "ClassID")
VALUES ('XA5678-C5555', 'XA5678', 'C5555')
INTO InstructorClass ("InstructorClass", "InstructorID", "ClassID")
VALUES ('RB1234-C6666', 'RB1234', 'C6666')
INTO InstructorClass ("InstructorClass", "InstructorID", "ClassID")
VALUES ('RB3456-C8888', 'RB3456', 'C8888')
INTO InstructorClass ("InstructorClass", "InstructorID", "ClassID")
VALUES ('MY6666-C0000', 'MY6666', 'C0000')
SELECT * FROM dual
8 row(s) inserted.
Show InstructorClass table
SELECT * FROM InstructorClass
InstructorClass | InstructorID | ClassID | SA1234-C1111 | SA1234 | C1111 | SB5678-C1010 | SB5678 | C1010 | GA2345-C2222 | GA2345 | C2222 | SA1234-C4444 | SA1234 | C4444 | XA5678-C5555 | XA5678 | C5555 | RB1234-C6666 | RB1234 | C6666 | RB3456-C8888 | RB3456 | C8888 | MY6666-C0000 | MY6666 | C0000 |
---|
Create MealPlan table
CREATE TABLE MealPlan
("StudentID" varchar2(6), "MealPlanIDNo" varchar2(6) PRIMARY KEY)
Table created.
Insert values to MealPlan table
INSERT ALL
INTO MealPlan ("StudentID", "MealPlanIDNo")
VALUES ('HOG119', 'ABC123')
INTO MealPlan ("StudentID", "MealPlanIDNo")
VALUES ('HOG136', 'DEF456')
INTO MealPlan ("StudentID", "MealPlanIDNo")
VALUES ('HOG139', 'GHI789')
INTO MealPlan ("StudentID", "MealPlanIDNo")
VALUES ('HOG387', 'JKL123')
INTO MealPlan ("StudentID", "MealPlanIDNo")
VALUES ('HOG437', 'MNO456')
INTO MealPlan ("StudentID", "MealPlanIDNo")
VALUES ('HOG697', 'PQR789')
INTO MealPlan ("StudentID", "MealPlanIDNo")
VALUES ('HOG988', 'STU123')
INTO MealPlan ("StudentID", "MealPlanIDNo")
VALUES ('HOG119', 'VWX456')
INTO MealPlan ("StudentID", "MealPlanIDNo")
VALUES ('HOG136', 'YYZ789')
INTO MealPlan ("StudentID", "MealPlanIDNo")
VALUES ('HOG387', 'ABC789')
INTO MealPlan ("StudentID", "MealPlanIDNo")
VALUES ('HOG988', 'DEF000')
SELECT * FROM dual
11 row(s) inserted.
Show MealPlan table
SELECT * FROM MealPlan
StudentID | MealPlanIDNo | HOG119 | ABC123 | HOG136 | DEF456 | HOG139 | GHI789 | HOG387 | JKL123 | HOG437 | MNO456 | HOG697 | PQR789 | HOG988 | STU123 | HOG119 | VWX456 | HOG136 | YYZ789 | HOG387 | ABC789 | HOG988 | DEF000 |
---|
Create Salary table
CREATE TABLE Salary
("InstructorID" varchar2(6) PRIMARY KEY, "Pay" int, "Bonus" int)
Table created.
Insert values to Salary table
INSERT ALL
INTO Salary ("InstructorID", "Pay", "Bonus")
VALUES ('GA2345', 1200, 180)
INTO Salary ("InstructorID", "Pay", "Bonus")
VALUES ('SA3456', 1400, 100)
INTO Salary ("InstructorID", "Pay", "Bonus")
VALUES ('GA4567', 1600, 200)
INTO Salary ("InstructorID", "Pay", "Bonus")
VALUES ('XA5678', 1800, 500)
INTO Salary ("InstructorID", "Pay", "Bonus")
VALUES ('RB1234', 2000, 250)
INTO Salary ("InstructorID", "Pay", "Bonus")
VALUES ('GB2345', 2200, 300)
INTO Salary ("InstructorID", "Pay", "Bonus")
VALUES ('RB3456', 2400, 320)
INTO Salary ("InstructorID", "Pay", "Bonus")
VALUES ('RB4567', 2600, 900)
INTO Salary ("InstructorID", "Pay", "Bonus")
VALUES ('SB5678', 2800, 380)
INTO Salary ("InstructorID", "Pay", "Bonus")
VALUES ('GC1234', 3500, 700)
INTO Salary ("InstructorID", "Pay", "Bonus")
VALUES ('SC2345', 3600, 360)
INTO Salary ("InstructorID", "Pay", "Bonus")
VALUES ('SA1234', 1000, 150)
INTO Salary ("InstructorID", "Pay", "Bonus")
VALUES ('HA6789', 1200, 200)
INTO Salary ("InstructorID", "Pay", "Bonus")
VALUES ('MY6666', 888, 88)
SELECT * FROM dual
14 row(s) inserted.
Show Salary table
SELECT * FROM Salary
InstructorID | Pay | Bonus | GA2345 | 1200 | 180 | SA3456 | 1400 | 100 | GA4567 | 1600 | 200 | XA5678 | 1800 | 500 | RB1234 | 2000 | 250 | GB2345 | 2200 | 300 | RB3456 | 2400 | 320 | RB4567 | 2600 | 900 | SB5678 | 2800 | 380 | GC1234 | 3500 | 700 | SC2345 | 3600 | 360 | SA1234 | 1000 | 150 | HA6789 | 1200 | 200 | MY6666 | 888 | 88 |
---|
Create Student table
CREATE TABLE Student
("StudentID" varchar2(6), "Lname" varchar2(10), "Fname" varchar2(8), "HouseID" varchar2(2))
Table created.
Insert values to Student table
INSERT ALL
INTO Student ("StudentID", "Lname", "Fname", "HouseID")
VALUES ('HOG119', 'Malfoy', 'Draco', 'H4')
INTO Student ("StudentID", "Lname", "Fname", "HouseID")
VALUES ('HOG136', 'Lovegood', 'Luna', 'H3')
INTO Student ("StudentID", "Lname", "Fname", "HouseID")
VALUES ('HOG139', 'Granger', 'Hermione', 'H1')
INTO Student ("StudentID", "Lname", "Fname", "HouseID")
VALUES ('HOG387', 'Longbottom', 'Neville', 'H1')
INTO Student ("StudentID", "Lname", "Fname", "HouseID")
VALUES ('HOG437', 'Potter', 'Harry', 'H1')
INTO Student ("StudentID", "Lname", "Fname", "HouseID")
VALUES ('HOG697', 'Weasley', 'Ron', 'H1')
INTO Student ("StudentID", "Lname", "Fname", "HouseID")
VALUES ('HOG988', 'Weasley', 'Ginny', 'H1')
INTO Student ("StudentID", "Lname", "Fname", "HouseID")
VALUES ('HOG563', 'Brown', 'Lavender', 'H1')
INTO Student ("StudentID", "Lname", "Fname", "HouseID")
VALUES ('HOG239', 'Finnigan', 'Seamus', 'H1')
INTO Student ("StudentID", "Lname", "Fname", "HouseID")
VALUES ('HOG720', 'Chang', 'Cho', 'H3')
INTO Student ("StudentID", "Lname", "Fname", "HouseID")
VALUES ('HOG902', 'Diggory', 'Cedric', 'H2')
SELECT * FROM dual
11 row(s) inserted.
Show Student table
SELECT * FROM Student
StudentID | Lname | Fname | HouseID | HOG119 | Malfoy | Draco | H4 | HOG136 | Lovegood | Luna | H3 | HOG139 | Granger | Hermione | H1 | HOG387 | Longbottom | Neville | H1 | HOG437 | Potter | Harry | H1 | HOG697 | Weasley | Ron | H1 | HOG988 | Weasley | Ginny | H1 | HOG563 | Brown | Lavender | H1 | HOG239 | Finnigan | Seamus | H1 | HOG720 | Chang | Cho | H3 | HOG902 | Diggory | Cedric | H2 |
---|
Create StudentClass table
CREATE TABLE StudentClass
("StudentClass" varchar2(12) PRIMARY KEY, "StudentID" varchar2(6), "ClassID" varchar2(5))
Table created.
Insert values to StudentClass table
INSERT ALL
INTO StudentClass ("StudentClass", "StudentID", "ClassID")
VALUES ('HOG119-C5555', 'HOG119', 'C5555')
INTO StudentClass ("StudentClass", "StudentID", "ClassID")
VALUES ('HOG136-C1111', 'HOG136', 'C1111')
INTO StudentClass ("StudentClass", "StudentID", "ClassID")
VALUES ('HOG136-C2222', 'HOG136', 'C2222')
INTO StudentClass ("StudentClass", "StudentID", "ClassID")
VALUES ('HOG139-C2222', 'HOG139', 'C2222')
INTO StudentClass ("StudentClass", "StudentID", "ClassID")
VALUES ('HOG239-C2222', 'HOG239', 'C2222')
INTO StudentClass ("StudentClass", "StudentID", "ClassID")
VALUES ('HOG437-C1111', 'HOG437', 'C1111')
INTO StudentClass ("StudentClass", "StudentID", "ClassID")
VALUES ('HOG437-C2222', 'HOG437', 'C2222')
INTO StudentClass ("StudentClass", "StudentID", "ClassID")
VALUES ('HOG437-C3333', 'HOG437', 'C3333')
INTO StudentClass ("StudentClass", "StudentID", "ClassID")
VALUES ('HOG563-C2222', 'HOG563', 'C2222')
INTO StudentClass ("StudentClass", "StudentID", "ClassID")
VALUES ('HOG697-C1111', 'HOG697', 'C1111')
INTO StudentClass ("StudentClass", "StudentID", "ClassID")
VALUES ('HOG697-C3333', 'HOG697', 'C3333')
INTO StudentClass ("StudentClass", "StudentID", "ClassID")
VALUES ('HOG697-C5555', 'HOG697', 'C5555')
INTO StudentClass ("StudentClass", "StudentID", "ClassID")
VALUES ('HOG720-C2222', 'HOG720', 'C2222')
INTO StudentClass ("StudentClass", "StudentID", "ClassID")
VALUES ('HOG902-C5555', 'HOG902', 'C5555')
INTO StudentClass ("StudentClass", "StudentID", "ClassID")
VALUES ('HOG136-C0000', 'HOG136', 'C0000')
SELECT * FROM dual
15 row(s) inserted.
Show StudentClass table
SELECT * FROM StudentClass
StudentClass | StudentID | ClassID | HOG119-C5555 | HOG119 | C5555 | HOG136-C1111 | HOG136 | C1111 | HOG136-C2222 | HOG136 | C2222 | HOG139-C2222 | HOG139 | C2222 | HOG239-C2222 | HOG239 | C2222 | HOG437-C1111 | HOG437 | C1111 | HOG437-C2222 | HOG437 | C2222 | HOG437-C3333 | HOG437 | C3333 | HOG563-C2222 | HOG563 | C2222 | HOG697-C1111 | HOG697 | C1111 | HOG697-C3333 | HOG697 | C3333 | HOG697-C5555 | HOG697 | C5555 | HOG720-C2222 | HOG720 | C2222 | HOG902-C5555 | HOG902 | C5555 | HOG136-C0000 | HOG136 | C0000 |
---|
Create Telephone table
CREATE TABLE Tel
("StudentID" varchar2(6), "TelNo" int)
Table created.
Insert values to Telephone table
INSERT ALL
INTO Tel ("StudentID", "TelNo")
VALUES ('HOG119', 3123123)
INTO Tel ("StudentID", "TelNo")
VALUES ('HOG136', 5623567)
INTO Tel ("StudentID", "TelNo")
VALUES ('HOG139', 5634567)
INTO Tel ("StudentID", "TelNo")
VALUES ('HOG387', 4789754)
INTO Tel ("StudentID", "TelNo")
VALUES ('HOG437', 7653234)
INTO Tel ("StudentID", "TelNo")
VALUES ('HOG697', 9867456)
INTO Tel ("StudentID", "TelNo")
VALUES ('HOG988', 3457868)
INTO Tel ("StudentID", "TelNo")
VALUES ('HOG563', 8532579)
INTO Tel ("StudentID", "TelNo")
VALUES ('HOG239', 2359435)
INTO Tel ("StudentID", "TelNo")
VALUES ('HOG720', 9362950)
INTO Tel ("StudentID", "TelNo")
VALUES ('HOG902', 2946592)
SELECT * FROM dual
11 row(s) inserted.
Show Telephone table
SELECT * FROM Tel
StudentID | TelNo | HOG119 | 3123123 | HOG136 | 5623567 | HOG139 | 5634567 | HOG387 | 4789754 | HOG437 | 7653234 | HOG697 | 9867456 | HOG988 | 3457868 | HOG563 | 8532579 | HOG239 | 2359435 | HOG720 | 9362950 | HOG902 | 2946592 |
---|
Create Wand table
CREATE TABLE Wand
("StudentID" varchar2(6), "WandCore" varchar2(30))
Table created.
Insert values to Wand table
INSERT ALL
INTO Wand ("StudentID", "WandCore")
VALUES ('HOG119', 'Unicorn Hair')
INTO Wand ("StudentID", "WandCore")
VALUES ('HOG136', 'Veela Hair')
INTO Wand ("StudentID", "WandCore")
VALUES ('HOG139', 'Dragon Heartstring')
INTO Wand ("StudentID", "WandCore")
VALUES ('HOG387', 'Unicorn Hair')
INTO Wand ("StudentID", "WandCore")
VALUES ('HOG437', 'Phoenix Feather')
INTO Wand ("StudentID", "WandCore")
VALUES ('HOG697', 'Broken Stuff')
INTO Wand ("StudentID", "WandCore")
VALUES ('HOG988', 'Veela Hair')
INTO Wand ("StudentID", "WandCore")
VALUES ('HOG563', 'Unknown')
INTO Wand ("StudentID", "WandCore")
VALUES ('HOG239', 'Unknown')
INTO Wand ("StudentID", "WandCore")
VALUES ('HOG720', 'Unknown')
INTO Wand ("StudentID", "WandCore")
VALUES ('HOG902', 'Unicorn hair')
SELECT * FROM dual
11 row(s) inserted.
Show Wand table
SELECT * FROM Wand
StudentID | WandCore | HOG119 | Unicorn Hair | HOG136 | Veela Hair | HOG139 | Dragon Heartstring | HOG387 | Unicorn Hair | HOG437 | Phoenix Feather | HOG697 | Broken Stuff | HOG988 | Veela Hair | HOG563 | Unknown | HOG239 | Unknown | HOG720 | Unknown | HOG902 | Unicorn hair |
---|