-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdb_1.sql
80 lines (61 loc) · 1.71 KB
/
db_1.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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
create database ecom_18.22.2182;
use ecom_18.22.2182;
CREATE table tbl_admin(
id_admin int primary key auto_increment,
username varchar(50) not null,
password varchar(50) not null,
nama varchar(50),
email varchar(50)
);
create table tbl_kategori(
id_kategori int primary key auto_increment,
nama_kategori varchar(50)
);
create table tbl_biaya_kirim(
id_biaya_kirim int primary key auto_increment,
kota varchar(50),
biaya int(10)
);
create table tbl_merek(
id_merek int primary key auto_increment,
nama_merek varchar(50)
);
create table tbl_member(
id_member int primary key auto_increment,
username varchar(50) not null,
password varchar(50) not null,
nama varchar(50) not null,
alamat varchar(50) not null,
email varchar(50) not null,
no_hp varchar(50) not null
);
create table tbl_produk(
id_produk int primary key auto_increment,
id_kategori_produk int not null,
id_merek int not null,
nama_produk varchar(100) not null,
deskripsi text,
harga int not null,
gambar varchar(100),
slide char(1),
rekomendasi char(1),
FOREIGN KEY(id_kategori_produk) references tbl_kategori(id_kategori),
foreign key(id_merek) references tbl_merek(id_merek)
);
create table tbl_order(
id_order int primary key auto_increment,
status_order char(1) not null,
tanggal_order date not null,
jam_order time not null,
id_member int not null,
foreign key(id_member) references tbl_member(id_member)
);
create table tbl_detail_order(
id_detail_order int primary key auto_increment,
id_order int not null,
id_produk int not null,
jumlah int not null,
harga int not null,
foreign key(id_order) references tbl_order(id_order),
foreign key(id_produk) references tbl_produk(id_produk)
);