Create the database in Access and populate the tables. Be sure to set up relatio
ID: 3736349 • Letter: C
Question
Create the database in Access and populate the tables. Be sure to set up relationships and enforce referential integrity. Week 4: Create an Access database with the entities, relationships, and sample data (5 records, minimum, per table).
Patient ProcedurelD PatientiD PatientiD PatienttlastName DoctoriD PatientfirstName Treatmenti PatientHouseNumber ProcedureDate PatientstreetName ProcedureTime Patientcity PatintState Doctor Appointment Patientzipcode DoctoriD PatientEmail AppointmentiD DoctorName PatientPhone PatientilD DoctorHouseNumber PatientD08 FK DoctoriD DoctorstreetName Patientinsuranceld AppointmentDate DoctorCity Appointmentrime DoctorState PatientEmployer Doctorzipcode PatientEmergencyContact DotorPhoneNumberExplanation / Answer
Answer)
Tables Created and rows inserted:
CREATE TABLE Patient(PatientId integer PRIMARY KEY, PatientLastName varchar, PatientFirstName varchar, PatientHouseNumber integer, PatientStreetName varchar, PatientCity varchar, PatientState varchar, PatientZipcode varchar, PatientEmail varchar, PatientPhone varchar, PatientDOB date, PatientInsuranceId varchar, PatientSex varchar, PatientEmployer varchar, PatientEmergencyContact varchar);
CREATE TABLE Doctor(DoctorId integer PRIMARY KEY, DoctorName varchar, DoctorHouseNumber integer, DoctorStreetName varchar, DoctorCity varchar, DoctorState varchar, DoctorZipcode varchar, DoctorPhoneNumber varchar);
CREATE TABLE Procedure(ProcedureId integer PRIMARY KEY, PatientId integer, DoctorId integer, TreatmentId integer, ProcedureDate date, ProcedureTime varchar,FOREIGN KEY (PatientId) REFERENCES Patient(PatientId),FOREIGN KEY (DoctorId) REFERENCES Doctor(DoctorId));
CREATE TABLE Appointment(AppointmentId integer PRIMARY KEY, PatientId integer, DoctorId integer, AppointmentDate date, AppointmentTime varchar,FOREIGN KEY (PatientId) REFERENCES Patient(PatientId),FOREIGN KEY (DoctorId) REFERENCES Doctor(DoctorId));
INSERT INTO Patient VALUES(1,'Tom','Riddle',123,'435 Greenfield','NewYork','NW','127-890','some1@email.com','123-124-5675',1989-05-23, 'AJBKJ48598','MALE','COMPANY1','345-654-5463');
INSERT INTO Patient VALUES(2,'Sam','Yu',456,'123 Greenfield','City Seus','CA','455-890','some2@email.com','123-124-4433',1989-06-23, 'AJBDFD8598','FEMALE','COMPANY2','123-654-5463');
INSERT INTO Patient VALUES(3,'John','Fyi',789,'556 Greenfield','NewYork','M?B','009-890','some3@email.com','123-124-1221',1994-05-23, 'AJBKJ4888','FEMALE','COMPANY3','456-654-5463');
INSERT INTO Patient VALUES(4,'Rita','Sak',890,'898 Greenfield','NewYork','NW','556-890','some4@email.com','123-124-7788',1978-05-23, 'AJBKJ48009','MALE','COMPANY4','009-654-5463');
INSERT INTO Patient VALUES(5,'Yellow','Red',477,'110 Greenfield','NewYork','NW','127-445','some5@email.com','123-124-3894',1990-05-23, 'AJBKJ48223','FEMALE','COMPANY5','776-654-5463');
INSERT INTO Doctor VALUES(1,'Qeu',3443,'Street Hog','NW','CA','4234-34','45545-45422');
INSERT INTO Doctor VALUES(2,'Sad',3322,'Street Jam','NW','CA','4433-34','76768-45422');
INSERT INTO Doctor VALUES(3,'Dask',0090,'Street Some','NW','CA','3434-34','99087-45422');
INSERT INTO Doctor VALUES(4,'Der',7788,'Street NW','NW','CA','3433-34','11277-45422');
INSERT INTO Doctor VALUES(5,'Ced',1123,'Street Den','NW','CA','9989-34','77658-45422');
INSERT INTO Procedure VALUES(1,1,1,123,1989-05-23,'23:45');
INSERT INTO Procedure VALUES(2,2,2,124,1990-04-29,'12:45');
INSERT INTO Procedure VALUES(3,3,3,125,1979-04-27,'12:03');
INSERT INTO Procedure VALUES(4,4,4,126,1988-03-26,'20:45');
INSERT INTO Procedure VALUES(5,5,5,127,1999-02-24,'14:10');
INSERT INTO Appointment VALUES(1,1,1,1989-05-23,'11:30');
INSERT INTO Appointment VALUES(2,2,2,1990-05-24,'23:45');
INSERT INTO Appointment VALUES(3,3,3,1999-05-25,'21:30');
INSERT INTO Appointment VALUES(4,4,4,1988-05-22,'09:30');
INSERT INTO Appointment VALUES(5,5,5,1987-05-29,'15:15');
select * from Patient;
select * from Doctor;
select * from Procedure;
select * from Appointment;
Output:
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.