연두색연필
LimePencil's Log
연두색연필
전체 방문자
오늘
어제

About Me

  • GitHub
  • Instagram
  • Gmail

인기 글

  • 분류 전체보기 (70)
    • Machine Learning (3)
      • MNIST (2)
    • PS & Algorithm (9)
    • Web (4)
      • HTML (1)
      • JavaScript (3)
    • Rust (2)
      • The Rust Programming Langua.. (2)
    • 논문 리뷰 (12)
      • Reinforcement Learning (10)
      • Computer Vision (2)
    • DevOps (17)
      • Docker (9)
      • Kubernetes (8)
    • Development (6)
      • SQL (6)
    • 잡다한 것들 (15)
      • 부스트캠프 AI Tech 4기 (13)

최근 댓글

Tag

  • 백준
  • Kubernetes
  • docker
  • 파이썬
  • 도커
  • K8s
  • Python
  • ML
  • 부스트캠프
  • 쿠버네티스
01-20 22:16
hELLO · Designed By 정상우.
연두색연필

LimePencil's Log

[SQL 배우기] Section 5. JOINS
Development/SQL

[SQL 배우기] Section 5. JOINS

2024. 3. 12. 01:00

The Complete SQL Bootcamp for the Manipulation and Analysis of Data | Udemy

 

AS: creates an alias for a column to be called into a different name

  • SELECT column AS new_name FROM table
  • we cannot use an alias inside the WHERE operator because it gets executed at the very end of a query
  • useful for renaming the output of the aggregate function

JOIN: allows to combine multiple tables

  • main reason for different JOIN types is to decide how to deal with information only present in one of the joined tables

INNER JOIN: result with the set of records that match in both tables

  • SELECT * FROM tableA INNER JOIN tableB ON tableA.col_match = tableB.col_match
  • symmetrical
  • matching column is a duplicate column
  • in PostgreSQL, JOIN = INNER JOIN

FULL OUTER JOIN: set of records that are in either or both of the tables

  • SELECT * FROM tableA FULL OUTER JOIN tableB ON tableA.col_match = tableB.col_match
  • Symmetrical
  • filling empty values with null
  • using WHERE can be used to filter null columns

LEFT OUTER JOIN: set of records that are in the left table, and values that are not in the right table are considered null

  • SELECT * FROM tableA LEFT JOIN tableB ON tableA.col_match = tableB.col_match
  • Order matters

 

RIGHT OUTER JOIN: set of records that are in the right table, and values that are not in the left table are considered null

  • SELECT * FROM tableA RIGHT JOIN tableB ON tableA.col_match = tableB.col_match
  • Order matters

 

UNION: concatenating two tables together

  • SELECT column_names FROM table1 UNION SELECT column_names FROM table2
  • should match in length

'Development > SQL' 카테고리의 다른 글

[SQL 배우기] Section 8. Creating Databases and Tables  (1) 2024.03.12
[SQL 배우기] Section 6. Advanced SQL Commands  (0) 2024.03.12
[SQL 배우기] Section 3. GROUP BY Statements  (0) 2024.03.12
[SQL 배우기] Section 2. SQL Statement Fundamentals  (0) 2024.03.12
[SQL 배우기] Section 1. Course Introduction  (0) 2024.03.12
    'Development/SQL' 카테고리의 다른 글
    • [SQL 배우기] Section 8. Creating Databases and Tables
    • [SQL 배우기] Section 6. Advanced SQL Commands
    • [SQL 배우기] Section 3. GROUP BY Statements
    • [SQL 배우기] Section 2. SQL Statement Fundamentals
    연두색연필
    연두색연필
    ML, Programming, PS, 삶의 순간을 기록

    티스토리툴바