제로베이스 SQL Chapter4

ningbbang·2023년 4월 30일
0

Zerobase DS13

목록 보기
30/48

Create table

create table celeb
(
id int not null auto_increment primary_key,
name varchar(32) not null default '',
birthday date,
age int,
sex char(1),
job_title varchar(32),
agency varchar(32)
);

not null : 필수값
primary key : 기본키, 유일한 값
auto_increment : 1씩 상승
default 값 : 입력안하면 들어가는 값

Order by

select column1, column2 ---
from tablename
order by column1, column2, --- ASC | DESC;
profile
HR Anaylist!

0개의 댓글