Create the following queries using the
animal hospital database
(see attached document) Please make sure my query’s are correct – if not please re-do them.
Query1: Get the AnimalID, Breed, AnimalName of all the dogs who are 3 years old.
Query2: Get the number of animal visits by each animal (AnimalID).
Hint: You can refer to database lab tutorial query 10 for the use of Totals.
Query3: Get the first name and last name of all the clients whose first name starts with letter B or whose last name contains letter e.
Hint: You can refer to database lab tutorial query 3 for the use of wildcard character.
Query4: Get the AnimalID and Names of the animals who had at least two visits with Doctor Hopkins.
Query5: For each ClientID, get the total balance that the client still needs to pay for all the visits together. The balance for each visit is calculated as the difference between Fee and Paid.
Hint: For calculating the balance, you may refer to database lab tutorial query 12 for the use of [ ], etc.
AnimalID | ClientID | Species | Breed | Age | AnimalName | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | Horse | Quarterhorse | 4 | Blaze | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
2 | Dog | Chihuahua | 3 | Spot | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Cat | Mix | 6 | Nirmal | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
8 | Big | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
5 | Rover | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Collie | Sarah | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
7 | Goat | Nubian | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Cow | Herford | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
9 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
10 | Morgan | 11 | Isty | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Doberman | Jake | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
12 | Terrier | Curley | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
13 | Manx | Little | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
14 | Llama | Matisse | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
15 | Hog | Petunia | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
16 | Saddlebred | Chug | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
17 | Lightning | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
18 | Garfield | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
19 | Mittens | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
20 | Bozo | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
21 | Butler | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
22 | Shadow | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
23 | Stimpy | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
24 | Persian | Queenie | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
25 | Zippo | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
26 | Jimbo | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
27 | Sheba | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
28 | Groucho | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
29 | Sheep | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
30 | Hero | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
31 | Bartholemew | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
32 | Skippy | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
33 | Jezebel | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
34 | Ostrich | Blue | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
35 | Fluffy | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
36 | Tiger | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
37 | Sunshine | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
38 | Friendly | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
39 | Lady | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
40 | Rainbow | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
41 | Stonewall | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
42 | Double Trouble | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
43 | Lucky | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
44 | Puffy | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
45 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
46 | Tramp | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
47 | Sport | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
48 | Inca | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
49 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
50 | Poodle | Alphonse | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
51 | Blue Heeler | Beowolf | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
52 | Bert | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
53 | Ernie | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
54 | Spaniel | Rex | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
55 | Pony | Daisy | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
56 | Jackson | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
57 | Angus | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
58 | Holstein | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
59 | Emu | Standard | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
60 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
61 | Labrador | Harley |
ClientFirstName | ClientLastName | ClientAddress | ClientCity | ClientPhone | Account | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Jennifer | Logan | 324 Eastside Ave | Cawston | 456-5443 | false | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Ken | London | 90 | 456-3154 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Britt | Lizette | 14-3214 27 Avenue | 654-8852 | true | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Diana | Stapleton | 5232 Ida Road | Seymour | 441-6532 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Lloyd | Ray | 124 E. 39 Street | 332-9090 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Duane | Terrace | 44-9090 Salmon St | 123-9960 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Bruce | Moore | 670 Monteith Rd | 334-0987 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Dennis | Williams | 5512 Lakeside Drive | Brookwood | 454-6622 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Wayne | Moravec | RR1 Yankee Flats | Abbot | 434-0980 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Pattie | Dene | 4403 Ida Road | 441-6655 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Gregory | Paulette | 775 39 Street | 332-1505 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Owen | Belgo | 8770 Delhart Ave | 235-6541 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Kevin | Pavan | 441 Potter Drive | 551-6622 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Wendy | Schneider | 133 Buckland St | 441-6023 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Carl | Herbert | 902 Uplands Drive | 551-6327 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Stephanie | Michael | 443 Shelley Ave | 665-9977 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Jakob | Schmidt | 775 Ida Road | 442-5102 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Pam | Stebner | 345 Wiltshire Blvd | 455-6632 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Ingrid | Corey | 22-4587 42 Ave | 125-6545 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Leanne | Stein | 220 Lakeside Drive | 554-6500 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Carmen | Vallance | 451-6625 38 St | 451-3352 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Lorne | Valliere | 545 Potter Drive | 554-3652 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Gerald | Vanderburg | 21 Eastside Ave | 456-3211 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Hank | Gallagher | RR3 Yankee Flats | 225-6333 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Elizabeth | Norman | 554 Cascade Pl | 445-6632 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Ron | Widmann | 756 Clara Drive | 252-6411 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Lonnie | Wilkins | 141 Uplands Drive | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Roland | Sherwood | 712 Shannon Way | 225-5544 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Bud | Charming | 8805 Lakeside Drive | 564-3332 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Arnie | Cramer | 2061 Buchanan | 455-6001 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Nick | Donnelly | 123 Shelley Ave | 665-3324 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Timothy | Collins | 4456 Delhart Ave | 255-3685 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Allan | Young | 767 Renfrew St | 124-9987 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Joan | Clements | 213 Potter Drive | 665-4422 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Graham | Sanderson | 4305 Beach Ave | 445-3328 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Barry | Desjardins | 206 14 Avenue | 332-6410 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Linda | Burke | 477 Canyon Drive | 124-6654 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Darren | James | 62 Eastside Ave | 456-1102 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Spence | 855 Downie | 335-6410 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Lyle | Adair | 332 Ackerman Drive | 441-6320 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Dorothy | Clifford | 365-6630 38 St | 451-6701 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Jose | Zurba | 66 Cranbrooke Rd | 225-3001 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Lorna | Peterson | 201 14 Avenue | 332-5413 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Brendan | Woods | 233 Yuma St | 441-2235 |
DoctorID | DoctorName | HomePhone | |
---|---|---|---|
Dvorak | 554-6684 | ||
Jesse | 665-8744 | ||
Hopkins | 441-6060 | ||
Lamaze | 250-6300 | ||
Wilson | 441-6544 | ||
Smith | 992-2344 | ||
Chen | 323-3456 |
Date | Duration | Treatment | Fee | Paid | Travel | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
5/20/99 | Prescription | ¤ 35.00 | ¤ 20.00 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
5/21/99 | ¤ 40.00 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
5/23/99 | Surgery | ¤ 150.00 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Check-up | ¤ 25.00 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Miscellaneous | ¤ 30.00 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
5/19/99 | First Aid | ¤ 0.00 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
5/22/99 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
¤ 45.00 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Consultation | ¤ 10.00 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
¤ 300.00 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
¤ 175.00 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Vaccination | ¤ 55.00 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
5/18/99 | ¤ 50.00 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
¤ 225.00 | ¤ 100.00 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
¤ 160.00 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
¤ 60.00 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
¤ 75.00 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
¤ 15.00 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
¤ 350.00 | ¤ 200.00 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
¤ 12.00 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
¤ 250.00 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
SELECT Animals.AnimalID, Animals.Breed, Animals.AnimalName, Animals.Age
FROM Animals
WHERE (((Animals.Age)>3));
SELECT Animals.Species, Sum(Visits.AnimalID) AS SumOfAnimalID
FROM Animals INNER JOIN Visits ON Animals.AnimalID = Visits.AnimalID
GROUP BY Animals.Species;
SELECT Clients.ClientFirstName, Clients.ClientLastName
FROM Clients
WHERE (((Clients.ClientFirstName)=”B%”)) OR (((Clients.ClientLastName) Like “*E*”));
SELECT Animals.AnimalID, Animals.AnimalName, Visits.DoctorID, Visits.AnimalID, Doctors.DoctorName
FROM Doctors INNER JOIN (Animals INNER JOIN Visits ON Animals.AnimalID = Visits.AnimalID) ON Doctors.DoctorID = Visits.DoctorID
GROUP BY Animals.AnimalID, Animals.AnimalName, Visits.DoctorID, Visits.AnimalID, Doctors.DoctorName
HAVING (((Visits.DoctorID)=”3″) AND ((Visits.AnimalID)=11 Or (Visits.AnimalID)=15 Or (Visits.AnimalID)=18 Or (Visits.AnimalID)=20 Or (Visits.AnimalID)=22) AND ((Doctors.DoctorName)=”hopkins”));
SELECT Clients.ClientID, Sum(Visits.Fee) AS SumOfFee, Sum(Visits.Paid) AS SumOfPaid
FROM Clients, Visits
GROUP BY Clients.ClientID;