SQL: AQSh va Kanadadagi shtatlar va viloyatlarning to'liq ismini qidirish

Shimoliy Amerika

Ushbu hafta oxiri Google Xaritalar loyihasida ishlayotganda, men jadval tuzishim kerak edi MySQL 2 xonali davlat va shtat qisqartmalarini to'liq ismga tarjima qilgan. Ishonchim komilki, bu juda zarur bo'lgan narsa, shuning uchun men SQL faylini yuklab olish uchun serverimga qo'ydim.

AQSh va Kanada uchun shtat va viloyat qisqartmalari uchun SQL bayonoti. Shuningdek, ishlashni yaxshilash uchun mamlakat va davlat identifikatorlari bo'yicha indeks qo'shdim.

CREATE TABLE `holatlari '(` COUNTRYID` varchar (2) NULL EMAS, `STATEID` varchar (2) NOT NULL,` FULLNAME` varchar (30) NOT NULL, KEY `country` (` COUNTRYID`), KEY ʻid` (`STATEID`)) ENGINE = MyISAM DEFAUL CHARSET = utf8 COMMENT = 'AQSh va Kanadada shtat va viloyatning to'liq ismini izlash';
INSERT INTO `shtatlari` (` COUNTRYID`, `STATEID`, 'FULLNAME`) VALUES (' CA ',' AB ',' Alberta '), (' CA ',' BC ',' British Columbia '), (' CA ',' MB ',' Manitoba '), (' CA ',' NB ',' New Brunswick '), (' CA ',' NL ',' Newfoundland and Labrador '), (' CA ',' NS ',' Nova Scotia '), (' CA ',' NT ',' Northwest Territories '), (' CA ',' NU ',' Nunavut '), (' CA ',' ON ',' Ontario ') , ('CA', 'PE', 'Prince Edward Island'), ('CA', 'QC', 'Quebec'), ('CA', 'SK', 'Saskatachewan'), ('CA', 'YT', 'Yukon'), ('US', 'AK', 'Alaska'), ('US', 'AL', 'Alabama'), ('US', 'AR', 'Arkansas') , ('US', 'AZ', 'Arizona'), ('US', 'CA', 'California'), ('US', 'CO', 'Colorado'), ('US', 'CT ',' Connecticut '), (' US ',' DC ',' Columbia District '), (' US ',' DE ',' Delaware '), (' US ',' FL ',' Florida ') , ('US', 'GA', 'Georgia'), ('US', 'HI', 'Hawaii'), ('US', 'IA', 'Ayova'), ('US', 'ID ',' Aydaho '), (' US ',' IL ',' Illinois '), (' US ',' IN ',' Indiana '), (' US ',' KS ',' Kanzas '), ( 'US', 'KY', 'Kentukki'), ('US', 'LA', 'Luiziana'), ('US', 'MA', 'Massachusetts'), ('US', 'MD', Mar yland '), (' US ',' ME ',' Men '), (' US ',' MI ',' Michigan '), (' US ',' MN ',' Minnesota '), (' US ' , 'MO', 'Missuri'), ('US', 'MS', 'Mississippi'), ('US', 'MT', 'Montana'), ('US', 'NC', 'North Carolina '), (' US ',' ND ',' North Dakota '), (' US ',' NE ',' Nebraska '), (' US ',' NH ',' New Hampshire '), (' US ',' NJ ',' New Jersey '), (' US ',' NM ',' New Mexico '), (' US ',' NV ',' Nevada '), (' US ',' NY ', 'Nyu-York'), ('US', 'OH', 'Ogayo'), ('US', 'OK', 'Oklahoma'), ('US', 'OR', 'Oregon'), (' AQSh ',' PA ',' Pensilvaniya '), (' US ',' RI ',' Rod-Aylend '), (' US ',' SC ',' South Carolina '), (' US ',' SD ' , 'Janubiy Dakota'), ('US', 'TN', 'Tennessee'), ('US', 'TX', 'Texas'), ('US', 'UT', 'Utah'), ( 'US', 'VA', 'Virginia'), ('US', 'VI', 'Virgin Islands'), ('US', 'VT', 'Vermont'), ('US', 'WA' , 'Vashington'), ('US', 'WI', 'Viskonsin'), ('US', 'WV', 'West Virginia'), ('US', 'WY', 'Вайoming');

Shlyapa uchi CSV yaxshi bo'lgan Brayan Men ishlashga muvaffaq bo'ldim.

Siz nima deb o'ylaysiz?

Ushbu sayt spamni kamaytirish uchun Akismet-dan foydalanadi. Fikringiz ma'lumotlarining qanday ishlashini bilib oling.