Question
CREATE TABLE APPTDETAIL ( ApptID CHAR(6), ApptReasonCode CHAR(3), BlockCode CHAR(3) NOT NULL, PRIMARY KEY (ApptID,ApptReasonCode), FOREIGN KEY (ApptReasonCode) REFERENCES REASON, FOREIGN KEY (BlockCode) REFERENCES BLOCK
CREATE TABLE APPTDETAIL ( ApptID CHAR(6), ApptReasonCode CHAR(3), BlockCode CHAR(3) NOT NULL, PRIMARY KEY (ApptID,ApptReasonCode), FOREIGN KEY (ApptReasonCode) REFERENCES REASON, FOREIGN KEY (BlockCode) REFERENCES BLOCK );
CREATE TABLE APPOINTMENT ( ApptID CHAR(6), AppDate DATE NOT NULL, ApptTime VARCHAR(6) NOT NULL, PatientID NUMBER(3) NOT NULL, DoctorID NUMBER NOT NULL, BillingType CHAR(2) NOT NULL, InsCoID NUMBER(3), ApptStatusCode CHAR(2) NOT NULL, PRIMARY KEY (ApptID), FOREIGN KEY (PatientID) REFERENCES PATIENT, FOREIGN KEY (DoctorID) REFERENCES DOCTOR, FOREIGN KEY (BillingType) REFERENCES BILLINGTYPE, FOREIGN KEY (InsCoID) REFERENCES INSCO, FOREIGN KEY (ApptStatusCode) REFERENCES STATUS_pxl );
USING SQL QUERY, PLEASE INSERT DATA FROM THE ABOVE TABLE INTO THE TWO TABLES CREATED.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started