Eksploracyjna analiza danych w SQL
Christina Maimone
Data Scientist
Klucz główny: unikalny, nie NULL
Unique: wszystkie wartości muszą być różne, z wyjątkiem NULL
Not null: NULL niedozwolone: pole musi mieć wartość
Ograniczenia CHECK: warunki dotyczące wartości
column1 > 0columnA > columnBPodstawowe
Specjalne


Format
-- With the CAST function
SELECT CAST (value AS new_type);
Przykłady
-- 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;
Przykłady
-- Cast 3.7 as an integer
SELECT 3.7::integer;
-- Cast a column called total as an integer
SELECT total::integer
FROM prices;
Eksploracyjna analiza danych w SQL