Esiste un database Postgres scaricabile contenente dati fittizi? preferibilmente Northwind, qualcosa che posso praticare le mie idee di queryDove posso scaricare il database Northwind per Postgresql?
risposta
Ci sono una serie di database di esempio disponibile come progetto pgFoundry a http://pgfoundry.org/projects/dbsamples/
Se si vuole veramente che uno specifico, è possibile prendere un porto PostgreSQL di Northwind dal Set di dati di test dell'unità DbLinq. Vedere http://groups.google.com/group/dblinq/web/unit-tests per note un po 'approssimative su come farlo.
sono stato in grado di scaricare il database Northwind (per PostgreSQL) dal
http://www.antepedia.com/detail/p/48023267.html
specificamente
[deprecato: http://northwindextended.googlecode.com/files/northwind.postgre.sql]
[aggiornamento: Oct 2016:] https://code.google.com/archive/p/northwindextended/downloads
carico/accesso al database:
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
Questo database viene utilizzato (ad esempio) in questo eccellente, esercitazione in linea (ho saltato davanti a un paio di pagine, la prima pagina che lo cita):
Le altre due risposte sembrano obsolete.
È possibile ottenere northwind script di creazione db da this link
interrogazione Run utilizzando PG admin o comando psql
La pagina dbsamples viene rimosso. Dove? – 42n4
Sì, la pagina non c'è più – Fra