728x90
[교재 SQL 스크립트] 실전_ch1-1-2-product&payment.sql
USE mydb;
CREATE TABLE product(
product_no VARCHAR(4),
product_name VARCHAR(20),
price INT
);
CREATE TABLE payment (
payment_no VARCHAR(8),
member_id VARCHAR(10),
product_no VARCHAR(4)
);
INSERT INTO product
VALUES ('S100', '미니선풍기', 3500);
INSERT INTO product
VALUES ('S101', '행운목', 2000);
INSERT INTO product
VALUES ('S102', '야광텀블러', 6500);
INSERT INTO product
VALUES ('S103', '포도당캔디', 3000);
INSERT INTO product
VALUES ('S104', '아로마오일', 10000);
INSERT INTO payment
VALUES ('24010101', 'tree25', 'S100');
INSERT INTO payment
VALUES ('24010102', 'sky1004', 'S100');
INSERT INTO payment
VALUES ('24010103', 'frog555', 'S102');
INSERT INTO payment
VALUES ('24010104', 'cup14', 'S103');
INSERT INTO payment
VALUES ('24010105', 'tree25', 'S104');
INSERT INTO payment
VALUES ('24010106', 'phone99', 'S104');
INSERT INTO payment
VALUES ('24010107', 'bear1070', 'S102');
COMMIT;
728x90
'MySQL' 카테고리의 다른 글
내일은 SQL(응용 실전편) 실전_ch1-2-1-member_info.sql (0) | 2024.05.20 |
---|---|
내일은 SQL(응용 실전편) 실전_ch1-1-3-departments&employees.sql (0) | 2024.05.20 |
내일은 SQL(응용 실전편) 실전_ch1-1-1-student&winner_list.sql (0) | 2024.05.20 |
(Workbench) SSH 터널링으로 DB서버 접속(pem키가 있을 때) (2) | 2022.03.16 |
Dbeaver에서 로컬DB에 접속 못하는 현상 해결 (0) | 2022.02.11 |