Coder Social home page Coder Social logo

leonardwoo / sql-utility-data Goto Github PK

View Code? Open in Web Editor NEW

This project forked from olivr/sql-utility-data

0.0 1.0 0.0 57 KB

General utility data in relational SQL format for countries, languages, currencies (ISO 3166-1, UN M49, ISO 639-1, ISO 4217)

License: Apache License 2.0

SQL 99.85% PLpgSQL 0.15%

sql-utility-data's Introduction

SQL Utility Data

This is a clean relational data set for regions (UN M49), countries (ISO 3166-1, UN M49), languages (ISO 639-1) and currencies (ISO 4217) to be used in your project.

Tested with PostgreSQL 14

Why use this one over other data sets available on GitHub?

  • Up to date as of the date of the last commit
  • Manually checked for errors
  • Relational mappings
  • PostgreSQL compatibility
  • Supports countries with multiple currencies

Import it

psql postgres --file=sql/1-init-schema.sql
psql postgres --file=sql/2-Region.sql
psql postgres --file=sql/3-Country.sql
psql postgres --file=sql/4-Currency.sql
psql postgres --file=sql/5-CountryCurrency.sql
psql postgres --file=sql/6-Language.sql
psql postgres --file=sql/7-CountryLanguage.sql

Examples

All countries with their respective region

SELECT c.*,
       r.name AS region_name
FROM   utility.country c
       INNER JOIN utility.region r
               ON ( c.region_id = r.id );

All official languages of South Africa

SELECT *
FROM   utility.country_language cl
       INNER JOIN utility.language l
               ON ( cl.language_id = l.id )
WHERE  cl.country_id = 'ZA';

All countries with French as an official language

SELECT *
FROM   utility.country_language cl
       INNER JOIN utility.country c
               ON ( cl.country_id = c.id )
WHERE  cl.language_id = 'fr';

All official currencies of Panama

SELECT *
FROM   utility.country_currency cc
       INNER JOIN utility.currency c
               ON ( cc.currency_id = c.id )
WHERE  cc.country_id = 'PA'  

sql-utility-data's People

Contributors

politician avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.