SQL_assignment_Using_SQL_to_analyze_data(DDL, DML)

Solve_various_queries_using_CSV_data

SQL Assignment 2

Use the csv files provided for data and solve the following queries:

  1. List the names of all pet owners along with the names of their pets.

  2. List all pets and their owner names, including pets that don't have recorded owners.

  3. Combine the information of pets and their owners, including those pets without owners and owners without pets.
    Hint: We cannot use Full join in mysql. We will use Left Join + union + Right Join.

  4. List all pet owners and the number of dogs they own.

  5. Identify pets that have not had any procedures.

  6. Find the name of the oldest pet.

  7. Find the details of procedures performed on 'Cuddles'.

  8. List the pets who have undergone a procedure called 'VACCINATIONS'.

  9. Count the number of pets of each kind.

  10. Group pets by their kind and gender and count the number of pets in each group.

  11. Show the average age of pets for each kind, but only for kinds that have more than 5 pets.

  12. Find the types of procedures that have an average cost greater than $50.

  13. Classify pets as 'Young', 'Adult', or 'Senior' based on their age. Age less then 3 Young, Age between 3and 8 Adult, else Senior.

  14. Show the gender of pets with a custom label ('Boy' for male, 'Girl' for female).

  15. For each pet, display the pet's name, the number of procedures they've had, and a status label: 'Regular' for pets with 1 to 3 procedures, 'Frequent' for 4 to 7 procedures, and 'Super User' for more than 7 procedures.