Skip to content

Instantly share code, notes, and snippets.

View MishaShevchenko's full-sized avatar

Misha Shevchenko MishaShevchenko

View GitHub Profile
@MishaShevchenko
MishaShevchenko / DESIGN.md
Created June 28, 2024 18:52
Attractions BEL,NLD

Design Document - "Tourism Database"

Scope

Purpose

The purpose of this database is to facilitate the management and exploration of tourist attractions, events, cities, and countries, primarily focusing on Belgium and the Netherlands. It aims to provide users with information about attractions and events in these countries, allowing them to make informed decisions about places to visit.

In Scope

-- 1. What are the names of countries with population greater than 8 million?
SELECT Name
FROM country
WHERE Population > 8000000;
-- 2. What are the names of countries that have “land” in their names?
SELECT name from city where name like "%land";
-- 3. What are the names of the cities with population in between 500,000 and 1 million?
SELECT name from city where Population > 500000 and Population < 1000000;
-- 1. What are the names of countries with population greater than 8 million?
SELECT Name
FROM country
WHERE Population > 8000000;
-- 2. What are the names of countries that have “land” in their names?
SELECT name from city where name like "%land";
-- 3. What are the names of the cities with population in between 500,000 and 1 million?
SELECT name from city where Population > 500000 and Population < 1000000;
select name from city where Population > 8000000;
select name from city where name like "%land";
select name from city where Population > 500000 and Population < 1000000;
select name from country where Continent = "Europe";
select name from city where CountryCode = 'nld';
select Population from city where name = 'rotterdam';
select * from country where HeadOfState is null;
select name, population from city limit 10;
select * from country where name = LocalName and Continent = 'Africa';
select country.name from country join countrylanguage on country.code = countrylanguage.CountryCode where countrylanguage.`Language` = 'Spanish';