Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/karenpayneoregon/northwind2020-scripts
Modified NorthWind database script
https://github.com/karenpayneoregon/northwind2020-scripts
database microsoft-northwind-database sql sql-server sqlserver tsql
Last synced: 9 days ago
JSON representation
Modified NorthWind database script
- Host: GitHub
- URL: https://github.com/karenpayneoregon/northwind2020-scripts
- Owner: karenpayneoregon
- Created: 2020-07-11T12:41:33.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2020-07-13T14:18:12.000Z (over 4 years ago)
- Last Synced: 2024-11-30T19:24:27.764Z (2 months ago)
- Topics: database, microsoft-northwind-database, sql, sql-server, sqlserver, tsql
- Homepage:
- Size: 3.91 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Microsoft NorthWind modified
Below are links for a modified version of Microsoft NorthWind database with
- Better primary keys
- Entities split up e.g. country string to country identifier
- No spaces in table names### Create a populate
Use the [following link](https://gist.github.com/karenpayneoregon/9bdf1a7d5310ac1d562b2326d79d6038) for the script to create the database and populate tables best done in SSMS (SQL-Server Management Studio).### Sample SELECT statements
- [Customers](https://gist.github.com/karenpayneoregon/55cfa05ac21809ffed6146089fd7649d)
- [Employees](https://gist.github.com/karenpayneoregon/d7a287a9ebb18b4d9e1363f92812d447)
- [Products by category](https://gist.github.com/karenpayneoregon/18df5808020872215895192c50fcd482)
- [Order by order identifier](https://gist.github.com/karenpayneoregon/bc8329737eee80dfd2f9df0f9d3dbc63)
- [Order details by order identifier](https://gist.github.com/karenpayneoregon/2711f4edeaa9f374f6cafef479d265fc)
```sql
SELECT Cust.CustomerIdentifier,
Cust.CompanyName,
Cust.ContactId,
CT.ContactTitle,
C.FirstName,
C.LastName,
Cust.Street,
Cust.City,
Cust.Region,
Cust.PostalCode,
Countries.[Name] AS CountryName,
Cust.CountryIdentifier,
Cust.Phone,
Cust.Fax,
Cust.ContactTypeIdentifier,
Cust.ModifiedDate
FROM Customers AS Cust
INNER JOIN Contacts AS C ON Cust.ContactId = C.ContactId
INNER JOIN ContactType AS CT ON Cust.ContactTypeIdentifier = CT.ContactTypeIdentifier
INNER JOIN Countries ON Cust.CountryIdentifier = Countries.CountryIdentifier;
```
# Advance evolving version
The following repository is a work in progress using Microsoft Entity Framework Core 3x[Microsoft NorthWind database 2020 Part 1](https://github.com/karenpayneoregon/NorthWind-2020)