CREATE TABLE city (
ID int NOT NULL AUTO_INCREMENT,
Name char(35) NOT NULL DEFAULT '',
CountryCode char(3) NOT NULL DEFAULT '',
District char(20) NOT NULL DEFAULT '',
Population int NOT NULL DEFAULT '0',
PRIMARY KEY (ID),
KEY CountryCode (CountryCode),
CONSTRAINT city_ibfk_1 FOREIGN KEY (CountryCode) REFERENCES country (Code)
);
INSERT INTO city (
ID, Name, CountryCode, District, Population)
VALUES (
1, 'Kabul', 'AFG', 'Kabol', 1780000);
| ID |
Name |
CountryCode |
District |
Population |
| 1 |
Kabul |
AFG |
Kabol |
1,780,000 |
| 2 |
Qandahar |
AFG |
Qandahar |
237,500 |
| 3 |
Herat |
AFG |
Herat |
186,800 |
| 4 |
Mazar-e-Sharif |
AFG |
Balkh |
127,800 |
| 5 |
Amsterdam |
NLD |
Noord-Holland |
731,200 |
| 6 |
Rotterdam |
NLD |
Zuid-Holland |
593,321 |
| 7 |
Haag |
NLD |
Zuid-Holland |
440,900 |
| 8 |
Utrecht |
NLD |
Utrecht |
234,323 |
| 9 |
Eindhoven |
NLD |
Noord-Brabant |
201,843 |
| ... |
| Download the database for query testing. |