-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathday-01.sql
More file actions
24 lines (21 loc) · 712 Bytes
/
day-01.sql
File metadata and controls
24 lines (21 loc) · 712 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
-- SQL Advent Calendar - Day 1
-- Title: Reindeer Run - Find the Top 7
-- Difficulty: easy
--
-- Question:
-- Every year, the city of Whoville conducts a Reindeer Run to find the best reindeers for Santa's Sleigh. Write a query to return the name and rank of the top 7 reindeers in this race.
--
-- Every year, the city of Whoville conducts a Reindeer Run to find the best reindeers for Santa's Sleigh. Can you write a query to return the name and rank of the top 7 reindeers in this race?
--
-- Table Schema:
-- Table: reindeer_run_results
-- number: INTEGER
-- name: VARCHAR
-- rank: INTEGER
-- color: VARCHAR
--
-- My Solution:
select name, rank
from reindeer_run_results
order by rank ASC
limit 7