Retrieving Data with MySQL

  • Introduction to: Relational Database Management Systems (RDBSM) & Structured Query Language (SQL)

  • Creating a table

  • Querying Data

    • SELECT

    • FROM

    • WHERE

Preperation:

MySQL in 10 minutesarrow-up-right

What is MySQLarrow-up-right

The SELECT statementarrow-up-right

WHERE & ORDER BYarrow-up-right

How to load data into a database

Choose a connection

image-20220816103831195

Copy the script (below) into the Query window or download from herearrow-up-right

image-20220816104142995

Press the left lightning button

image-20220816104228789

Refresh All

image-20220816104435630

Exercises 1

  • Explain: What does the dataset contain?

Retrieve the following data by querying:

  • All pokemon with all their columns

  • Only the name of all pokemon

  • All grass type pokemon

  • All pokemon with a speed above 56

  • All pokemon with a secondary type

  • Is MySQL case sensitive? Explain with an example

Exercises 2

Retrieve the following data by querying:

  • The name of all pokemon with a special defence less than 56 and a special attack higher than 65

  • All grass type pokemon starting with the letter 'B'

  • All fire or ground pokemon with an attack higher than 50

  • The first 10 pokemon by pokedex number ordered by their speed

Advanced queries (Optional)

  • All pokemon without a secondary type, starting with 'P' with an attack or defence above 40

  • The 10 pokemon with the highest attack

  • All pokemon that contains the latter 'C' in their name - ordered alphabetically

Last updated