0% found this document useful (0 votes)
237 views10 pages

Data Dictionary - Northwind

Uploaded by

lmlubowa
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
237 views10 pages

Data Dictionary - Northwind

Uploaded by

lmlubowa
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 10

Northwind | Data dictionary

Background
The Northwind database is a sample database used by Microsoft in various educational resources and
documentation for demonstrating and teaching database concepts and SQL (Structured Query
Language).

The Northwind database represents a fictional company's data and is designed to showcase various
aspects of database management, including tables for products, customers, orders, employees,
suppliers, and more. Some common tables and entities you can find in the Northwind database
include:

● Customers: Information about the company's customers.


● Employees: Details about the company's employees.
● Orders: Records of customer orders.
● OrderDetails: Information about the individual items included in each order.
● Products: Information about the products the company sells.
● Suppliers: Data about the suppliers of the company's products.

This database is often used as a practical example to demonstrate SQL queries and database design
principles. It's not intended for real-world business use but serves as a useful teaching and learning
resource for those studying database management and SQL. If you're looking to practice SQL queries
or learn about database concepts, you can find the Northwind database readily available for use in
various database management systems and development environments.

Data model
The Northwind database provides a classic example of a relational database model, as seen in Figure 1.
Here are some key characteristics and observations about the data model of the Northwind database:

● Tables: The database is organised into multiple tables, each representing a specific entity or
concept, such as customers, orders, products, employees, suppliers, and more. This follows the
principles of a relational data model, where data is stored in structured tables.

● Primary keys: Each table typically has a primary key column (e.g., CustomerID, EmployeeID,
OrderID) that uniquely identifies each record within that table. Primary keys are used to establish
relationships between tables.

● Foreign keys: Relationships between tables are established using foreign key columns (e.g.,
CustomerID in the Orders table), which reference the primary key columns in related tables.
These foreign keys create associations between records in different tables, allowing for data
retrieval and analysis across tables.

● Data types: Different data types are used to store various types of information, including
integers (INT), characters (CHAR, VARCHAR), dates and times (DATETIME), and more. This
allows for efficient storage and retrieval of diverse data.

The data model, including the column names, data types, feature descriptions, and their constraints,
such as whether or not the feature requires a value for every row (marked as NOT NULL) or the type of
key, is included in Table 1.
Figure 1: The ERD for the Northwind database
Table 1: The data model for the Northwind database.

Customers table

This table stores information related to individual customers, including their identification and contact
details.

Column name Data type Feature description Constraints

Unique identifier for each customer,


CustomerID VARCHAR(5) Primary key
often used to relate to other tables.

The official name of the company to


CompanyName VARCHAR(40) NOT NULL
which the customer belongs.

The full name of the individual who is


ContactName VARCHAR(30) the main point of contact at the
customer's company.

The professional job title of the


ContactTitle VARCHAR(30) contact person within the customer's
company.

The full street address where the


Address VARCHAR(60)
customer or their company is located.

The city in which the customer or


City VARCHAR(15)
their company is located.

The region in which the customer or


Region VARCHAR(15)
their company is located.

The postal or ZIP code associated


PostalCode VARCHAR(10)
with the customer's address.

The country where the customer's


Country VARCHAR(15)
company is situated.

The primary phone number used to


Phone VARCHAR(24)
reach the customer.

The facsimile (fax) number for the


Fax VARCHAR(24)
customer.
Orders table

This table holds records of all orders made by customers, along with references to the customers and
employees involved.

Column name Data type Feature description Constraints

A unique identifier assigned to each


OrderID INT Primary key
order transaction.

Identifier that links the order to a


Foreign key
CustomerID VARCHAR(5) specific customer in the Customers
(Customers)
table.

An identifier that indicates which


Foreign key
EmployeeID INT employee is responsible for managing
(Employees)
the order.

The date on which the order was


OrderDate DATETIME
formally placed.

The date on which the order in the


RequiredDate DATETIME
delivery is required to be delivered.

The date on which the ordered goods


ShippedDate DATETIME
were shipped to the customer.

Identifier for the shipping method, Foreign key


ShipVia INT
linking to the Shippers table. (Shippers)

The cost associated with shipping the


Freight DECIMAL(10, 4)
ordered goods.

The name of the recipient or


ShipName VARCHAR(40) organisation to which the order is
being shipped.

The street address or delivery


ShipAddress VARCHAR(60)
location for the shipment.

The city where the shipment is being


ShipCity VARCHAR(15)
delivered.

The region or state within the delivery


ShipRegion VARCHAR(15)
destination (if applicable).

The postal code or ZIP code of the


ShipPostalCode VARCHAR(10)
delivery address.

The country where the shipment is


ShipCountry VARCHAR(15)
being delivered.
Employees table

This table contains details about company employees, including personal information and job-related
data.

Column name Data type Feature description Constraints

Unique identifier assigned to each


EmployeeID INT Primary key
employee within the company.

The last name or surname of the


LastName VARCHAR(20) NOT NULL
employee.

The first name or given name of the


FirstName VARCHAR(10) NOT NULL
employee.

The job title or position held by the


Title VARCHAR(30)
employee within the company.

The courtesy title or honorific for


TitleOfCourtesy VARCHAR(25) addressing an employee (e.g., Mr.,
Mrs., Dr.).

The date of birth of the employee,


BirthDate DATE
often used for HR purposes.

The date on which the employee


HireDate DATE
joined the company.

The street address of the employee's


Address VARCHAR(60)
residence or workplace.

The city where the employee lives or


City VARCHAR(15)
works.

The geographical region or state


Region VARCHAR(15) where the employee resides (if
applicable).

The postal code or ZIP code of the


PostalCode VARCHAR(10)
employee's address.

The country where the employee is


Country VARCHAR(15)
located.

The employee's personal or home


HomePhone VARCHAR(24)
telephone number.

Extension VARCHAR(4) The internal phone extension number


for the employee within the
organisation.

Additional notes or comments related


Notes MEDIUMTEXT to the employee, often used for NOT NULL
miscellaneous information.

The identifier of another employee to Foreign key


ReportsTo INT
whom this employee reports. (Employees)

The file path or location where the


PhotoPath VARCHAR(255)
employee's photo is stored.

The monetary compensation or salary


Salary FLOAT associated with the employee's
position.

Products table

This table stores information related to the various products that the company sells.

Column name Data type Feature description Constraints

Unique identifier for each product


ProductID INT Primary key
item.

ProductName VARCHAR(40) The descriptive name of the product. NOT NULL

Identifier that connects the product Foreign key


SupplierID INT
to its supplier. (Suppliers)

Identifier that categorises the product Foreign key


CategoryID INT
into a specific type or group. (Categories)

A description of how a product is


packaged or sold, indicating the
QuantityPerUnit VARCHAR(20)
number of units per package (e.g., "12
bottles per case").

The selling price per unit of the


UnitPrice DECIMAL(10, 4)
product.

The number of units currently


UnitsInStock SMALLINT
available in stock.

The quantity of this product that has


UnitsOnOrder SMALLINT been ordered but not yet received in
inventory.
The minimum inventory level at which
ReorderLevel SMALLINT it is recommended to reorder this
product to ensure stock availability.

A binary indicator (0 or 1) that shows


whether the product is still available
Discontinued BIT(1) NOT NULL
for sale (1 for available, 0 for
discontinued).

Suppliers table

This table holds information about suppliers, who provide the products that the company sells.

Column name Data type Feature description Constraints

SupplierID INT Unique identifier for each supplier. Primary key

The formal name of the supplier's


CompanyName VARCHAR(40) NOT NULL
company.

The name of the primary point of


ContactName VARCHAR(30)
contact at the supplier's company.

The job title of the contact person at


ContactTitle VARCHAR(30)
the supplier's company.

The full street address of the


Address VARCHAR(60)
supplier's business location.

City VARCHAR(15) The city where the supplier is located.

The geographical region or state


Region VARCHAR(15) where the supplier is situated (if
applicable).

The postal code or ZIP code of the


PostalCode VARCHAR(10)
supplier's location.

The country in which the supplier is


Country VARCHAR(15)
based.

The contact telephone number for the


Phone VARCHAR(24)
supplier.

The facsimile (fax) number for the


Fax VARCHAR(24)
supplier.

The supplier's website or homepage


HomePage MEDIUMTEXT
URL, if available.
Categories table

This table contains different categories under which the products are grouped.

Column name Data type Feature description Constraints

Unique identifier for each product


CategoryID INT Primary key
category.

The name that represents the type or


CategoryName VARCHAR(15) NOT NULL
group of the product.

A textual description that provides


Description MEDIUMTEXT additional information about the
category.

The images or binary data related to


Picture LONGBLOB the category, such as
category-specific pictures or icons.

OrderDetails table

This table serves as a junction between Orders and Products, holding the specifics about products
within each order.

Column name Data type Feature description Constraints

Composite
Identifier for the order to which the primary key,
OrderID INT
product belongs. foreign key
(Orders)

Composite
Identifier for the specific product primary key,
ProductID INT
within the order. foreign key
(Products)

The per-unit cost of the product at


UnitPrice DECIMAL(10,4) NOT NULL
the time the order was placed.

The number of units of the product


Quantity SMALLINT NOT NULL
that were ordered.

The percentage of discount applied


to an individual product within an
Discount DOUBLE(8,0) NOT NULL
order, indicating the reduction in price
for that specific item.
Shippers table

This table contains information about shipping companies or entities responsible for delivering orders,
including their names, phone numbers, and other relevant details.

Column name Data type Feature description Constraints

Unique identifier assigned to each


ShipperID INT shipping company or shipper within Primary key
the database.

The name of the shipping company or


CompanyName VARCHAR(40) shipper responsible for delivering NOT NULL
orders.

The contact telephone number for the


Phone VARCHAR(24)
shipping company or shipper.

CustomerDemographics table

This table includes additional demographic information or characteristics about customers, allowing
for segmentation and analysis of customer profiles within a database.

Column name Data type Feature description Constraints

Unique identifier or code representing


CustomerTypeID VARCHAR(10) a specific customer demographic Primary key
type or category.

A textual description or additional


details describing the characteristics
CustomerDesc MEDIUMTEXT or attributes associated with a
particular customer demographic
type.

Region table

This table contains information about geographical regions or areas, such as states or provinces,
which can be used to categorise and organise data based on geographic location within the
database.

Column name Data type Feature description Constraints

Unique identifier or code assigned to


RegionID INT each geographical region or area Primary key
within the database.
A textual description or name that
RegionDescription VARCHAR(50) provides information about the NOT NULL
specific geographical region or area.

Territories table

This table is used to define and manage specific sales territories within a region or area, allowing for
effective sales management and organisation.

Column name Data type Feature description Constraints

Unique identifier or code assigned to


each sales territory, enabling precise
TerritoryID VARCHAR(20) Primary key
tracking and management of sales
regions.

A textual description or name


providing information about the
TerritoryDescription VARCHAR(50) characteristics or geographical NOT NULL
coverage of a particular sales
territory.

A reference to the unique identifier of


the region to which a territory
Foreign key
RegionID INT belongs, establishing a relationship
(Region)
between territories and their parent
regions for organisational purposes.

You might also like