Đây là CSDL các loại tiền tệ của tất cả các quốc gia trên thế giới được vinasupport.com tổng hợp được ở dưới định dạng SQL của MySQL Server. Nay mình xin được chia sẻ lại cho các bạn sử dụng.
Tạo bảng CSDL có cấu trúc như sau:
-- -- Table structure for table `wp_currency` -- CREATE TABLE `wp_currency` ( `currency_id` int(11) UNSIGNED NOT NULL, `country` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `currency` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `code` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `symbol` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -- Indexes for dumped tables -- -- -- Indexes for table `wp_currency` -- ALTER TABLE `wp_currency` ADD PRIMARY KEY (`currency_id`); -- -- AUTO_INCREMENT for dumped tables -- -- -- AUTO_INCREMENT for table `wp_currency` -- ALTER TABLE `wp_currency` MODIFY `currency_id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT; COMMIT;
Sau đó chúng ta insert data cho bảng CSDL này
-- Insert currency records INSERT INTO wp_currency (country, currency, code, symbol) VALUES ('Albania', 'Leke', 'ALL', 'Lek'); INSERT INTO wp_currency (country, currency, code, symbol) VALUES ('America', 'Dollars', 'USD', '$'); INSERT INTO wp_currency (country, currency, code, symbol) VALUES ('Afghanistan', 'Afghanis', 'AFN', '؋'); INSERT INTO wp_currency (country, currency, code, symbol) VALUES ('Argentina', 'Pesos', 'ARS', '$'); INSERT INTO wp_currency (country, currency, code, symbol) VALUES ('Aruba', 'Guilders', 'AWG', 'ƒ'); INSERT INTO wp_currency (country, currency, code, symbol) VALUES ('Australia', 'Dollars', 'AUD', '$'); INSERT INTO wp_currency (country, currency, code, symbol) VALUES ('Azerbaijan', 'New Manats', 'AZN', 'ман'); INSERT INTO wp_currency (country, currency, code, symbol) VALUES ('Bahamas', 'Dollars', 'BSD', '$'); INSERT INTO wp_currency (country, currency, code, symbol) VALUES ('Barbados', 'Dollars', 'BBD', '$'); INSERT INTO wp_currency (country, currency, code, symbol) VALUES ('Belarus', 'Rubles', 'BYR', 'p.'); INSERT INTO wp_currency (country, currency, code, symbol) VALUES ('Belgium', 'Euro', 'EUR', '€'); INSERT INTO wp_currency (country, currency, code, symbol) VALUES ('Beliz', 'Dollars', 'BZD', 'BZ$'); INSERT INTO wp_currency (country, currency, code, symbol) VALUES ('Bermuda', 'Dollars', 'BMD', '$'); INSERT INTO wp_currency (country, currency, code, symbol) VALUES ('Bolivia', 'Bolivianos', 'BOB', '$b'); INSERT INTO wp_currency (country, currency, code, symbol) VALUES ('Bosnia and Herzegovina', 'Convertible Marka', 'BAM', 'KM'); INSERT INTO wp_currency (country, currency, code, symbol) VALUES ('Botswana', 'Pula', 'BWP', 'P'); INSERT INTO wp_currency (country, currency, code, symbol) VALUES ('Bulgaria', 'Leva', 'BGN', 'лв'); INSERT INTO wp_currency (country, currency, code, symbol) VALUES ('Brazil', 'Reais', 'BRL', 'R$'); INSERT INTO wp_currency (country, currency, code, symbol) VALUES ('Britain (United Kingdom)', 'Pounds', 'GBP', '£'); INSERT INTO wp_currency (country, currency, code, symbol) VALUES ('Brunei Darussalam', 'Dollars', 'BND', '$'); INSERT INTO wp_currency (country, currency, code, symbol) VALUES ('Cambodia', 'Riels', 'KHR', '៛'); INSERT INTO wp_currency (country, currency, code, symbol) VALUES ('Canada', 'Dollars', 'CAD', '$'); INSERT INTO wp_currency (country, currency, code, symbol) VALUES ('Cayman Islands', 'Dollars', 'KYD', '$'); INSERT INTO wp_currency (country, currency, code, symbol) VALUES ('Chile', 'Pesos', 'CLP', '$'); INSERT INTO wp_currency (country, currency, code, symbol) VALUES ('China', 'Yuan Renminbi', 'CNY', '¥'); INSERT INTO wp_currency (country, currency, code, symbol) VALUES ('Colombia', 'Pesos', 'COP', '$'); INSERT INTO wp_currency (country, currency, code, symbol) VALUES ('Costa Rica', 'Colón', 'CRC', '₡'); INSERT INTO wp_currency (country, currency, code, symbol) VALUES ('Croatia', 'Kuna', 'HRK', 'kn'); INSERT INTO wp_currency (country, currency, code, symbol) VALUES ('Cuba', 'Pesos', 'CUP', '₱'); INSERT INTO wp_currency (country, currency, code, symbol) VALUES ('Cyprus', 'Euro', 'EUR', '€'); INSERT INTO wp_currency (country, currency, code, symbol) VALUES ('Czech Republic', 'Koruny', 'CZK', 'Kč'); INSERT INTO wp_currency (country, currency, code, symbol) VALUES ('Denmark', 'Kroner', 'DKK', 'kr'); INSERT INTO wp_currency (country, currency, code, symbol) VALUES ('Dominican Republic', 'Pesos', 'DOP ', 'RD$'); INSERT INTO wp_currency (country, currency, code, symbol) VALUES ('East Caribbean', 'Dollars', 'XCD', '$'); INSERT INTO wp_currency (country, currency, code, symbol) VALUES ('Egypt', 'Pounds', 'EGP', '£'); INSERT INTO wp_currency (country, currency, code, symbol) VALUES ('El Salvador', 'Colones', 'SVC', '$'); INSERT INTO wp_currency (country, currency, code, symbol) VALUES ('England (United Kingdom)', 'Pounds', 'GBP', '£'); INSERT INTO wp_currency (country, currency, code, symbol) VALUES ('Euro', 'Euro', 'EUR', '€'); INSERT INTO wp_currency (country, currency, code, symbol) VALUES ('Falkland Islands', 'Pounds', 'FKP', '£'); INSERT INTO wp_currency (country, currency, code, symbol) VALUES ('Fiji', 'Dollars', 'FJD', '$'); INSERT INTO wp_currency (country, currency, code, symbol) VALUES ('France', 'Euro', 'EUR', '€'); INSERT INTO wp_currency (country, currency, code, symbol) VALUES ('Ghana', 'Cedis', 'GHC', '¢'); INSERT INTO wp_currency (country, currency, code, symbol) VALUES ('Gibraltar', 'Pounds', 'GIP', '£'); INSERT INTO wp_currency (country, currency, code, symbol) VALUES ('Greece', 'Euro', 'EUR', '€'); INSERT INTO wp_currency (country, currency, code, symbol) VALUES ('Guatemala', 'Quetzales', 'GTQ', 'Q'); INSERT INTO wp_currency (country, currency, code, symbol) VALUES ('Guernsey', 'Pounds', 'GGP', '£'); INSERT INTO wp_currency (country, currency, code, symbol) VALUES ('Guyana', 'Dollars', 'GYD', '$'); INSERT INTO wp_currency (country, currency, code, symbol) VALUES ('Holland (Netherlands)', 'Euro', 'EUR', '€'); INSERT INTO wp_currency (country, currency, code, symbol) VALUES ('Honduras', 'Lempiras', 'HNL', 'L'); INSERT INTO wp_currency (country, currency, code, symbol) VALUES ('Hong Kong', 'Dollars', 'HKD', '$'); INSERT INTO wp_currency (country, currency, code, symbol) VALUES ('Hungary', 'Forint', 'HUF', 'Ft'); INSERT INTO wp_currency (country, currency, code, symbol) VALUES ('Iceland', 'Kronur', 'ISK', 'kr'); INSERT INTO wp_currency (country, currency, code, symbol) VALUES ('India', 'Rupees', 'INR', 'Rp'); INSERT INTO wp_currency (country, currency, code, symbol) VALUES ('Indonesia', 'Rupiahs', 'IDR', 'Rp'); INSERT INTO wp_currency (country, currency, code, symbol) VALUES ('Iran', 'Rials', 'IRR', '﷼'); INSERT INTO wp_currency (country, currency, code, symbol) VALUES ('Ireland', 'Euro', 'EUR', '€'); INSERT INTO wp_currency (country, currency, code, symbol) VALUES ('Isle of Man', 'Pounds', 'IMP', '£'); INSERT INTO wp_currency (country, currency, code, symbol) VALUES ('Israel', 'New Shekels', 'ILS', '₪'); INSERT INTO wp_currency (country, currency, code, symbol) VALUES ('Italy', 'Euro', 'EUR', '€'); INSERT INTO wp_currency (country, currency, code, symbol) VALUES ('Jamaica', 'Dollars', 'JMD', 'J$'); INSERT INTO wp_currency (country, currency, code, symbol) VALUES ('Japan', 'Yen', 'JPY', '¥'); INSERT INTO wp_currency (country, currency, code, symbol) VALUES ('Jersey', 'Pounds', 'JEP', '£'); INSERT INTO wp_currency (country, currency, code, symbol) VALUES ('Kazakhstan', 'Tenge', 'KZT', 'лв'); INSERT INTO wp_currency (country, currency, code, symbol) VALUES ('Korea (North)', 'Won', 'KPW', '₩'); INSERT INTO wp_currency (country, currency, code, symbol) VALUES ('Korea (South)', 'Won', 'KRW', '₩'); INSERT INTO wp_currency (country, currency, code, symbol) VALUES ('Kyrgyzstan', 'Soms', 'KGS', 'лв'); INSERT INTO wp_currency (country, currency, code, symbol) VALUES ('Laos', 'Kips', 'LAK', '₭'); INSERT INTO wp_currency (country, currency, code, symbol) VALUES ('Latvia', 'Lati', 'LVL', 'Ls'); INSERT INTO wp_currency (country, currency, code, symbol) VALUES ('Lebanon', 'Pounds', 'LBP', '£'); INSERT INTO wp_currency (country, currency, code, symbol) VALUES ('Liberia', 'Dollars', 'LRD', '$'); INSERT INTO wp_currency (country, currency, code, symbol) VALUES ('Liechtenstein', 'Switzerland Francs', 'CHF', 'CHF'); INSERT INTO wp_currency (country, currency, code, symbol) VALUES ('Lithuania', 'Litai', 'LTL', 'Lt'); INSERT INTO wp_currency (country, currency, code, symbol) VALUES ('Luxembourg', 'Euro', 'EUR', '€'); INSERT INTO wp_currency (country, currency, code, symbol) VALUES ('Macedonia', 'Denars', 'MKD', 'ден'); INSERT INTO wp_currency (country, currency, code, symbol) VALUES ('Malaysia', 'Ringgits', 'MYR', 'RM'); INSERT INTO wp_currency (country, currency, code, symbol) VALUES ('Malta', 'Euro', 'EUR', '€'); INSERT INTO wp_currency (country, currency, code, symbol) VALUES ('Mauritius', 'Rupees', 'MUR', '₨'); INSERT INTO wp_currency (country, currency, code, symbol) VALUES ('Mexico', 'Pesos', 'MXN', '$'); INSERT INTO wp_currency (country, currency, code, symbol) VALUES ('Mongolia', 'Tugriks', 'MNT', '₮'); INSERT INTO wp_currency (country, currency, code, symbol) VALUES ('Mozambique', 'Meticais', 'MZN', 'MT'); INSERT INTO wp_currency (country, currency, code, symbol) VALUES ('Namibia', 'Dollars', 'NAD', '$'); INSERT INTO wp_currency (country, currency, code, symbol) VALUES ('Nepal', 'Rupees', 'NPR', '₨'); INSERT INTO wp_currency (country, currency, code, symbol) VALUES ('Netherlands Antilles', 'Guilders', 'ANG', 'ƒ'); INSERT INTO wp_currency (country, currency, code, symbol) VALUES ('Netherlands', 'Euro', 'EUR', '€'); INSERT INTO wp_currency (country, currency, code, symbol) VALUES ('New Zealand', 'Dollars', 'NZD', '$'); INSERT INTO wp_currency (country, currency, code, symbol) VALUES ('Nicaragua', 'Cordobas', 'NIO', 'C$'); INSERT INTO wp_currency (country, currency, code, symbol) VALUES ('Nigeria', 'Nairas', 'NGN', '₦'); INSERT INTO wp_currency (country, currency, code, symbol) VALUES ('North Korea', 'Won', 'KPW', '₩'); INSERT INTO wp_currency (country, currency, code, symbol) VALUES ('Norway', 'Krone', 'NOK', 'kr'); INSERT INTO wp_currency (country, currency, code, symbol) VALUES ('Oman', 'Rials', 'OMR', '﷼'); INSERT INTO wp_currency (country, currency, code, symbol) VALUES ('Pakistan', 'Rupees', 'PKR', '₨'); INSERT INTO wp_currency (country, currency, code, symbol) VALUES ('Panama', 'Balboa', 'PAB', 'B/.'); INSERT INTO wp_currency (country, currency, code, symbol) VALUES ('Paraguay', 'Guarani', 'PYG', 'Gs'); INSERT INTO wp_currency (country, currency, code, symbol) VALUES ('Peru', 'Nuevos Soles', 'PEN', 'S/.'); INSERT INTO wp_currency (country, currency, code, symbol) VALUES ('Philippines', 'Pesos', 'PHP', 'Php'); INSERT INTO wp_currency (country, currency, code, symbol) VALUES ('Poland', 'Zlotych', 'PLN', 'zł'); INSERT INTO wp_currency (country, currency, code, symbol) VALUES ('Qatar', 'Rials', 'QAR', '﷼'); INSERT INTO wp_currency (country, currency, code, symbol) VALUES ('Romania', 'New Lei', 'RON', 'lei'); INSERT INTO wp_currency (country, currency, code, symbol) VALUES ('Russia', 'Rubles', 'RUB', 'руб'); INSERT INTO wp_currency (country, currency, code, symbol) VALUES ('Saint Helena', 'Pounds', 'SHP', '£'); INSERT INTO wp_currency (country, currency, code, symbol) VALUES ('Saudi Arabia', 'Riyals', 'SAR', '﷼'); INSERT INTO wp_currency (country, currency, code, symbol) VALUES ('Serbia', 'Dinars', 'RSD', 'Дин.'); INSERT INTO wp_currency (country, currency, code, symbol) VALUES ('Seychelles', 'Rupees', 'SCR', '₨'); INSERT INTO wp_currency (country, currency, code, symbol) VALUES ('Singapore', 'Dollars', 'SGD', '$'); INSERT INTO wp_currency (country, currency, code, symbol) VALUES ('Slovenia', 'Euro', 'EUR', '€'); INSERT INTO wp_currency (country, currency, code, symbol) VALUES ('Solomon Islands', 'Dollars', 'SBD', '$'); INSERT INTO wp_currency (country, currency, code, symbol) VALUES ('Somalia', 'Shillings', 'SOS', 'S'); INSERT INTO wp_currency (country, currency, code, symbol) VALUES ('South Africa', 'Rand', 'ZAR', 'R'); INSERT INTO wp_currency (country, currency, code, symbol) VALUES ('South Korea', 'Won', 'KRW', '₩'); INSERT INTO wp_currency (country, currency, code, symbol) VALUES ('Spain', 'Euro', 'EUR', '€'); INSERT INTO wp_currency (country, currency, code, symbol) VALUES ('Sri Lanka', 'Rupees', 'LKR', '₨'); INSERT INTO wp_currency (country, currency, code, symbol) VALUES ('Sweden', 'Kronor', 'SEK', 'kr'); INSERT INTO wp_currency (country, currency, code, symbol) VALUES ('Switzerland', 'Francs', 'CHF', 'CHF'); INSERT INTO wp_currency (country, currency, code, symbol) VALUES ('Suriname', 'Dollars', 'SRD', '$'); INSERT INTO wp_currency (country, currency, code, symbol) VALUES ('Syria', 'Pounds', 'SYP', '£'); INSERT INTO wp_currency (country, currency, code, symbol) VALUES ('Taiwan', 'New Dollars', 'TWD', 'NT$'); INSERT INTO wp_currency (country, currency, code, symbol) VALUES ('Thailand', 'Baht', 'THB', '฿'); INSERT INTO wp_currency (country, currency, code, symbol) VALUES ('Trinidad and Tobago', 'Dollars', 'TTD', 'TT$'); INSERT INTO wp_currency (country, currency, code, symbol) VALUES ('Turkey', 'Lira', 'TRY', 'TL'); INSERT INTO wp_currency (country, currency, code, symbol) VALUES ('Turkey', 'Liras', 'TRL', '£'); INSERT INTO wp_currency (country, currency, code, symbol) VALUES ('Tuvalu', 'Dollars', 'TVD', '$'); INSERT INTO wp_currency (country, currency, code, symbol) VALUES ('Ukraine', 'Hryvnia', 'UAH', '₴'); INSERT INTO wp_currency (country, currency, code, symbol) VALUES ('United Kingdom', 'Pounds', 'GBP', '£'); INSERT INTO wp_currency (country, currency, code, symbol) VALUES ('United States of America', 'Dollars', 'USD', '$'); INSERT INTO wp_currency (country, currency, code, symbol) VALUES ('Uruguay', 'Pesos', 'UYU', '$U'); INSERT INTO wp_currency (country, currency, code, symbol) VALUES ('Uzbekistan', 'Sums', 'UZS', 'лв'); INSERT INTO wp_currency (country, currency, code, symbol) VALUES ('Vatican City', 'Euro', 'EUR', '€'); INSERT INTO wp_currency (country, currency, code, symbol) VALUES ('Venezuela', 'Bolivares Fuertes', 'VEF', 'Bs'); INSERT INTO wp_currency (country, currency, code, symbol) VALUES ('Vietnam', 'Dong', 'VND', '₫'); INSERT INTO wp_currency (country, currency, code, symbol) VALUES ('Yemen', 'Rials', 'YER', '﷼'); INSERT INTO wp_currency (country, currency, code, symbol) VALUES ('Zimbabwe', 'Zimbabwe Dollars', 'ZWD', 'Z$'); INSERT INTO wp_currency (country, currency, code, symbol) VALUES ('India', 'Rupees', 'INR', '₹');
Lấy dữ liệu currency
-- Select values from table SELECT * FROM currency;