Created
May 30, 2012 03:08
-
-
Save brianium/2833487 to your computer and use it in GitHub Desktop.
SqlServer Script
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--Employees | |
CREATE TABLE Employees( | |
Id int not null, | |
LastName nvarchar(50) not null, | |
MiddleName nvarchar(50), | |
FirstName nvarchar(50) not null, | |
primary key(Id) | |
) | |
GO | |
--Customers | |
CREATE TABLE Customers( | |
Id int not null, | |
CustomerIdentifier nvarchar(50) not null, | |
LastName nvarchar(50) not null, | |
MiddleName nvarchar(50), | |
FirstName nvarchar(50) not null, | |
Line1 nvarchar(100) not null, | |
Line2 nvarchar(100) not null, | |
ZipCode nvarchar(10) not null, | |
City nvarchar(50) not null, | |
State nchar(2) not null, | |
primary key(Id) | |
) | |
GO | |
--Orders | |
CREATE TABLE Orders( | |
Id int not null, | |
CustomerId int not null, | |
EmployeeId int not null, | |
OrderDate datetime not null, | |
OrderTotal money not null, | |
primary key(Id), | |
constraint FK_Orders_Customers foreign key (CustomerId) references Customers(Id), | |
constraint FK_Orders_Employees foreign key (EmployeeId) references Employees(Id) | |
) | |
GO |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment