-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
39 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
-- DDL for product (mysql) | ||
-- DB : warehouse_system | ||
|
||
-- create database warehouse_system; | ||
|
||
CREATE TABLE IF NOT EXISTS product( | ||
id int PRIMARY KEY AUTO_INCREMENT, | ||
name varchar(100) not null, | ||
type_id int not null, | ||
price int not null, | ||
product_status varchar(1) not null, | ||
constraint FK_PRODUCT_TYPE FOREIGN KEY (type_id) references product_type(type_id) | ||
); | ||
|
||
-- DML | ||
INSERT INTO product(name, type_id, price, product_status) | ||
VALUES | ||
("i-phone", 2, 300, "0"), | ||
("cookie", 4, 10, "0"), | ||
("soap", 1, 50, "0"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
-- DDL for product_type (mysql) | ||
-- DB : warehouse_system | ||
|
||
-- create database warehouse_system; | ||
|
||
CREATE TABLE IF NOT EXISTS product_type( | ||
|
||
type_id int PRIMARY KEY AUTO_INCREMENT, | ||
type_name varchar(30) not null | ||
); | ||
|
||
-- DML | ||
INSERT INTO product_type(type_name) | ||
values | ||
("fmcg"), | ||
("mobile"), | ||
("hardware"), | ||
("food"); |