- 현재 DB 자료_store
create user 'root'@'localhost' identified by'1234';
GRANT ALL PRIVILEGES ON store.* To'root'@'localhost';
FLUSH PRIVILEGES;
CREATE DATABASE store;
use store;
show variables like 'c%';
drop user 'root'@'localhost';
create table product_tb(
id int auto_increment primary key,
name varchar(20) not null unique,
price int not null,
qty int not null,
created_at timestamp not null
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
select * from product_tb;
INSERT INTO product_tb(name, price, qty, created_at) VALUES('딸기', 1000, 100, NOW());
INSERT INTO product_tb(name, price, qty, created_at) VALUES('복숭아', 2000, 100, NOW());
INSERT INTO product_tb(name, price, qty, created_at) VALUES('수박', 3000, 90, NOW());
INSERT INTO product_tb(name, price, qty, created_at) VALUES('포도', 2000, 80, NOW());
INSERT INTO product_tb(name, price, qty, created_at) VALUES('살구', 1500, 150, NOW());
create table buyer_tb(
id int auto_increment primary key,
buyername varchar(20) not null,
password varchar(20) not null,
email varchar(30) not null,
created_at timestamp not null
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
select * from buyer_tb;
drop table buyer_tb;
INSERT INTO buyer_tb(buyername, password, email, created_at) VALUES('ssar','1234','ssar@nate.com',NOW());
INSERT INTO buyer_tb(buyername, password, email, created_at) VALUES('cos', '1234', 'cos@nate.com', NOW());
INSERT INTO buyer_tb(buyername, password, email, created_at) VALUES('love', '1234', 'love@nate.com', NOW());
INSERT INTO buyer_tb(buyername, password, email, created_at) VALUES('zal', '1234', 'zal@nate.com', NOW());
INSERT INTO buyer_tb(buyername, password, email, created_at) VALUES('hae', '1234', 'hae@nate.com', NOW());
select * from purchase_tb;
INSERT INTO purchase_tb(buyername, name, price, qty, buyer_id, email, password, product_id, pur_qty, created_at)
VALUES
('ssar', '딸기', 1000, 100, 1, 'ssar@nate.com', '1234', 1, 10, NOW()),
('cos', '복숭아', 2000, 100, 2, 'cos@nate.com', '1234', 2, 10, NOW()),
('love', '수박', 3000, 90, 3, 'love@nate.com', '1234', 3, 10, NOW()),
('zal', '포도', 2000, 80, 4, 'zal@nate.com', '1234', 4, 10, NOW()),
('hae', '살구', 1500, 150, 5, 'hae@nate.com', '1234', 5, 10, NOW())
;
- market_로그인 시도
- 들어가기 전
-mysql : store와 연결
- 지금까지 서버와 연결이 잘 되어 있는지 확인

수정/삭제/등록 잘 됨 / 목록

- 회원가입 구현
- 로그인 구현하면 될 듯!
Share article