Write an SQL statement to create a view DoctorsdoctorId doct
Write an SQL statement to create a view.
Doctors(doctorId, doctorName, specialty)
Patients(patientId, patientName, sex, patientBalance, numberOfVisits)
Records(doctorId, patientId, date, diagnosis, visitCost)
1. Create a view, called DoctorSmithsPatients, to list all the patients Dr. Smith has.
Solution
Answer:
create view DoctorSmithsPatients as select * from Doctors where doctorName = \'Smith\';
This sql statement will create a view DoctorSmithsPatients that contains list of all the patients Dr. Smith has.
