Challenge
The full text of this chapter, to read or revisit. To practise, do the exercises.
▶ Do the exercisesExercise 1 — Codédex mission: Step 1
Professor Pi is building the new Codédex screen and needs your help with the data.
Step 1: write a query that shows the name, type and level of every Codémon — in that order.
-- Step 1: name, type and levelExercise 2 — Codédex mission: Step 2
The headers on the screen must be pretty. Professor Pi wants exactly these three headers: Codémon Name, Element and Lv.
Step 2: rewrite the previous query with aliases for name, type and level. Use c as the table alias. Remember that an alias containing a space needs double quotes.
-- Step 2: pretty headersExercise 3 — Codédex mission: Step 3
Final touch! The Professor wants two computed statistics next to each name.
Step 3: write a query that returns:
1. the name
2. power multiplied by level, named rating
3. the average of power and level with decimals, named average (for Aquachu it should be 45.0)
-- Step 3: rating and average