This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE TABLE user( | |
id integer unique, | |
first_name VARCHAR(50) , | |
last_name VARCHAR(30) , | |
username VARCHAR(100) , | |
password VARCHAR(100) not null , | |
primary key (id) | |
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE TABLE team( | |
id integer unique, | |
name VARCHAR(50) , | |
country VARCHAR(50), | |
primary key (id) | |
); | |
CREATE TABLE car( | |
car_number integer unique, | |
weight integer not null, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- 1. What are the names of countries with population greater than 8 million? | |
SELECT Name , population | |
FROM country | |
WHERE Population > 8000000; | |
-- 2. What are the names of countries that have “land” in their names? | |
SELECT name | |
FROM country | |
WHERE Name LIKE '%land%' ; |