TABLE 생성
-- table create
create table sales.promotions(
promotion_id int primary key IDENTITY (1,1),
promotion_name varchar (255) not null,
discount numeric (3,2) default 0,
start_date date not null,
expired_date date not null
);
- IDENTITY(초기값, 증가값) : 레코드가 추가될 때마다 해당 컬럼의 숫자를 자동 증가
Database 확인
select DB_NAME();

Table 삭제
drop table promotions;
Data 삽입
INSERT INTO PROMOTIONS(
PROMOTION_NAME
)
VALUES(
'2025 SUMMER PROMOTION'
);
Data 확인
select * from production.brands; -- table name
use F_Test;
-- 한줄로 처리가 가능하나, 가독성을 위해 한줄로 쓰는 것을 추천
select employee_id, employee_name, birth_date From staff;

Column name 변경
select employee_id, birth_date AS '생년월일'
from staff;

중복 값 제거 후 출력
-- Distinct 중복값 제거
select distinct gender from staff;