Objetives
-- Structure
SELECT fields
FROM table_name
GROUP BY fieldSELECT COUNT(week_id)
FROM days
GROUP BY week_id;SELECT
director,
count(title) AS titles
FROM movies
GROUP BY director;-- Structure
SELECT fields
FROM table_name
GROUP BY field
HAVING conditionSELECT count(week_id)
FROM days
GROUP BY week_id
HAVING count(week_id) > 2SELECT
director,
count(title) AS titles
FROM movies
GROUP BY director
HAVING movies > 1SELECT
director,
count(title) AS titles
FROM movies
WHERE NOT director = "Pete Docter"
GROUP BY director
HAVING movies > 1Normalization is the process of organizing data in a database.
Remove repeated groups from individual tables.
Create a separate table for each set of related data.
Identify each set of related data with a primary key
Create separate tables for sets of values that apply to multiple records.
Relate these tables with a foreign key.
Delete the fields that do not depend on the key.