Перейти к содержимому
TelegramGitHub

Продвинутый SQL

Четвёртый уровень. Вы чистите данные, пишете подзапросы и оконные функции, читаете план запроса.

Нужны знания из уровней Основы и Средний уровень. Описание таблиц: Учебные данные.

Решайте сами, без AI.

1 N 1 N 1 N tutorial.crunchbase_acquisitions company_permalink text company_name text acquirer_name text acquired_at text acquired_year bigint price_amount double price_currency_code text … ещё 13 ст. tutorial.crunchbase_acquisitions_clean_date company_permalink text acquired_at text acquired_at_cleaned timestamp … ещё 18 ст. tutorial.crunchbase_investments company_permalink text company_name text investor_permalink text investor_name text investor_country_code text funding_round_type text funded_at text funded_year bigint raised_amount_usd double … ещё 11 ст. tutorial.crunchbase_investments_part1 Компании A–L Те же столбцы, что у crunchbase_investments tutorial.crunchbase_investments_part2 Компании M–Z Те же столбцы, что у crunchbase_investments tutorial.worldwide_earthquakes magnitude text year_2000 bigint year_2001 bigint year_2012 bigint … ещё 10 ст. tutorial.crunchbase_companies permalink text name text category_code text funding_total_usd bigint status text country_code text state_code text founded_at text founded_year bigint … ещё 8 ст. tutorial.crunchbase_companies_clean_date permalink text founded_at text founded_at_clean text … ещё 15 ст. tutorial.sf_crime_incidents_2014_01 incidnt_num bigint category text descript text day_of_week text date text time text resolution text lon double lat double … ещё 4 ст. tutorial.sf_crime_incidents_cleandate incidnt_num bigint date text time text cleaned_date timestamp … ещё 10 ст. tutorial.dc_bikeshare_q1_2012 duration_seconds int start_time timestamp start_station text start_terminal int end_time timestamp end_station text end_terminal int rider_type text … ещё 3 ст. benn.sample_event_table event_id int user_id int event_date date event_name text device text benn.college_football_teams division text conference text school_name text roster_url text id int benn.college_football_players full_school_name text school_name text player_name text position text height int weight int year text hometown text state text id int

Как читать схему. Линия — связь для JOIN, подписи 1 и N — число строк с каждой стороны. Выделенный столбец — ключ соединения. Пунктир — представление (view): оно показывает часть данных основной таблицы. Таблицы без линий не связаны с остальными. Показаны главные столбцы широких таблиц. Полный список столбцов: Учебные данные.

  1. Типы данных
  2. Формат дат и времени
  3. Подготовка данных (data wrangling)
  4. Строковые функции
  5. Подзапросы
  6. Оконные функции
  7. Скорость запросов
  8. Сводные таблицы (PIVOT)