Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribedimage text in transcribedimage text in transcribedimage text in transcribed

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 > 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 OWNER_ID OWNER_FNAME OWNER_LNAME OWNER_ST_ADDRESS OWNER_CITY OWNER_STATE OWNERE POSTAL CODE OWNER_PHONE OWNER_EMAIL 1 Melissa Canton NULL NULL NV NULL NULL NULL 2 Clay Sheperd Lousetown Road VC Highlands NV 89521 3456789 chsep@gmail.com 13 Helen Harvey 345 Pine Road Reno NV 89521 3451234 hharvey@gmail.com 4 4 April Windon 123 Doughton Road Reno NV 89521 3454879 awindon@gmail.com 5 Emily Minden 540 Fandango Pass Road VC Highlands NV 89521 3455190 emindn@gmail.com Pet PET ID PET BREED PET NAME OWNER_ID 1 Shepherd Bailey 1 12 Husky Sam 12 13 Terrier Bentley 3 4 Shorthair Kiki 1 5 Burmese Boo 4 4 6 Shorthair Tigger 5 7 Parakeet | 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 tall Y 99.99 8 7 2019-10-30 Vaccinations N 125.55 Treatment_Appt TREATMENT_ID APPOINTMENT_ID 1 2 9 6 6 3 7 3 7 4 8 5 7 9 8 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 19 Gave vaccination Time for vaccinations 1. The veterinarians want to know the total for the invoices that have been paid. O SELECT SUMINVOICE) FROM APPOINTMENTS O . SELECT SUM INVOICE) FROM APPOINTMENTS WHERE PAID-IN OLSELECT INVOICE FROM APPOINTMENTS WHERE PAID-Y: 2. The veterinarians want the information for appointments scheduled between October 19th and October 30. SELECT PET NAME OWNER UNAME, APPOINTMENT REASON, APPOINTMENT DATE FROM Owner, Pet, Appointments WHERE Owner OWNER ID - Pet.OWNER ID AND PL.PET ID - Appointments.PET ID AND APPOINTMENT DATE BETWEEN 2019-10-19 AND 2019 10-30 O 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 IS BETWEEN 2019-10-19' AND 2019 10 30 O L. SELECT PET NAME, OWNER LNAMC, APPOINTMENT REASON, APPOINTMENT DATE FROM Owner, Pet, Appointments WHERE Owner OWNER ID - Pet.OWNER ID AND Pet.PET ID - Appointments.PETID AND APPOINTMENT DATE - 2019-10-19 AND APPOINTMENT DATE - 2019-10-30 3. The veterinarians want to know sort the pets by species and group them by owner. Use appropriate column aliases. 2. SELECT PET ID AS ID, SPECIES PET BREED AS BROED, PET NAME AS NAME OWNER ID FROM PET GROUP BY SPECIES OWNER ID ORDER BY OWNER ID: O . SELECT PET DAS ID, SPECIES, PET BROOD AS BREED, PET NAME AS NAME, OWNER ID FROM PET ORDER BY SPECIES, OWNER ID GROUP BY OWNER ID: 4. The veterinarians want to know all appointments only with cats or dogs. O SELECT POT NAMC, SPECIES PET BREED, APPOINTMENT DATE APPOINTMENT REASON FROM PLJOIN Appointments ON Appointments.PET ID -Pet.PT D WHERE SPECIES - Cat OR SPECIES-Dog O b. SELECT PET NAME, SPECIES, PET OREED, APPOINTMENT DATE, APPOINTMENT REASON FROM PLJOIN Appointments ON Appointments.PET ID - PetPCTD WHERE SPECIES - Cat AND SPECIES - Dong! OL. SELECT PET NAMESPECIES, PET BREED, APPOINTMENT DAT, APPOINTMENT REASON FROM PELTOIN 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

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

Step: 3

blur-text-image

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

Beginning ASP.NET 2.0 And Databases

Authors: John Kauffman, Bradley Millington

1st Edition

0471781347, 978-0471781349

More Books

Students also viewed these Databases questions

Question

=+ Who do you think is right? Why?

Answered: 1 week ago