forked from foofx88/ETL-Financing-Used-Cars
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTable_schema.sql
34 lines (29 loc) · 1.19 KB
/
Table_schema.sql
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
-- Table schema for car_loans
-- initialise table
--all data for the table are imported via Python using .to_sql() method
DROP TABLE car_loans;
CREATE TABLE car_loans
(
index VARCHAR NOT NULL PRIMARY KEY,
name VARCHAR NOT NULL,
price DOUBLE PRECISION NOT NULL,
deposit DOUBLE PRECISION NOT NULL,
"loan amount" DOUBLE PRECISION NOT NULL,
"seller monthly repayment" DOUBLE PRECISION NOT NULL,
"Plenti Car Loan" DOUBLE PRECISION NOT NULL,
"Loans.com.au - New and Dealer Used Car Loan" DOUBLE PRECISION NOT NULL,
"Credit Concierge Car Loan" DOUBLE PRECISION NOT NULL,
"Wisr Secured Car Loan" DOUBLE PRECISION NOT NULL,
"NAB Personal Loan Unsecured Fixed " DOUBLE PRECISION NOT NULL,
"OurMoneyMarket Car Loan" DOUBLE PRECISION NOT NULL,
"SocietyOne Car Loan" DOUBLE PRECISION NOT NULL,
"NRMA Used Car Loan" DOUBLE PRECISION NOT NULL,
"Symple Loans Personal Loan" DOUBLE PRECISION NOT NULL,
"RACV Used Car Loans" DOUBLE PRECISION NOT NULL,
"Macquarie Car Loan For " DOUBLE PRECISION NOT NULL
);
--checking if all values are imported into tables
SELECT * FROM car_loans;
--filter cars by price over $15000
SELECT * FROM car_loans
WHERE price > 15000;