-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdb.sql
More file actions
33 lines (27 loc) · 637 Bytes
/
Copy pathdb.sql
File metadata and controls
33 lines (27 loc) · 637 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
if exists(select * from sys.databases where name = 'FluentNH')
drop database FluentNH
create database FluentNH
go
use FluentNH
create table Store (
Id int primary key identity not null,
Name varchar(50)
)
create table Employee (
Id int primary key identity not null,
LastName varchar(50),
FirstName varchar(50),
StoreId int not null
foreign key references Store(Id)
)
create table Product (
Id int primary key identity not null,
Price decimal,
Name varchar(50)
)
create table StoreProduct (
ProductId int not null
foreign key references Product(Id),
StoreId int not null
foreign key references Store(Id)
)