Вы находитесь на странице: 1из 5


Northwinds database

Analyzing Big Data I

Professor Ahmad Namini

By Alejandro Maceo
11/18/2018 1
Query analysis

A) From the Northwinds database, create a report showing the Order ID, the name of the company that
placed the order, and the first and last name of the associated employee. Only show orders placed after
January 1, 1998 that shipped after they were required. Sort by Company Name.

Based on the instructions, the information was first ordered by key elements in the database to
identify which information will be pull from the tables, as follows:

Columns (SELECT) Table (FROM)

OrderID Orders

CompanyName Customers

FirstName Employees

LastName Employees

OrderDate Orders

RequiredDate Orders

ShippedDate Orders

 Then the information should be filtered by the orders placed after January 1st, 1998 which I
initially used “WHERE OrderDate > '1/1/1998 12:00:00 AM' ” and wasn’t getting the results. After a
few searches online I learned that the date should be written in a different format: WHERE
OrderDate > '1998/01/01 12:00:00 AM'.

 The next step was to add a sequence to the filtered to include the orders that shipped after the
requiredate: AND ShippedDate>RequiredDate

 And the last part I just ordered by company name: Order BY CompanyName

The final query as follows:

SELECT OrderID, CompanyName, FirstName, LastName, OrderDate, RequiredDate, ShippedDate

FROM Orders, Customers, Employees

WHERE OrderDate > '1998/01/01 12:00:00 AM' AND ShippedDate>RequiredDate

Order BY CompanyName

When query was executed the following message about the results were shown:

11/18/2018 2
B) What could be the underlying factors that would warrant late shipping dates?

 The average days from the required date to the shipped day was -8 days.

 The information from the query was leveled between the associates to around 250 per person.

 The highest delay from the orders that shipped after they were required was -17 days on
4/24/1998 independent from the salesperson.

 The highest difference in correlation to the order placement and the shipment date, as
Order Date Shipment Date Difference

3/24/1998 0:00 4/24/1998 0:00 -17

1/12/1998 0:00 2/6/1998 0:00 -11

1/13/1998 0:00 2/4/1998 0:00 -8

3/4/1998 0:00 4/8/1998 0:00 -7

3/19/1998 0:00 4/8/1998 0:00 -6

1/22/1998 0:00 2/10/1998 0:00 -5

1/6/1998 0:00 2/4/1998 0:00 -1

The proportion of delays shows that 63% of the orders placed after 01/01/1998 was from 3 to 9 days
of delay.

Late Days Orders %

2< 250 13%

3<9 1250 63%

10+ 500 25%

2000 1

11/18/2018 3
If the shipment is depending on the production there should be a better planning of the orders in
advanced with the customers to improve required dates and customer satisfaction.

On the contrary, if orders depend on wholesaler/vendors there is definitively a need to work alongside
them to improve restock time and inventory turnover.

For a query result preview please refer to the appendix 1.

11/18/2018 4
Appendix 1

Northwind Database query results:

Database answerset - Alejandro Maceo.csv

11/18/2018 5