Студопедия

КАТЕГОРИИ:


Архитектура-(3434)Астрономия-(809)Биология-(7483)Биотехнологии-(1457)Военное дело-(14632)Высокие технологии-(1363)География-(913)Геология-(1438)Государство-(451)Демография-(1065)Дом-(47672)Журналистика и СМИ-(912)Изобретательство-(14524)Иностранные языки-(4268)Информатика-(17799)Искусство-(1338)История-(13644)Компьютеры-(11121)Косметика-(55)Кулинария-(373)Культура-(8427)Лингвистика-(374)Литература-(1642)Маркетинг-(23702)Математика-(16968)Машиностроение-(1700)Медицина-(12668)Менеджмент-(24684)Механика-(15423)Науковедение-(506)Образование-(11852)Охрана труда-(3308)Педагогика-(5571)Полиграфия-(1312)Политика-(7869)Право-(5454)Приборостроение-(1369)Программирование-(2801)Производство-(97182)Промышленность-(8706)Психология-(18388)Религия-(3217)Связь-(10668)Сельское хозяйство-(299)Социология-(6455)Спорт-(42831)Строительство-(4793)Торговля-(5050)Транспорт-(2929)Туризм-(1568)Физика-(3942)Философия-(17015)Финансы-(26596)Химия-(22929)Экология-(12095)Экономика-(9961)Электроника-(8441)Электротехника-(4623)Энергетика-(12629)Юриспруденция-(1492)Ядерная техника-(1748)

Скрипт базы данных




 

USE [GIBDD]

GO

/****** Îáúåêò: Table [dbo].[Marka] Äàòà ñöåíàðèÿ: 01/15/2012 16:59:01 ******/

SET ANSI_NULLS ON

GO

SET QUOTED_IDENTIFIER ON

GO

CREATE TABLE [dbo].[Marka](

[Marka_ID] [int] IDENTITY(1,1) NOT NULL,

[Marka] [nchar](20) NOT NULL,

CONSTRAINT [PK_Marka] PRIMARY KEY CLUSTERED

(

[Marka_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

/****** Îáúåêò: Table [dbo].[FormCus] Äàòà ñöåíàðèÿ: 01/15/2012 16:59:01 ******/

SET ANSI_NULLS ON

GO

SET QUOTED_IDENTIFIER ON

GO

CREATE TABLE [dbo].[FormCus](

[FormCus_ID] [int] IDENTITY(1,1) NOT NULL,

[FormCus] [nchar](20) NOT NULL,

CONSTRAINT [PK_FormCus] PRIMARY KEY CLUSTERED

(

[FormCus_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

/****** Îáúåêò: Table [dbo].[Color] Äàòà ñöåíàðèÿ: 01/15/2012 16:59:00 ******/

SET ANSI_NULLS ON

GO

SET QUOTED_IDENTIFIER ON

GO

CREATE TABLE [dbo].[Color](

[Color_ID] [int] IDENTITY(1,1) NOT NULL,

[Color] [nchar](20) NOT NULL,

CONSTRAINT [PK_Color] PRIMARY KEY CLUSTERED

(

[Color_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

/****** Îáúåêò: Table [dbo].[Servis] Äàòà ñöåíàðèÿ: 01/15/2012 16:59:07 ******/

SET ANSI_NULLS ON

GO

SET QUOTED_IDENTIFIER ON

GO

CREATE TABLE [dbo].[Servis](

[Servis_ID] [int] IDENTITY(1,1) NOT NULL,

[Sname] [nvarchar](20) NOT NULL,

[Stel] [nvarchar](50) NOT NULL,

[Splace] [nvarchar](50) NOT NULL,

CONSTRAINT [PK_Servis] PRIMARY KEY CLUSTERED

(

[Servis_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

/****** Îáúåêò: Table [dbo].[AutoVladelez] Äàòà ñöåíàðèÿ: 01/15/2012 16:58:55 ******/

SET ANSI_NULLS ON

GO

SET QUOTED_IDENTIFIER ON

GO

CREATE TABLE [dbo].[AutoVladelez](

[AutoVladelez_ID] [int] IDENTITY(1,1) NOT NULL,

[F] [nchar](20) NOT NULL,

[I] [nchar](20) NOT NULL,

[O] [nchar](20) NOT NULL,

[Adress] [nvarchar](50) NOT NULL,

[Telephon] [nvarchar](50) NOT NULL,

[DriverPravaNomer] [int] NOT NULL,

[Pasport] [nvarchar](50) NOT NULL,

CONSTRAINT [PK_AutoVladelez] PRIMARY KEY CLUSTERED

(

[AutoVladelez_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

/****** Îáúåêò: Table [dbo].[YearVip] Äàòà ñöåíàðèÿ: 01/15/2012 16:59:09 ******/

SET ANSI_NULLS ON

GO

SET QUOTED_IDENTIFIER ON

GO

CREATE TABLE [dbo].[YearVip](

[YearVip_ID] [int] IDENTITY(1,1) NOT NULL,

[YearVip] [int] NULL,

CONSTRAINT [PK_YearVip] PRIMARY KEY CLUSTERED

(

[YearVip_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

/****** Îáúåêò: Table [dbo].[Pidr] Äàòà ñöåíàðèÿ: 01/15/2012 16:59:04 ******/

SET ANSI_NULLS ON

GO

SET QUOTED_IDENTIFIER ON

GO

CREATE TABLE [dbo].[Pidr](

[Pidr_ID] [int] IDENTITY(1,1) NOT NULL,

[PFIO] [nvarchar](50) NOT NULL,

[Dolzn] [nvarchar](50) NOT NULL,

[Zvan] [nvarchar](50) NOT NULL,

[NNZ] [nchar](6) NOT NULL,

[Padress] [nvarchar](50) NOT NULL,

[PPhone] [nvarchar](50) NOT NULL,

CONSTRAINT [PK_Pidr] PRIMARY KEY CLUSTERED

(

[Pidr_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

/****** Îáúåêò: Table [dbo].[TechView] Äàòà ñöåíàðèÿ: 01/15/2012 16:59:09 ******/

SET ANSI_NULLS ON

GO

SET QUOTED_IDENTIFIER ON

GO

CREATE TABLE [dbo].[TechView](

[TechView_ID] [int] IDENTITY(1,1) NOT NULL,

[DateView] [datetime] NULL,

[Status] [tinyint] NULL,

[Servis_ID] [int] NOT NULL,

[Car_ID] [int] NOT NULL,

CONSTRAINT [PK_TechView] PRIMARY KEY CLUSTERED

(

[TechView_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

/****** Îáúåêò: Table [dbo].[Pravonar] Äàòà ñöåíàðèÿ: 01/15/2012 16:59:06 ******/

SET ANSI_NULLS ON

GO

SET QUOTED_IDENTIFIER ON

GO

CREATE TABLE [dbo].[Pravonar](

[Pravonar_ID] [int] IDENTITY(1,1) NOT NULL,

[Pravonardate] [datetime] NOT NULL,

[Statya] [nvarchar](50) NOT NULL,

[SummShtraf] [money] NULL,

[Srok] [tinyint] NULL,

[Pidr_ID] [int] NOT NULL,

[AutoVladelez_ID] [int] NOT NULL,

CONSTRAINT [PK_Pravonar] PRIMARY KEY CLUSTERED

(

[Pravonar_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

/****** Îáúåêò: Table [dbo].[Car] Äàòà ñöåíàðèÿ: 01/15/2012 16:58:59 ******/

SET ANSI_NULLS ON

GO

SET QUOTED_IDENTIFIER ON

GO

CREATE TABLE [dbo].[Car](

[Car_ID] [int] IDENTITY(1,1) NOT NULL,

[GosRegNum] [nchar](6) NOT NULL,

[Vdvigatel] [float] NOT NULL,

[Power] [smallint] NOT NULL,

[Probeg] [int] NOT NULL,

[DataReg] [datetime] NOT NULL,

[Color_ID] [int] NOT NULL,

[Marka_ID] [int] NOT NULL,

[YearVip_ID] [int] NOT NULL,

[AutoVladelez_ID] [int] NOT NULL,

[Model_ID] [int] NOT NULL,

[FormCus_ID] [int] NULL,

[Vmestim] [int] NULL,

[Grusopod] [int] NULL,

CONSTRAINT [PK_Car] PRIMARY KEY CLUSTERED

(

[Car_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

/****** Îáúåêò: Table [dbo].[Model] Äàòà ñöåíàðèÿ: 01/15/2012 16:59:02 ******/

SET ANSI_NULLS ON

GO

SET QUOTED_IDENTIFIER ON

GO

CREATE TABLE [dbo].[Model](

[Model_ID] [int] IDENTITY(1,1) NOT NULL,

[Model] [nchar](20) NOT NULL,

[Marka_ID] [int] NOT NULL,

CONSTRAINT [PK_Model] PRIMARY KEY CLUSTERED

(

[Model_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

/****** Îáúåêò: Check [CK_AutoVladelez] Äàòà ñöåíàðèÿ: 01/15/2012 16:58:55 ******/

ALTER TABLE [dbo].[AutoVladelez] WITH CHECK ADD CONSTRAINT [CK_AutoVladelez] CHECK (([DriverPravaNomer]<=(999999)))

GO

ALTER TABLE [dbo].[AutoVladelez] CHECK CONSTRAINT [CK_AutoVladelez]

GO

/****** Îáúåêò: Check [CK_Car] Äàòà ñöåíàðèÿ: 01/15/2012 16:58:59 ******/

ALTER TABLE [dbo].[Car] WITH CHECK ADD CONSTRAINT [CK_Car] CHECK (([Power]<(1000)))

GO

ALTER TABLE [dbo].[Car] CHECK CONSTRAINT [CK_Car]

GO

/****** Îáúåêò: Check [CK_Car_1] Äàòà ñöåíàðèÿ: 01/15/2012 16:58:59 ******/

ALTER TABLE [dbo].[Car] WITH CHECK ADD CONSTRAINT [CK_Car_1] CHECK (([Probeg]>=(0)))

GO

ALTER TABLE [dbo].[Car] CHECK CONSTRAINT [CK_Car_1]

GO

/****** Îáúåêò: Check [CK_Pravonar] Äàòà ñöåíàðèÿ: 01/15/2012 16:59:06 ******/

ALTER TABLE [dbo].[Pravonar] WITH CHECK ADD CONSTRAINT [CK_Pravonar] CHECK (([Srok]<=(36)))

GO

ALTER TABLE [dbo].[Pravonar] CHECK CONSTRAINT [CK_Pravonar]

GO

/****** Îáúåêò: ForeignKey [FK_Car_AutoVladelez] Äàòà ñöåíàðèÿ: 01/15/2012 16:58:59 ******/

ALTER TABLE [dbo].[Car] WITH CHECK ADD CONSTRAINT [FK_Car_AutoVladelez] FOREIGN KEY([AutoVladelez_ID])

REFERENCES [dbo].[AutoVladelez] ([AutoVladelez_ID])

GO

ALTER TABLE [dbo].[Car] CHECK CONSTRAINT [FK_Car_AutoVladelez]

GO

/****** Îáúåêò: ForeignKey [FK_Car_Color] Äàòà ñöåíàðèÿ: 01/15/2012 16:58:59 ******/

ALTER TABLE [dbo].[Car] WITH CHECK ADD CONSTRAINT [FK_Car_Color] FOREIGN KEY([Color_ID])

REFERENCES [dbo].[Color] ([Color_ID])

GO

ALTER TABLE [dbo].[Car] CHECK CONSTRAINT [FK_Car_Color]

GO

/****** Îáúåêò: ForeignKey [FK_Car_FormCus] Äàòà ñöåíàðèÿ: 01/15/2012 16:58:59 ******/

ALTER TABLE [dbo].[Car] WITH CHECK ADD CONSTRAINT [FK_Car_FormCus] FOREIGN KEY([FormCus_ID])

REFERENCES [dbo].[FormCus] ([FormCus_ID])

GO

ALTER TABLE [dbo].[Car] CHECK CONSTRAINT [FK_Car_FormCus]

GO

/****** Îáúåêò: ForeignKey [FK_Car_Marka] Äàòà ñöåíàðèÿ: 01/15/2012 16:58:59 ******/

ALTER TABLE [dbo].[Car] WITH CHECK ADD CONSTRAINT [FK_Car_Marka] FOREIGN KEY([Marka_ID])

REFERENCES [dbo].[Marka] ([Marka_ID])

GO

ALTER TABLE [dbo].[Car] CHECK CONSTRAINT [FK_Car_Marka]

GO

/****** Îáúåêò: ForeignKey [FK_Car_Model] Äàòà ñöåíàðèÿ: 01/15/2012 16:58:59 ******/

ALTER TABLE [dbo].[Car] WITH CHECK ADD CONSTRAINT [FK_Car_Model] FOREIGN KEY([Model_ID])

REFERENCES [dbo].[Model] ([Model_ID])

GO

ALTER TABLE [dbo].[Car] CHECK CONSTRAINT [FK_Car_Model]

GO

/****** Îáúåêò: ForeignKey [FK_Car_YearVip] Äàòà ñöåíàðèÿ: 01/15/2012 16:58:59 ******/

ALTER TABLE [dbo].[Car] WITH CHECK ADD CONSTRAINT [FK_Car_YearVip] FOREIGN KEY([YearVip_ID])

REFERENCES [dbo].[YearVip] ([YearVip_ID])

GO

ALTER TABLE [dbo].[Car] CHECK CONSTRAINT [FK_Car_YearVip]

GO

/****** Îáúåêò: ForeignKey [FK_Model_Marka] Äàòà ñöåíàðèÿ: 01/15/2012 16:59:02 ******/

ALTER TABLE [dbo].[Model] WITH CHECK ADD CONSTRAINT [FK_Model_Marka] FOREIGN KEY([Marka_ID])

REFERENCES [dbo].[Marka] ([Marka_ID])

GO

ALTER TABLE [dbo].[Model] CHECK CONSTRAINT [FK_Model_Marka]

GO

/****** Îáúåêò: ForeignKey [FK_Pravonar_AutoVladelez] Äàòà ñöåíàðèÿ: 01/15/2012 16:59:06 ******/

ALTER TABLE [dbo].[Pravonar] WITH CHECK ADD CONSTRAINT [FK_Pravonar_AutoVladelez] FOREIGN KEY([AutoVladelez_ID])

REFERENCES [dbo].[AutoVladelez] ([AutoVladelez_ID])

GO

ALTER TABLE [dbo].[Pravonar] CHECK CONSTRAINT [FK_Pravonar_AutoVladelez]

GO

/****** Îáúåêò: ForeignKey [FK_Pravonar_Pidr] Äàòà ñöåíàðèÿ: 01/15/2012 16:59:06 ******/

ALTER TABLE [dbo].[Pravonar] WITH CHECK ADD CONSTRAINT [FK_Pravonar_Pidr] FOREIGN KEY([Pidr_ID])

REFERENCES [dbo].[Pidr] ([Pidr_ID])

GO

ALTER TABLE [dbo].[Pravonar] CHECK CONSTRAINT [FK_Pravonar_Pidr]

GO

/****** Îáúåêò: ForeignKey [FK_TechView_Car] Äàòà ñöåíàðèÿ: 01/15/2012 16:59:09 ******/

ALTER TABLE [dbo].[TechView] WITH CHECK ADD CONSTRAINT [FK_TechView_Car] FOREIGN KEY([Car_ID])

REFERENCES [dbo].[Car] ([Car_ID])

GO

ALTER TABLE [dbo].[TechView] CHECK CONSTRAINT [FK_TechView_Car]

GO

/****** Îáúåêò: ForeignKey [FK_TechView_Servis] Äàòà ñöåíàðèÿ: 01/15/2012 16:59:09 ******/

ALTER TABLE [dbo].[TechView] WITH CHECK ADD CONSTRAINT [FK_TechView_Servis] FOREIGN KEY([Servis_ID])

REFERENCES [dbo].[Servis] ([Servis_ID])

GO

ALTER TABLE [dbo].[TechView] CHECK CONSTRAINT [FK_TechView_Servis]

GO

 




Поделиться с друзьями:


Дата добавления: 2015-05-09; Просмотров: 323; Нарушение авторских прав?; Мы поможем в написании вашей работы!


Нам важно ваше мнение! Был ли полезен опубликованный материал? Да | Нет



studopedia.su - Студопедия (2013 - 2024) год. Все материалы представленные на сайте исключительно с целью ознакомления читателями и не преследуют коммерческих целей или нарушение авторских прав! Последнее добавление




Генерация страницы за: 0.01 сек.