-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy path6_Book.sql
More file actions
30 lines (23 loc) · 742 Bytes
/
6_Book.sql
File metadata and controls
30 lines (23 loc) · 742 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
USE [EnterpriseArchitecture]
GO
/****** Object: Table [dbo].[Book] Script Date: 19-06-2020 07:29:15 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[Book](
[Id] [bigint] IDENTITY(1,1) NOT NULL,
[Title] [nvarchar](100) NOT NULL,
[Description] [nvarchar](1500) NULL,
[AuthorId] [bigint] NOT NULL,
CONSTRAINT [PK_Book] PRIMARY KEY CLUSTERED
(
[Id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[Book] WITH CHECK ADD CONSTRAINT [FK_Book_Author] FOREIGN KEY([AuthorId])
REFERENCES [dbo].[Author] ([Id])
GO
ALTER TABLE [dbo].[Book] CHECK CONSTRAINT [FK_Book_Author]
GO