Google Data Analytics #5_SQL Basic

Andy Oh Sae Ha·2022년 6월 24일
0

[Google] Data Analytics

목록 보기
5/15
post-thumbnail

SQL

  • SQL (Structured Query Language)
    - Query : a request for data or information from a database

Basic Format

  • SELECT
  • FROM
  • WHERE
  • GROUP BY
  • HAVING
  • ORDER BY

SELECT

  • is required in every query
  • used to choose the columns you want to retrieve

FROM

  • is required in every query
  • used to choose the table you want to retrieve

WHERE

  • is not required in every query
  • used to filter information by giving the query conditions

GROUP BY

  • is not required in every query
  • used to group

HAVING

  • is not required in every query
  • used to give conditions over GROUP BY

ORDER BY

  • is not required in every query
  • used to sort the data by certain conditions

Example

  SELECT *
    FROM movie_list
   WHERE genre = 'Horror'
GROUP BY pg
ORDER BY rating

Translation

= RetrieveSELECT all * columns
FROM the table called movie_list
which WHERE is under 'Horror'.
Then group them GROUP BY PG
and order them by ORDER BY highest ranking to lowest

profile
데이터 분석가

0개의 댓글