β€» 이 글은 μ½”λ“œν”„λ ˆμ†Œ μ²΄ν—˜λ‹¨ ν™œλ™μ„ ν•˜λ©΄μ„œ λ§Œλ“€μ–΄μ‘ŒμŠ΅λ‹ˆλ‹€.
β€» 처음 μ‹œμž‘ν•˜λŠ” SQL ν”„λ‘œκ·Έλž˜λ° κ°•μ˜μž…λ‹ˆλ‹€.
β€» μ½”λ“œν”„λ ˆμ†Œ λ°”λ‘œκ°€κΈ°

SQL λͺ…λ Ήμ–΄λ₯Ό μ΄μš©ν•œ λ°μ΄ν„°μ˜ 쑰회

OREDER BYλͺ…λ Ήμ–΄λ₯Ό μ΄μš©ν•œ λ°μ΄ν„°μ˜ μ •λ ¬

select *
from orderItem
order by order_num ASC, quantity DESC;

LIMIT,OFFSETλͺ…λ Ήμ–΄λ₯Ό μ΄μš©ν•œ λ°μ΄ν„°μ˜ μ œν•œ

select *
from products
order by prod_price DESC limit 3;

INμ—°μ‚°μžλ₯Ό μ΄μš©ν•œ 데이터 필터링

select *
from customers
where cust_state in ('MI','OH');

BETEWEEN μ—°μ‚°μžλ₯Ό μ΄μš©ν•œ 데이터 필터링

select *
from orders
where order_num between 20006 and 20008;

LIKE μ—°μ‚°μžλ₯Ό μ΄μš©ν•œ 데이터 필터링

select *
from vendors
where vend_name like 'B%';

DISTINCT λͺ…λ Ήμ–΄λ₯Ό μ΄μš©ν•œ 쀑볡 데이터 제거

select distinct
vend_country
from vendors;

NULL VALUE의 데이터 처리

select *
from customers
where cust_country is null;

AS λͺ…λ Ήμ–΄λ₯Ό μ΄μš©ν•œ λ°μ΄ν„°μ˜ 별칭

select cust_name as customerName
from customers;

profile
μž˜ν•΄ 보겠닀!

0개의 λŒ“κΈ€