MySQL Pokemon Report Queries
Goals
- Become proficient selecting data out of a mysql database
- Become comfortable performing a SQL join
- Be able to format SQL output as a readable report
Instructions
Part 1: Importing data
Directions:
- In intellij, connect to your local mysql instance
- Create your pokemon schema
- Unpack the pokemon_sql.zip files
- One by one execute these files making sure to check your pokemon schema
From here you should have all the pokemon data in your mysql schema. Feel free to explore the data and perform a few select statements to see what the data looks like.
Part 2: Simple Selects and Counts
Directions: Write a sql query or sql queries that can answer the following questions
- What are all the types of pokemon that a pokemon can have?
- What is the name of the pokemon with id 45?
- How many pokemon are there?
- How many types are there?
- How many pokemon have a secondary type?
Part 3: Joins and Groups
Directions: Write a sql query or sql queries that can answer the following questions
- What is each pokemon's primary type?
- What is Rufflet's secondary type?
- What are the names of the pokemon that belong to the trainer with trainerID 303?
- How many pokemon have a secondary type
Poison
- What are all the primary types and how many pokemon have that type?
- How many pokemon at level 100 does each trainer with at least one level 100 pokemone have? (Hint: your query should not display a trainer
- How many pokemon only belong to one trainer and no other?
Part 4: Final Report
Directions: Write a query that returns the following collumns:
Pokemon Name |
Trainer Name |
Level |
Primary Type |
Secondary Type |
Pokemon's name |
Trainer's name |
Current Level |
Primary Type Name |
Secondary Type Name |
Order the data by finding out which trainer has the strongest pokemon so that this will act as a ranking of strongest to weakest trainer. You may interpret strongest in whatever way you want, but you will have to explain your decision.