-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathebike_data.sql
29 lines (27 loc) · 1.29 KB
/
ebike_data.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
create table if not exists bikes (
id serial primary key,
name varchar(100) not null,
warranty_status char(10),
image bytea,
model varchar(50) not null,
price int not null,
date_created timestamp not null default CURRENT_TIMESTAMP
)
create table if not exists service_user (
id serial primary key,
fullname varchar(150) not null,
username varchar(50) not null,
email varchar(75) not null,_
user_role varchar(50) not null,
password varchar(75) not null,
date_created timestamp not null default CURRENT_TIMESTAMP
)
create table if not exists bike_order (
id serial primary key,
date_created timestamp not null default CURRENT_TIMESTAMP,
product_id int not null,
customer_id int not null,
price int not null,
constraint fk_customer foreign key(customer_id) references service_user(id),
constraint fk_product foreign key(product_id) references bikes(id)
)