AS

컬럼 별칭 설정

연습문제 1-7

SELECT 
  id as prodcut_id,
  category as prodcut_category, 
  name as prodcut_name, 
  retail_price as prodcut_price, 
  cost as prodcut_cost,
  retail_price-cost as prodcut_profit
FROM `thelook_ecommerce.products`

테이블 별칭 설정

select 
  id,
  name
from `thelook_ecommerce.products` as a;

LIMIT

데이터 개수 제한 하기

select 
  id,
  name
from `thelook_ecommerce.products` as a
limit 3; # 3개만 불러와짐

중복제거 distinct

SELECT distinct category
from `thelook_ecommerce.products`
select distinct country, city
from `thelook_ecommerce.users`

결과를 다운받기

Untitled

데이터 탐색

Untitled