-
Notifications
You must be signed in to change notification settings - Fork 1
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
1 parent
2e354c4
commit 86283a3
Showing
24 changed files
with
46 additions
and
41 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
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 |
---|---|---|
@@ -1,58 +1,63 @@ | ||
USE mysqldb; | ||
|
||
-- Create database | ||
CREATE DATABASE IF NOT EXISTS mysqldb; | ||
-- Switch to the newly created database | ||
USE mysqldb; | ||
|
||
SELECT DATABASE(); | ||
select user(); | ||
|
||
CREATE TABLE MB_MEMBER( | ||
member_id INT(11) NOT NULL AUTO_INCREMENT, | ||
member_nm VARCHAR(30) NOT NULL, | ||
cell_no VARCHAR(30) NOT NULL, | ||
skin_type VARCHAR(20), | ||
age varchar(3) NOT NULL, | ||
entry_date DATETIME, | ||
addr varchar(100), | ||
addr_detail varchar(200), | ||
CONSTRAINT MB_MEMBER_PK PRIMARY KEY(member_id) | ||
CREATE TABLE IF NOT EXISTS mb_member( | ||
member_id INT(11) NOT NULL AUTO_INCREMENT, | ||
member_nm VARCHAR(30) NOT NULL, | ||
cell_no VARCHAR(30) NOT NULL, | ||
skin_type VARCHAR(20), | ||
age varchar(3) NOT NULL, | ||
entry_date DATETIME, | ||
addr varchar(100), | ||
addr_detail varchar(200), | ||
CONSTRAINT MB_MEMBER_PK PRIMARY KEY(member_id) | ||
); | ||
|
||
select * from MB_MEMBER; | ||
|
||
CREATE TABLE PV_GOODS( | ||
goods_no INT NOT NULL AUTO_INCREMENT, | ||
category VARCHAR(30) NOT NULL, | ||
goods_nm VARCHAR(30) NOT NULL, | ||
sale_price INT not null, | ||
market_price INT not null, | ||
supply_price INT not null, | ||
vendor_id INT not null, | ||
stock_qty INT not null, | ||
brand_nm VARCHAR(20) not null, | ||
image varchar(200), | ||
add_image varchar(200), | ||
sale_start_dtime DATETIME default now(), | ||
sale_end_dtime DATETIME default (DATE_ADD(now(), INTERVAL 1 DAY) - INTERVAL 1 SECOND), | ||
insert_dtime DATETIME default now(), | ||
update_dtime DATETIME DEFAULT now(), | ||
CONSTRAINT PV_GOODS_PK PRIMARY KEY(goods_no) | ||
CREATE TABLE IF NOT EXISTS pv_goods( | ||
goods_no INT NOT NULL AUTO_INCREMENT, | ||
category VARCHAR(30) NOT NULL, | ||
goods_nm VARCHAR(30) NOT NULL, | ||
sale_price INT not null, | ||
market_price INT not null, | ||
supply_price INT not null, | ||
vendor_id INT not null, | ||
stock_qty INT not null, | ||
brand_nm VARCHAR(20) not null, | ||
image varchar(200), | ||
add_image varchar(200), | ||
sale_start_dtime DATETIME default now(), | ||
sale_end_dtime DATETIME default (DATE_ADD(now(), INTERVAL 1 DAY) - INTERVAL 1 SECOND), | ||
insert_dtime DATETIME default now(), | ||
update_dtime DATETIME DEFAULT now(), | ||
CONSTRAINT PV_GOODS_PK PRIMARY KEY(goods_no) | ||
); | ||
|
||
drop table pv_goods; | ||
drop table PV_ITEM; | ||
select (DATE_ADD(now(), INTERVAL 1 DAY) - INTERVAL 1 SECOND); | ||
|
||
SELECT @@global.time_zone; | ||
|
||
CREATE TABLE PV_ITEM( | ||
item_no INT(11) NOT NULL AUTO_INCREMENT, | ||
goods_no INT(11) NOT NULL, | ||
item_nm VARCHAR(30) NOT NULL, | ||
item_qty INT, | ||
insert_dtime DATETIME default now(), | ||
update_dtime DATETIME DEFAULT now(), | ||
CONSTRAINT PV_ITEM_PK PRIMARY KEY(item_no), | ||
foreign key (goods_no) references PV_GOODS(goods_no) | ||
CREATE TABLE IF NOT EXISTS pv_item( | ||
item_no INT(11) NOT NULL AUTO_INCREMENT, | ||
goods_no INT(11) NOT NULL, | ||
item_nm VARCHAR(30) NOT NULL, | ||
item_qty INT, | ||
insert_dtime DATETIME default now(), | ||
update_dtime DATETIME DEFAULT now(), | ||
CONSTRAINT PV_ITEM_PK PRIMARY KEY(item_no), | ||
foreign key (goods_no) references PV_GOODS(goods_no) | ||
); | ||
|
||
commit; | ||
|
||
select * from PV_GOODS; | ||
select * from pv_goods; | ||
select * from pv_item; | ||
select * from pv_goods where goods_no =1; | ||
|
||
|