SQL을 활용한 탐색적 데이터 분석
Christina Maimone
Data Scientist
기본 키: 고유, NULL 아님
고유: NULL을 제외한 모든 값이 달라야 함
Not null: NULL 금지: 값이 있어야 함
제약 확인: 값에 대한 조건
column1 > 0columnA > columnB일반
특수


형식
-- With the CAST function
SELECT CAST (value AS new_type);
예시
-- Cast 3.7 as an integer
SELECT CAST (3.7 AS integer);
4
-- Cast a column called total as an integer
SELECT CAST (total AS integer)
FROM prices;
형식
-- With :: notation
SELECT value::new_type;
예시
-- Cast 3.7 as an integer
SELECT 3.7::integer;
-- Cast a column called total as an integer
SELECT total::integer
FROM prices;
SQL을 활용한 탐색적 데이터 분석