In: Computer Science
1. Write the statement that will display all of the information in the PetOwner table using the asterisk (*) notation.
2. Write the statement that will display all of the information in the PetOwner table without using the asterisk (*) notation.
3. Write the statement that will display the first and last names of the owners in that order.
4. Write the statement to display the breed, type and DOB of all pets having a type of Cat.
5. Write the statement to display the names of the pets that have an annotated birthdate.
6. Write the statement to display all of the listed pet breeds.
Q1. Write the statement that will display all of the information
in the PetOwner table using the asterisk (*) notation.
Answer:-------
SELECT * FROM PetOwner
;
Q2. Write the statement that will display all of the information
in the PetOwner table without using the asterisk (*)
notation.
Answer:-------
SELECT OwnerID, OwnerFirstName, OwnerLastName, OwnerEmail,
OwnerPhone FROM PetOwner ;
Q3. Write the statement that will display the first and last
names of the owners in that order.
Answer:-------
SELECT OwnerFirstName, OwnerLastName FROM
PetOwner ORDER BY OwnerFirstName, OwnerLastName
;
Q4. Write the statement to display the breed, type and DOB of
all pets having a type of Cat.
Answer:-------
SELECT PetBreed, PetType, PetDOB FROM Pet
WHERE PetType = ‘Cat' ;
Q5. Write the statement to display the names of the pets that
have an annotated birthdate.
Answer:-------
SELECT PetName FROM Pet
HAVING DISTINCT PetDOB ;
Q6. Write the statement to display all of the listed pet
breeds.
Answer:-------
SELECT PetBread FROM Pet
;