我可以在哪里下载PostgreSQL的Northwind数据库?
答
如果你真的想要那个特定的一个,你可以从抢罗斯文的PostgreSQL的端口DbLinq单元测试数据集。请参阅http://groups.google.com/group/dblinq/web/unit-tests,了解如何做到这一点。
答
我能够从
http://www.antepedia.com/detail/p/48023267.html
专门
下载(PostgreSQL的)Northwind数据库已废弃: http://northwindextended.googlecode.com/files/northwind.postgre.sql]
[更新时间:Oct 2016] https://code.google.com/archive/p/northwindextended/downloads
加载/访问数据库:
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
该数据库使用(例如)在这个优秀的在线教程(我跳过前面几页,第一页是提到它):
的dbsamples页被删除psql的命令获得罗斯文数据库创建脚本。哪里? – 42n4 2015-04-28 09:48:27
是的,页面不再存在了 – Fra 2016-04-04 17:37:58