2023.02.14
SQL 자료추출 과정에서 필요한 많은 문법 구문을 배웠다.
select column1, column2
from tableName
where condition
union(all)
select column1, column2
from tableName
where condition
ID : int, not null Key 값
SEASON : int, not null
EPISODE : int, not null
broadcast_date : date
HOST : varchar(32) not null
select table.value1, table.value2...
from tableName
inner join tableName2
on table.value = table2.value -> 두 테이블을 합칠 Key값
select table.value1, table.value2...
from tableName
left join tableName2
on table.value = table2.value -> 두 테이블을 합칠 Key값
select table.value1, table.value2...
from tableName
right join tableName2
on table.value = table2.value -> 두 테이블을 합칠 Key값
select table.value1, table.value2...
from tableName
left join tableName2
on table.value = table2.value -> 두 테이블을 합칠 Key값
union
select table.value1, table.value2...
from tableName
right join tableName2
on table.value = table2.value -> 두 테이블을 합칠 Key값
select table.value1, table.value2, table2.value1....
from table1, table2
where condition -> 두 테이블에 공통값을 조건으로 줌으로써 join 기능
select concat("str1", table.value1...)
from table
where condition
select table.column as "str", concat("str1", column) as "str2"
from tableName as t
where condition
select distinct table.value, table.value2
from tableName
where condition
select table.value, table.value2
from tableName
where condition
order by column (asc or desc)
limit int
끝.