MySQL

내일은 SQL(응용 실전편) 실전_ch1-1-3-departments&employees.sql

쿠카이든 2024. 5. 20. 13:50
728x90
[교재 SQL 스크립트] 실전_ch1-1-3-departments&employees.sql
USE mydb;

CREATE TABLE departments(
    department_id INT,
    department_name VARCHAR(30)
);

CREATE TABLE employees(
    employee_id INT,
    employee_name VARCHAR(20),
    salary INT,
    department_id INT
);

INSERT INTO departments
VALUES (10, '데이터분석팀');
INSERT INTO departments
VALUES (20, 'DB기술팀');
INSERT INTO departments
VALUES (30, '클라우드팀');
INSERT INTO departments
VALUES (40, 'AI팀');
INSERT INTO departments
VALUES (50, '시스템개발팀');

INSERT INTO employees
VALUES (100, '이익준', 9000, 10);
INSERT INTO employees
VALUES (101, '안정원', 8000, 20);
INSERT INTO employees
VALUES (102, '김준완', 8500, 30);
INSERT INTO employees
VALUES (103, '양석형', 7000, 40);
INSERT INTO employees
VALUES (104, '채송화', 9000, 50);
INSERT INTO employees
VALUES (105, '장겨울', 6000, 10);
INSERT INTO employees
VALUES (106, '종세혁', 7200, 20);
INSERT INTO employees
VALUES (107, '황지우', 6500, 30);
INSERT INTO employees
VALUES (108, '김건', 7500, 40);
INSERT INTO employees
VALUES (109, '최세훈', 6000, 50);

COMMIT;
728x90