---
# System prepended metadata

title: db 테이블 생성 및 데이터 삽입

---

# db 테이블 생성 및 데이터 삽입 


## create
```sql
CREATE DATABASE `customer` /*!40100 DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci */ /*!80016 DEFAULT ENCRYPTION='N' */;

-- customer.customer definition

CREATE TABLE `customer` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `engi_name` varchar(1000) DEFAULT NULL,
  `cust_name` varchar(100) DEFAULT NULL,
  `system_info` varchar(100) DEFAULT NULL,
  `manufacture` varchar(100) DEFAULT NULL,
  `model` varchar(100) DEFAULT NULL,
  `serial` varchar(100) DEFAULT NULL,
  `usg` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL,
  `svc_start_date` datetime DEFAULT CURRENT_TIMESTAMP,
  `svc_end_date` datetime DEFAULT CURRENT_TIMESTAMP,
  `regdate` datetime DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=52 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
```


## insert
```sql=
INSERT INTO customer.customer
(id, engi_name, cust_name, system_info, manufacture, model, serial, usg, svc_start_date, svc_end_date, regdate)
VALUES(31, '김나영', '김나영1', '시스템', NULL, NULL, NULL, NULL, '2022-03-30 12:25:59', '2022-03-30 12:25:59', '2022-03-30 12:25:59');
INSERT INTO customer.customer
(id, engi_name, cust_name, system_info, manufacture, model, serial, usg, svc_start_date, svc_end_date, regdate)
VALUES(33, '김나영', '김땡땡', '시스템1', '제조사3', '모델5', NULL, '사용자5', '2022-04-01 17:54:18', '2022-04-01 17:54:18', '2022-04-01 17:54:18');
INSERT INTO customer.customer
(id, engi_name, cust_name, system_info, manufacture, model, serial, usg, svc_start_date, svc_end_date, regdate)
VALUES(34, '김나영', '고드름', '시스템3', '제조사4', '모델6', NULL, NULL, '2022-04-01 17:54:18', '2022-04-01 17:54:18', '2022-04-01 17:54:18');
INSERT INTO customer.customer
(id, engi_name, cust_name, system_info, manufacture, model, serial, usg, svc_start_date, svc_end_date, regdate)
VALUES(35, '김나영', '김나영2', '시스템4', '제조사5', '모델7', NULL, NULL, '2022-04-01 17:54:18', '2022-04-01 17:54:18', '2022-04-01 17:54:18');
INSERT INTO customer.customer
(id, engi_name, cust_name, system_info, manufacture, model, serial, usg, svc_start_date, svc_end_date, regdate)
VALUES(36, '홍길동', '고드름', '시스템5', '제조사6', '모델8', NULL, NULL, '2022-04-01 17:54:18', '2022-04-01 17:54:18', '2022-04-01 17:54:18');
INSERT INTO customer.customer
(id, engi_name, cust_name, system_info, manufacture, model, serial, usg, svc_start_date, svc_end_date, regdate)
VALUES(37, '홍길동', '김나영3', '시스템6', '제조사7', '모델9', NULL, NULL, '2022-04-01 17:54:18', '2022-04-01 17:54:18', '2022-04-01 17:54:18');
INSERT INTO customer.customer
(id, engi_name, cust_name, system_info, manufacture, model, serial, usg, svc_start_date, svc_end_date, regdate)
VALUES(38, '홍길동', '홍두깨', '시스템1', '제조사8', '모델10', NULL, NULL, '2022-04-01 17:54:18', '2022-04-01 17:54:18', '2022-04-01 17:54:18');
INSERT INTO customer.customer
(id, engi_name, cust_name, system_info, manufacture, model, serial, usg, svc_start_date, svc_end_date, regdate)
VALUES(39, '홍길동', '홍두깨', '시스템2', '제조사9', '모델3', NULL, NULL, '2022-04-01 17:54:18', '2022-04-01 17:54:18', '2022-04-01 17:54:18');
INSERT INTO customer.customer
(id, engi_name, cust_name, system_info, manufacture, model, serial, usg, svc_start_date, svc_end_date, regdate)
VALUES(40, '김나영', '백김치', '시스템1', '제조사1', '모델1', '시리얼1', '사용자1', '2022-04-04 09:25:42', '2022-04-04 09:25:42', '2022-04-04 09:25:42');
INSERT INTO customer.customer
(id, engi_name, cust_name, system_info, manufacture, model, serial, usg, svc_start_date, svc_end_date, regdate)
VALUES(41, '김나영', '김칫국', '시스템2', '제조사2', '모델2', '시리얼2', '사용자2', '2022-04-04 09:26:37', '2022-04-04 09:26:37', '2022-04-04 09:26:37');
INSERT INTO customer.customer
(id, engi_name, cust_name, system_info, manufacture, model, serial, usg, svc_start_date, svc_end_date, regdate)
VALUES(42, '김나영', '민들레', '시스템3', '제조사1', '모델1', '시리얼2', '사용자2', '2022-04-04 09:28:09', '2022-04-04 09:28:09', '2022-04-04 09:28:09');
INSERT INTO customer.customer
(id, engi_name, cust_name, system_info, manufacture, model, serial, usg, svc_start_date, svc_end_date, regdate)
VALUES(43, '김나영', '갓김치', '시스템2', '제조사2', '모델2', '시리얼1', '사용자3', '2022-04-04 09:28:09', '2022-04-04 09:28:09', '2022-04-04 09:28:09');
INSERT INTO customer.customer
(id, engi_name, cust_name, system_info, manufacture, model, serial, usg, svc_start_date, svc_end_date, regdate)
VALUES(44, '김나영', '가성비', '시스템4', '제조사3', '모델3', '시리얼3', '사용자4', '2022-04-04 09:28:09', '2022-04-04 09:28:09', '2022-04-04 09:28:09');
INSERT INTO customer.customer
(id, engi_name, cust_name, system_info, manufacture, model, serial, usg, svc_start_date, svc_end_date, regdate)
VALUES(45, '김나영', '김나영2', '시스템5', '제조사4', '모델4', '시리얼4', '사용자2', '2022-04-04 09:28:09', '2022-04-04 09:28:09', '2022-04-04 09:28:09');

```