Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

PET_3 (PetID, PetName, PetType, PetBreed, PetDOB, PetWeight, OwnerID ) Code an S

ID: 3677185 • Letter: P

Question

PET_3 (PetID, PetName, PetType, PetBreed, PetDOB, PetWeight, OwnerID)

Code an SQL statement to create a view named DogBreedCountView that shows each PetBreed of dog and the number of each PetBreed in the database:

PetID PetName PetType PetBreed PetDOB PetWeight OwnerID 1 King Dog Std. Poodle 2009-02-27 00:00:00 25.5 1 2 Teddy Cat Cashmere 2010-02-01 00:00:00 10.5 2 3 Fido Dog Std. Poodle 2008-07-17 00:00:00 28.5 1 4 AJ Dog Collie Mix 2009-05-05 00:00:00 20.0 3 5 Cedro Cat Unknown 2007-06-06 00:00:00 9.5 2 6 Wooley Cat Unknown 9.5 2 7 Buster Dog Border Collie 2006-12-11 00:00:00 25.0 4 8 Sylvester Python Burmese Python 150.0 4

Explanation / Answer

Here is the answer for your question.
General syntax for create a view statement is as follows:
create view nameoftheview (column1,column2, ....., columnN)
as select columns from tablename [order by clause] [result offset clause] [fetch first column]
Answer:
create view DogBreedCountView (PetBreed, PetID)
as select PetBreed, PetID from PET_3 where PetType = 'Dog';