Exploratory Data Analysis ใน SQL
Christina Maimone
Data Scientist
Primary key: ไม่ซ้ำกัน และไม่เป็น NULL
Unique: ค่าต้องไม่ซ้ำกัน ยกเว้น NULL
Not null: ไม่อนุญาตให้เป็น NULL ต้องมีค่าเสมอ
Check constraints: กำหนดเงื่อนไขสำหรับค่าในคอลัมน์
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;
Exploratory Data Analysis ใน SQL