Data types & Scales
Data represented in a computer
Data types
Data scales
Meta data
Preparation:
Data Literacy Fundamentals, Ben Jones, Ch: 3,4
1. What will the following query return?
SELECT `name`, hp
FROM pokemon
WHERE hp >= 100A) 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
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:
Find all Ground-type Pokémon (primary OR secondary) that have speed greater than 80.
Answer 3 Rows returned
The name of all pokemon with a special defence less than 56 and a special attack higher than 65
Answer: 14 Rows returned
All grass type (either primary or secondary) pokemon starting with the letter 'B'
Answer: 2 Rows returned
All fire (primary) pokemon with an attack higher than 50
Answer: 11 Rows returned
All fire (only primary) or ground (both primary and secondary) pokemon with an attak higher than 50
Answer: 23 Rows returned
The fastest 10 pokemon ordered by their speed
Answer

Advanced queries (Optional)
All pokemon without a secondary type, starting with 'P' with an attack or defence above 40
Answer

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

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

Last updated