forked from exercism/sqlite
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathintro-select.sql
More file actions
33 lines (28 loc) · 915 Bytes
/
intro-select.sql
File metadata and controls
33 lines (28 loc) · 915 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
25
26
27
28
29
30
31
32
33
CREATE TABLE all_data AS
-- Task 1. Select all records.
SELECT * FROM weather_readings
;
CREATE TABLE location_and_temperature AS
-- Task 2. Select only location and temperature data.
-- Expect failure
SELECT temperature FROM weather_readings
;
CREATE TABLE seattle AS
-- Task 3. Select all data for Seattle.
SELECT * FROM weather_readings WHERE location = 'Seattle'
;
CREATE TABLE limited_humidity AS
-- Task 4. Select all data where the humidity is between 60% and 70%.
-- Expect failure
SELECT * FROM weather_readings WHERE humidity BETWEEN 50 AND 62
;
.print "My debugging output:"
SELECT humidity from weather_readings;
CREATE TABLE location AS
-- Task 5. Select only location data.
SELECT location FROM weather_readings
;
CREATE TABLE unique_location AS
-- Task 5. Select only unique location data.
SELECT DISTINCT location FROM weather_readings
;