Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

5. If yes, then why?

Answered: 1 week ago

Question

3. What changes should I be making?

Answered: 1 week ago