Example SQL Queries - the-engine-room/Malawi-Replication GitHub Wiki
##Quick Intro
SQL is a standard language for accessing databases. We use SQL queries to retrieve information that we have stored previously in our databases (download databases here). Although SQL format and syntax seems complicated, it is pretty easy to understand once you have a basic grasp of what is going on. A tutorial can be found here and a good cheat sheet here.
The keywords used in the examples below:
SELECT ... FROM | LEFT JOIN ... ON | WHERE | NULL | INNER JOIN ... ON | ORDER BY ... ASC/DESC | AND ##Examples
An unpacking of each company involved in a PEL either as an license holder, operator, or minority interest. This would include details on company headquarters, principals, shareholders/directors, links to further information.
-- Some means of making cross links i.e. when a name is linked to two or more companies or has been linked to other companies in the past
-- Information on historic changes of ownership among these companies (going back to 2008 at least) in terms of people but also shareholdings (percentages). Information should be viewable/accessible from various starting points i.e.. PEL, licence block, company, individual, Namibian or foreign etc.
-- Most transparent PELs (i.e where public info is available).
-- Most secretive (Namibian companies that can't be traced at the Registrar of Companies here and those international ones based in offshore tax havens like the Bermudas, Virgin Islands etc)
-- Timeline of a activity in terms of granting of licences and transfers of ownership