For this lab we will be taking our various tables created from our normalization
ID: 3907277 • Letter: F
Question
For this lab we will be taking our various tables created from our normalization process and entering them into Oracle.
For each of your tables you will use SQL and the CREATE TABLE command to create each table with it's various attributes (columns).
You will then use the INSERT INTO command to add 5 rows of data (you make up your own data) to populate each table.
After creating the tables and entering the data - use the SELECT * FROM tablename to list all of the data in each table. You can do a screen capture to save the table data.
Turn in each "screen shot" of each of your tables with all of the data.
Make sure you give me each the screen shot of each table!!!!!!!
SSN Patriert use. Hold Employee EMAME Detaril erson Test Salan(Schedale echn an hoduct DateExplanation / Answer
If you have any doubts, please give me comment...
CREATE TABLE Patient(
SSN INTEGER NOT NULL PRIMARY KEY,
Gender CHAR(1),
MedicalInsurance VARCHAR(30)
);
CREATE TABLE Department(
DID INTEGER NOT NULL PRIMARY KEY,
Name VARCHAR(30),
Address VARCHAR(255)
);
CREATE TABLE Admission(
PID INTEGER,
DID INTEGER,
Time DATETIME,
PRIMARY KEY(PID, DID),
FOREIGN KEY(PID) REFERENCES Patient(SSN),
FOREIGN KEY(DID) REFERENCES Department(DID),
);
CREATE TABLE Bed(
BNumber INTEGER NOT NULL PRIMARY KEY,
Size INTEGER,
DID INTEGER,
FOREIGN KEY(DID) REFERENCES Department(DID)
);
CREATE TABLE Treatment(
TID INTEGER NOT NULL PRIMARY KEY,
Detail VARCHAR(100)
);
CREATE TABLE PatientTreatment(
PID INTEGER,
TID INTEGER,
PRIMARY KEY(PID, TID),
FOREIGN KEY(PID) REFERENCES Patient(SSN),
FOREIGN KEY(TID) REFERENCES Treatment(TID)
);
CREATE TABLE Employee(
EID INTEGER NOT NULL PRIMARY KEY,
ENAME VARCHAR(100),
Salary REAL(10,2),
Schedule VARCHAR(100),
DID INTEGER,
FOREIGN KEY(DID) REFERENCES Department(DID)
);
CREATE TABLE Technician(
DID INTEGER,
Technician VARCHAR(100),
Machine VARCHAR(100),
ProductDate DATE,
FOREIGN KEY(DID) REFERENCES Department(DID)
);
SELECT * FROM Patient;
SELECT * FROM Department;
SELECT * FROM Treatment;
SELECT * FROM Admission;
SELECT * FROM Bed;
SELECT * FROM Employee;
SELECT * FROM PatientTreatment;
SELECT * FROM Technician;
Data may vary bcz we are indians, may be that data might be strange.... If you provide sample data then we will give screen shots for you...
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.