-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathschema.sql
More file actions
20 lines (18 loc) · 797 Bytes
/
schema.sql
File metadata and controls
20 lines (18 loc) · 797 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
-- =============================================================
-- Section 4 — Mathematical Operators and Functions
-- =============================================================
-- Reuses the cars dataset shape (same as section 11) so you can
-- focus on applying arithmetic and math functions, not learning a
-- new domain. Own schema means nothing collides with section 11.
-- =============================================================
DROP SCHEMA IF EXISTS sqlf_math CASCADE;
CREATE SCHEMA sqlf_math;
SET search_path TO sqlf_math;
CREATE TABLE cars (
id INTEGER,
brand VARCHAR(50) NOT NULL,
model VARCHAR(50) NOT NULL,
price NUMERIC(10, 2) NOT NULL,
mileage INTEGER NOT NULL,
is_electric BOOLEAN NOT NULL
);