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:
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';
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.