Question
CREATE TABLE Patient ( PatientID Varchar2(5) Constraint PatPatID_PK primary key PatientLastName Varchar2(20), PatientFirstName Varchar2(20), PatientAddress Varchar2(55), PatientCity Varchar2(55), PatientState Varchar2(55), PatientZip Varchar2(55), PatientPhone Varchar2(14), InsurancePolicyNum
CREATE TABLE Patient (
PatientID Varchar2(5) Constraint PatPatID_PK primary key
PatientLastName Varchar2(20),
PatientFirstName Varchar2(20),
PatientAddress Varchar2(55),
PatientCity Varchar2(55),
PatientState Varchar2(55),
PatientZip Varchar2(55),
PatientPhone Varchar2(14),
InsurancePolicyNum Varchar2(20),
IsOutpatient Char(1) check (IsOutpatient in (‘Y’,’N’)),
IsResident Char(1) check (IsResident in (‘Y’,’N’)),
PatientsPhysicianID Varchar2(5)
Constraint Pats_Phys_FK references Physician(PhysicianID));
CREATE TABLE Physician (
PhysicianID Varchar2(5) Constraint Phy_PhysID_PK primary key
PhysicianLastName Varchar2(20),
PhysicianFirstName Varchar2(20),
DEA_No Varchar2(20),
Pager_No Varchar2(14),
PhysicianSpecialty Varchar2(20));
CREATE TABLE Visit (
VisitNo Varchar2(5) Constraint VIS_NO_PK primary key,
OutPatientID Varchar2(5)
Constraint VIS_OP_ID_FK references Outpatient(OPatientID),
VisitDate Date,
VisitTime Timestamp,
VisitReason Varchar2(50));
CREATE TABLE Outpatient (
OutPatientID Varchar2(5) Constraint OP_OP_ID_PK primary key
Constraint OP_OP_ID_FK references Patient(PatientID));
CREATE TABLE Nurse (
NurseID Varchar2(5) Constraint NUR_NID_PK primary key
Constraint NUR_NID_FK references Employee(EmpID),
CertDegree Varchar2(5),
StateLicenseNo Varchar2(15),
NurseSpecialty Varchar2(20),
NurseType Char(1) check (NurseType in (‘R’,’L’));
CREATE TABLE RN (
RNID Varchar2(5) Constraint RN_RN_ID_PK primary key
Constraint RN_RN_ID_FK references Nurse(NurseID));
Write a proper SQL join query to retrieve the physician’s first and last name for patients living in Daly City.
Step by Step Solution
3.39 Rating (158 Votes )
There are 3 Steps involved in it
Step: 1
On the given question it says to CREATE TABLE Patient CREATE TABLE Physician CREATE TABLE Visit CREATE TABLE Outpatient CREATE TABLE Nurse CREATE TABL...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