Data types & Scales

  • Data represented in a computer

  • Data types

  • Data scales

  • Meta data

Preparation:

Data Literacy Fundamentals, Ben Jones, Ch: 3,4

SELECTarrow-up-right

WHEREarrow-up-right

ANDarrow-up-right

1. What will the following query return?

SELECT `name`, hp
FROM pokemon
WHERE hp >= 100

A) All Pokémon with exactly 100 HP

B) All Pokémon with HP greater than or equal to 100

C) All Pokémon with HP less than 100

D) Invalid Query

2. How many columns will the following query return?

A) 1

B) 2

C) 3

D) All columns from the table

3. What will the following query return?

A) All Pokémon with type water or ice

B) All Pokémon with both primary type water and secondary type ice

C) All Pokémon with either water as primary or ice as secondary type

D) Invalid Query

Exercise 1 - Pairs

For hvert eksempel skal du afgøre, om det er nominal, ordinal, interval eller ratio – og give en kort begrundelse.

Politisk tilhørsforhold (fx socialdemokrat, liberal, konservativ, socialist)

Jobtitel i en organisation (fx praktikant, konsulent, senior konsulent, direktør)

T-shirt størrelser (S, M, L, XL).

Fødselsår (fx 1975, 1990, 2005 …)

Kundetilfredshed (meget utilfreds → meget tilfreds).

Årlig indkomst i kroner (fx 300.000 kr., 500.000 kr., 1.000.000 kr.)

Vin-anmeldelser på en 100-point skala (fx 86, 92, 97 point)

Exercise 2 - Pairs

Spotify-dataarrow-up-right

Identificer:

  • Datatype for hver kolonne

  • Skala for hver kolonne

  • Begrund hvert valg

Exercises 3 - Pairs

  • In the Pokemon dataset: RELOAD THE DATASET - THERE WAS AN ERROR BEFORE

Retrieve the following data by querying:

  • All pokemon with all their columns

  • Only the name of all pokemon

  • All pokemon with grass as their primary type

    • Answer: 12 Rows returned

  • All pokemon with a speed above 56

    • Answer: 94 rows returned

  • All pokemon with a secondary type

    • Answer: 67 Rows returned

  • All pokemon where their attack is higher than their defence

    • Answer: 94 Rows returned

  • All pokemon with attack and speed higher than 90

    • Answer: 10 Rows returned

Exercises 4 - Pairs

Retrieve the following data by querying:

image-20250829112654621

Advanced queries (Optional)

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

  • Answer

  • image-20250829112837420

  • The 10 water pokemon with the highest defence and attack higher than 75

  • Answer

  • image-20250829113051676

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

  • Answer

image-20250829113145280

Last updated