Где я могу скачать базу данных Northwind для PostgreSQL?

StackOverflow https://stackoverflow.com/questions/2585643

  •  24-09-2019
  •  | 
  •  

Вопрос

Есть ли загружаемые почтовые базы данных, которые содержат фиктивные данные? Предпочтительно северно, что я могу практиковать свои идеи запроса

Это было полезно?

Решение

Существует ряд образцов баз данных, доступных в качестве проекта PGFOUDRY AT http://pgfoundry.org/projects/dbsamples/

Другие советы

Я смог загрузить базу данных Northwind (для PostgreSQL) из

http://www.antepedia.com/detail/p/48023267.html.

конкретно

Устарено:http://northwindexted.googlecode.com/files/northwind.postgre.sql. ]

Обновлено: окт 2016:https://code.google.com/Archive/p/northwindexted/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

Эта база данных используется (например,) в этом превосходном онлайн-руководстве (я пропустил впереди несколько страниц, на первую страницу, которая их упоминает):

http://www.w3schools.com/sql/sql_syntax.asp.

Две остальные ответы, похоже, устарели.

Вы можете получить скрипт создания DB Northwind от эта ссылка

Запустите запрос с помощью PG Admin или CSQL Command

Если вы действительно хотите, чтобы этот конкретный, вы можете взять на себя PostgreSQL-порт Northwind из набора данных тестового теста DBLINQ. Видеть http://groups.google.com/group/dblinq/web/unit-tests. Для несколько схематичных заметок о том, как это сделать.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top