4 CREATE TABLE [dbo].[Author] (
\r
5 [id] [int] IDENTITY (1, 1) NOT NULL ,
\r
6 [name] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
\r
7 [login] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
\r
8 [password] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL
\r
12 CREATE TABLE [dbo].[Blog] (
\r
13 [id] [int] IDENTITY (1, 1) NOT NULL ,
\r
14 [author_id] [int] NULL ,
\r
15 [name] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
\r
16 [description] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
\r
17 [theme] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL
\r
21 CREATE TABLE [dbo].[Post] (
\r
22 [id] [int] IDENTITY (1, 1) NOT NULL ,
\r
23 [blog_id] [int] NULL ,
\r
24 [title] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
\r
25 [contents] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
\r
26 [date] [datetime] NULL
\r
30 ALTER TABLE [dbo].[Author] WITH NOCHECK ADD
\r
31 CONSTRAINT [PK_Author] PRIMARY KEY CLUSTERED
\r
37 ALTER TABLE [dbo].[Blog] WITH NOCHECK ADD
\r
38 CONSTRAINT [PK_Blog] PRIMARY KEY CLUSTERED
\r
44 ALTER TABLE [dbo].[Post] WITH NOCHECK ADD
\r
45 CONSTRAINT [PK_Post] PRIMARY KEY CLUSTERED
\r
51 ALTER TABLE [dbo].[Blog] WITH NOCHECK ADD
\r
52 CONSTRAINT [FK_Blog_Author] FOREIGN KEY
\r
55 ) REFERENCES [dbo].[Author] (
\r
60 ALTER TABLE [dbo].[Post] WITH NOCHECK ADD
\r
61 CONSTRAINT [FK_Post_Blog] FOREIGN KEY
\r
64 ) REFERENCES [dbo].[Blog] (
\r