Introductie tot datamodellering in Snowflake
Nuno Rocha
Director of Engineering







SELECT manufacturer_id,
manufacturer_name,
location,
COUNT(*) AS repetitions
FROM allproducts
GROUP BY manufacturer_id,
manufacturer_name,
location
HAVING COUNT(*) > 1;

SELECT DISTINCT category
FROM allproducts;

SELECT DISTINCT product_name,
category
FROM allproducts
WHERE category = 'L';

SELECT DISTINCT product_name,
category
FROM allproducts
WHERE category = 'L';

SELECT FROM: SQL-clausule om data uit een specifieke entiteit op te halenDISTINCT: SQL-clausule die unieke waarden van een attribuut retourneertCOUNT: SQL-clausule die rijen telt die aan de criteria voldoenGROUP BY: SQL-clausule die rijen groepeert op opgegeven attributenHAVING: SQL-clausule met GROUP BY om groepen te filteren op een voorwaardeWHERE: SQL-clausule om records te filteren op een voorwaardeAS: SQL-clausule om een kolom of tabel een alias te geven-- Unieke waarden opvragen met een specifieke filtervoorwaarde
SELECT DISTINCT column_name
FROM table_name
WHERE column_name condition value;
-- Waarden tellen, geaggregeerd op een kolom en resultaten filteren
SELECT column_name,
COUNT(*) AS alias_name
FROM table_name
GROUP BY column_name
HAVING COUNT(*) condition value;
Introductie tot datamodellering in Snowflake