PostgreSQL 7

[Udemy] 15 Days of SQL - Day 6 ① : JOINS(Inner join, Outer join, Left outer join, Right outer join

JOIN : combine information from multiple tables in one query JOIN 5줄 요약 조인은 두 개의 테이블을 서로 묶어서 하나의 결과를 만들어 내는 것을 말한다. INNER JOIN(내부 조인)은 두 테이블을 조인할 때, 두 테이블에 모두 지정한 열의 데이터가 있어야 한다. OUTER JOIN(외부 조인)은 두 테이블을 조인할 때, 1개의 테이블에만 데이터가 있어도 결과가 나온다. CROSS JOIN(상호 조인)은 한쪽 테이블의 모든 행과 다른 쪽 테이블의 모든 행을 조인하는 기능이다. SELF JOIN(자체 조인)은 자신이 자신과 조인한다는 의미로, 1개의 테이블을 사용한다. 1. Inner join Combin the two tables in one que..

Data Science/SQL 2024.03.12

[Udemy] 15 Days of SQL - Day 4 ① : Functions(LENGTH, LOWER, UPPER, LEFT, RIGHT), Concatenate, POSITION, SUBSTRING

1. LOWER & UPPER, LENGTH Syntax SELECT LOWER (email) AS email_lower, email, LENGTH(email) FROM customer WHERE LENGTH(email) < 30 * Challenge Write a query to find customers whose either the first name or the last name is more than 10 characters long. Output the list of these first and last names in all lower case. SELECT LOWER(first_name), LOWER(last_name), LOWER(email) FROM customer WHERE LENGT..

Data Science/SQL 2024.02.20