Analisis Data Eksploratif di SQL
Christina Maimone
Data Scientist
Primary key: unik, bukan NULL
Unique: semua nilai harus berbeda kecuali NULL
Not null: NULL tidak boleh: harus ada nilai
Check constraints: kondisi pada nilai
column1 > 0columnA > columnBUmum
Khusus


Format
-- With the CAST function
SELECT CAST (value AS new_type);
Contoh
-- 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;
Format
-- With :: notation
SELECT value::new_type;
Contoh
-- Cast 3.7 as an integer
SELECT 3.7::integer;
-- Cast a column called total as an integer
SELECT total::integer
FROM prices;
Analisis Data Eksploratif di SQL