Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Veterinarian Office Case: Part 4 The veterinarian office created a database to keep track of owner and pet information. It also includes tracking appointments and
Veterinarian Office Case: Part 4 The veterinarian office created a database to keep track of owner and pet information. It also includes tracking appointments and treatments for each pet. The veterinarians need to retrieve the data for different reasons. Read the question and select the correct answer to that question. Pet PET_ID int PET_BREED varchar(17) PET_NAME varchar(23) OWNER_ID int Owner H OWNER_ID int OWNER_FNAME varchar(20) OWNER_LNAME varchar(30) OWNER_ST_ADDRESS varchar(50) OWNER_CITY varchar(25) OWNER_STATE char(2) OWNER_POSTAL_CODE varchar(15) OWNER_PHONE int OWNER EMAIL varchar(30) Treatment_Appt Appointments APPOINTMENT_ID int PET_ID int APPOINTMENT_DATE date APPOINTMENT_REASON varchar(55) PAID char(1) INVOICE decimal (7,2) +OF TREATMENT_ID int APPOINTMENT_ID int Treatment TREATMENT_ID int TREATMENT_PLAN varchar(55) DIAGNOSIS varchar(45) OWNER_ID OWNER_FNAME OWNER_LNAME OWNER_ST_ADDRESS OWNER_CITY OWNER_STATE OWNERE_POSTAL CODE OWNER_PHONE OWNER_E 1 Melissa Canton NULL NULL NV NULL NULL NULL 2 Clay Sheperd Lousetown Road VC Highlands NV 89521 3456789 chsep@gm 3 Helen Harvey 345 Pine Road Reno NV 89521 3451234 hharvey@e 4 April Windon 123 Doughton Road Reno NV 89521 3454879 awindon@ 5 Emily Minden 540 Fandango Pass Road VC Highlands NV 89521 3455190 emindn@g Pet PETID PET_BREED PET_NAME OWNER_ID 1 Shepherd Bailey 1 2 Husky Sam 2 3 Terrier Bentley 3 4 Shorthair Kiki 1 5 Burmese Boo 4 6 Shorthair Tigger 5 7 Parakeet Bob 5 8 Macaw Biranna 2 Appointments APPOINTMENT_ID PET ID APPOINTMENT DATE APPOINTMENT_REASON PAID INVOICE 1 1 2019-10-19 No feathers N 99.99 2 7 2019-10-11 Has temperature Y 53.34 3 5 2019-10-30 Weighs a lot Y 25.11 4 3 2019-11-05 Yearly checkup Y 99.99 5 5 2019-11-05 Biting people N 125.67 6 1 2010-10-30 Vaccinations N 125.55 7 3 2019-11-07 Chasing tail Y 99.99 8 7 2019-10-30 Vaccinations N 125.55 Treatment_Appt TREATMENT_ID APPOINTMENT_ID 1 2 2 1 9 6 6 3 7 3 7 4 8 5 7 7 9 8 Treatment Treatment TREATMENT ID TREATMENT PLAN DIAGNOSIS 1 Rest and do not run around Exhaustion 2 Put cream on feathers Feathers falling out 3 Put medicine in ears Ear mites 4 Change diet Losing weight 5 Use ointment Fur falling out 6 Get more exercise Gaining too much weight 7 Change diet and provide more exercise opportunities Sleeps all the time 8 Take to training class Bites people 9 Gave vaccination Time for vaccinations 1. The veterinarians want to retrieve the owner last name, pet name, date of the appointment, treatment plan and diagnosis only for cats. Use appropriate column aliases. O a. SELECT OWNER_LNAME as Owner, PET_NAME AS Pet, APPOINTMENT_DATE AS Appointment, TREATMENT_PLAN AS Plan, DIAGNOSIS FROM Owner JOIN Pet USING (OWNER_ID) JOIN APPOINTMENTS USING (PET_ID) JOIN Treatment_appt USING (APPOINTMENT_ID) JOIN Treatment USING (TREATMENT_ID); AND SPECIES IS 'Car; O b. SELECT OWNER_LNAME as Owner, PET_NAME AS Pet, APPOINTMENT_DATE AS Appointment, TREATMENT PLAN AS Plan, DIAGNOSIS FROM Owner JOIN Pet ON Pet.OWNER_ID = Owner.OWNER_ID JOIN Appointments ON APPOINTMENTS.PET_ID = Pet.PET_ID JOIN Treatment_appt ON Appointments.APPOINTMENT_ID = Treatment_appt.APPOINTMENT_ID JOIN Treatment ON Treatment. TREATMENT_ID = Treatment appt. TREATMENT_ID WHERE SPECIES = 'Cat'; O c. SELECT OWNER_LNAME as Owner, PET_NAME AS Pet, APPOINTMENT_DATE AS Appointment, TREATMENT_PLAN AS Plan, DIAGNOSIS FROM Owner,Pet, Treatment; AND SPIECES = Cat; 2. The veterinarians want the information for appointments scheduled for November 5th and beyond. O a. SELECT PET_NAME, OWNER_LNAME, APPOINTMENT_REASON, APPOINTMENT_DATE FROM Owner, Pet, Appointments WHERE Owner.OWNER_ID = Pet.OWNER_ID AND Pet.PET_ID = Appointments.PET_ID AND APPOINTMENT DATE >= '2019-11-05 . The veterinarians want the information for appointments scheduled for November 5th and beyond. O a. SELECT PET_NAME, OWNER_LNAME, APPOINTMENT_REASON, APPOINTMENT_DATE FROM Owner, Pet, Appointments WHERE Owner.OWNER_ID = Pet.OWNER_ID AND Pet.PET_ID = Appointments.PET_ID AND APPOINTMENT_DATE >= '2019-11-05 O b. SELECT PET_NAME, OWNER_LNAME, APPOINTMENT_REASON, APPOINTMENT_DATE FROM Owner, Pet, Appointments WHERE Owner.PET_ID = Pet.PET_ID AND Pet.PET_ID = Appointments.PET_ID AND APPOINTMENT_DATE = November 5 O c. SELECT PET_NAME, OWNER_LNAME, APPOINTMENT_REASON, APPOINTMENT_DATE FROM Owner, Pet, Appointments WHERE Owner.PET_ID = Pet.PET_ID AND Pet.PET_ID = Appointments.PET_ID AND APPOINTMENT_DATE = '2019-11-05 3. The veterinarians want to know all appointmen on October 30th that are cats. O a. SELECT PET_NAME, PET_BREED, APPOINTMENT_DATE, APPOINTMENT_REASON FROM Pet JOIN Appointments ON Pet.PET_ID = Appointments.PET_ID WHERE APPOINTMENT_DATE = "2019-10-30 AND SPECIES = Cat b. SELECT PET_NAME, PET_BREED, APPOINTMENT_DATE, APPOINTMENT_REASON FROM Pet JOIN Appointments ON Pet.PET_ID = Appointments.PET_ID WHERE APPOINTMENT_DATE = 2019-10-30 AND SPECIES = 'Cat': O c. SELECT PET_NAME, PET_BREED, APPOINTMENT_DATE, APPOINTMENT_REASON FROM Pet JOIN Appointments ON Pet.PET_ID = Appointments.PET_ID WHERE APPOINTMENT_DATE = '2019-10-30 AND SPECIES = 'Cat'; 4. The veterinarians want to know all appointments only with cats and birds. a. SELECT PET_NAME, , SPECIES, PET_BREED, APPOINTMENT_DATE, APPOINTMENT_REASON FROM Pet JOIN Appointments ON Appointments.PET_ID = Pet.PET_ID WHERE SPECIES = ('Cat', 'Bird"); O b. SELECT PET_NAME, SPECIES, PET_BREED, APPOINTMENT_DATE, APPOINTMENT_REASON FROM Pet JOIN Appointments On Appointments.PET_ID = Pet.PET_ID WHERE SPECIES IN ('Cat', 'Bird"); O c. SELECT PET_NAME, , SPECIES, PET_BREED, APPOINTMENT_DATE, APPOINTMENT_REASON FROM Pet JOIN Appointments ON Appointments.PET_ID = Pet.PET_ID WHERE SPECIES IS 'Cat' OR 'Bird
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