Главная страница

практическая часть диплома мобильных приложений. Диплом_2 глава. 2. Разработка Программного продукта. 1 Концепция приложения


Скачать 0.63 Mb.
Название2. Разработка Программного продукта. 1 Концепция приложения
Анкорпрактическая часть диплома мобильных приложений
Дата07.05.2023
Размер0.63 Mb.
Формат файлаdocx
Имя файлаДиплом_2 глава.docx
ТипДокументы
#1112793
страница5 из 6
1   2   3   4   5   6

Приложение 1

Скрипт Базы Данных


USE [VideoSilencs]

GO
SET ANSI_NULLS ON

GO
SET QUOTED_IDENTIFIER ON

GO
CREATE TABLE [dbo].[Apartment](

[ID] [int] NOT NULL,

[Titles] [nvarchar](500) NULL,

[Descriptions] [nvarchar](500) NULL,

[Proce] [int] NULL,

[Photo] [nvarchar](500) NULL,


CREATE TABLE [dbo].[Owner](

[ID] [int] NOT NULL,

[FullName] [nvarchar](100) NOT NULL,

[Series] [int] NULL,

[Room] [int] NULL,

[Address] [nvarchar](100) NULL,

[Phone] [varchar](50) NULL,

[Email] [nvarchar](100) NOT NULL,

[DataBirth] [datetime] NULL,

[IssuedBy] [nvarchar](100) NULL,

[DataIssue] [datetime] NULL,

[DataRegistr] [datetime] NULL,

CONSTRAINT [PK_Owner] PRIMARY KEY CLUSTERED

(

[ID] ASC

)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, OPTIMIZE_FOR_SEQUENTIAL_KEY = OFF) ON [PRIMARY]

) ON [PRIMARY]

GO
CREATE TABLE [dbo].[Microdistrict](

[ID] [int] NOT NULL,

[Microdistrict] [nvarchar](50) NULL,

[IDCity] [int] NULL,

CONSTRAINT [PK_Microdistrict] PRIMARY KEY CLUSTERED

(

[ID] ASC

)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, OPTIMIZE_FOR_SEQUENTIAL_KEY = OFF) ON [PRIMARY]

) ON [PRIMARY]

GO
CREATE TABLE [dbo].[City](

[ID] [int] NOT NULL,

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

CONSTRAINT [PK_City] PRIMARY KEY CLUSTERED

(

[ID] ASC

)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, OPTIMIZE_FOR_SEQUENTIAL_KEY = OFF) ON [PRIMARY]

) ON [PRIMARY]

GO
CREATE TABLE [dbo].[Employee](

[ID] [int] NOT NULL,

[FullName] [nvarchar](100) NULL,

[Position] [nvarchar](50) NULL,

CONSTRAINT [PK_Employee] PRIMARY KEY CLUSTERED

(

[ID] ASC

)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, OPTIMIZE_FOR_SEQUENTIAL_KEY = OFF) ON [PRIMARY]

) ON [PRIMARY]

GO
CREATE TABLE [dbo].[Contract](

[ID] [int] NOT NULL,

[Data] [datetime] NULL,

[IDEmployee] [int] NULL,

[IDClient] [int] NULL,

[AddInformation] [nvarchar](100) NULL,

CONSTRAINT [PK_Contract_1] PRIMARY KEY CLUSTERED

(

[ID] ASC

)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, OPTIMIZE_FOR_SEQUENTIAL_KEY = OFF) ON [PRIMARY]

) ON [PRIMARY]

GO
CREATE TABLE [dbo].[Client](

[ID] [int] NOT NULL,

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

[Series] [int] NULL,

[Number] [int] NULL,

[Address] [nvarchar](100) NOT NULL,

[DataRegistr] [datetime] NULL,

[Phone] [int] NULL,

[Email] [nvarchar](100) NOT NULL,

[DataBirth] [datetime] NULL,

[IssuedBy] [nvarchar](100) NULL,

[DataIssue] [datetime] NULL,

CONSTRAINT [PK_Client] PRIMARY KEY CLUSTERED

(

[ID] ASC

)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, OPTIMIZE_FOR_SEQUENTIAL_KEY = OFF) ON [PRIMARY]

) ON [PRIMARY]

GO
ALTER TABLE [dbo].[Contract] WITH CHECK ADD CONSTRAINT [FK_Contract_Client1] FOREIGN KEY([IDClient])

REFERENCES [dbo].[Client] ([ID])

GO
ALTER TABLE [dbo].[Contract] CHECK CONSTRAINT [FK_Contract_Client1]

GO
ALTER TABLE [dbo].[Contract] WITH CHECK ADD CONSTRAINT [FK_Contract_Employee] FOREIGN KEY([IDEmployee])

REFERENCES [dbo].[Employee] ([ID])

GO
ALTER TABLE [dbo].[Contract] CHECK CONSTRAINT [FK_Contract_Employee]

GO
ALTER TABLE [dbo].[Microdistrict] WITH CHECK ADD CONSTRAINT [FK_Microdistrict_City1] FOREIGN KEY([IDCity])

REFERENCES [dbo].[City] ([ID])

GO
ALTER TABLE [dbo].[Microdistrict] CHECK CONSTRAINT [FK_Microdistrict_City1]

GO
ALTER TABLE [dbo].[Apartment] WITH CHECK ADD CONSTRAINT [FK_Apartment_Contract] FOREIGN KEY([IDContract])

REFERENCES [dbo].[Contract] ([ID])

GO

ALTER TABLE [dbo].[Apartment] WITH CHECK ADD CONSTRAINT [FK_Apartment_Owner] FOREIGN KEY([IDOwner])

REFERENCES [dbo].[Owner] ([ID])

GO
ALTER TABLE [dbo].[Apartment] CHECK CONSTRAINT [FK_Apartment_Owner]

GO
1   2   3   4   5   6


написать администратору сайта