-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathschema_and_data.sql
More file actions
34 lines (29 loc) · 920 Bytes
/
schema_and_data.sql
File metadata and controls
34 lines (29 loc) · 920 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
34
-- Schema and sample data for Application Support SQL Project
-- This file creates the customers and orders tables and inserts sample data.
--Drop table statements
DROP TABLE IF EXISTS orders;
DROP TABLE IF EXISTS customers;
--Create table statements
CREATE TABLE customers (
customer_id INT PRIMARY KEY,
customer_name VARCHAR(100),
region VARCHAR(50)
);
CREATE TABLE orders (
order_id INT PRIMARY KEY,
customer_id INT,
order_date DATE,
amount DECIMAL(10,2),
status VARCHAR(20)
);
--Insert statements
INSERT INTO customers VALUES
(1, 'Ashley Smith', 'East'),
(2, 'Jordan Lee', 'West'),
(3, 'Taylor Green', 'South');
INSERT INTO orders VALUES
(101, 1, '2024-01-01', 120.00, 'Completed'),
(102, 2, '2024-01-02', 9999.99, 'Completed'),
(103, 4, '2024-01-03', 50.00, 'Completed'),
(104, 2, '2024-01-04', -10.00, 'Completed'),
(105, 3, '2024-01-05', 0.00, 'Pending');