Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>I was able to download the Northwind Database (for PostgreSQL) from</p> <p><a href="http://www.antepedia.com/detail/p/48023267.html" rel="nofollow">http://www.antepedia.com/detail/p/48023267.html</a></p> <p>specifically </p> <p>[ deprecated: <s><a href="http://northwindextended.googlecode.com/files/northwind.postgre.sql" rel="nofollow">http://northwindextended.googlecode.com/files/northwind.postgre.sql</a></s> ]</p> <p>[ updated: Oct 2016: ] <a href="https://code.google.com/archive/p/northwindextended/downloads" rel="nofollow">https://code.google.com/archive/p/northwindextended/downloads</a></p> <p>Loading/accessing the database:</p> <pre><code>sudo -u postgres psql ## or: sudo su postgres postgres=# \i northwind.postgre.sql; postgres=# \d List of relations Schema | Name | Type | Owner --------+----------------------+-------+---------- public | categories | table | postgres public | customercustomerdemo | table | postgres public | customerdemographics | table | postgres public | customers | table | postgres public | employees | table | postgres public | employeeterritories | table | postgres public | order_details | table | postgres public | orders | table | postgres public | products | table | postgres public | region | table | postgres public | shippers | table | postgres public | shippers_tmp | table | postgres public | suppliers | table | postgres public | territories | table | postgres public | usstates | table | postgres (15 rows) postgres=# \d customers; Table "public.customers" Column | Type | Modifiers --------------+-----------------------+----------- CustomerID | bpchar | not null CompanyName | character varying(40) | not null ContactName | character varying(30) | ContactTitle | character varying(30) | Address | character varying(60) | City | character varying(15) | Region | character varying(15) | PostalCode | character varying(10) | Country | character varying(15) | Phone | character varying(24) | Fax | character varying(24) | Indexes: "pk_customers" PRIMARY KEY, btree ("CustomerID") # Note the following query error: postgres=# SELECT DISTINCT City FROM customers ORDER BY City; ERROR: column "city" does not exist LINE 1: SELECT DISTINCT City FROM customers ORDER BY City; ^ # ... use use double-quotes if your column name # (etc.) contains some uppercase characters: postgres=# SELECT DISTINCT "City" FROM customers ORDER BY "City"; City ----------------- Aachen Albuquerque Anchorage Århus Barcelona [ ... snip! ... ] Tsawassen Vancouver Versailles Walla Walla Warszawa </code></pre> <p>This database is used (e.g.) in this excellent, online tutorial (I skipped ahead a few pages, to the first page that mentions it):</p> <p><a href="http://www.w3schools.com/sql/sql_syntax.asp" rel="nofollow">http://www.w3schools.com/sql/sql_syntax.asp</a></p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload