Файл: Курсовая работа по мдк 04. 01 Технология разработки и защиты баз данных.docx
Добавлен: 06.12.2023
Просмотров: 618
Скачиваний: 20
ВНИМАНИЕ! Если данный файл нарушает Ваши авторские права, то обязательно сообщите нам.
ПРИЛОЖЕНИЕ А
Документированный листинг программных модулей
Листинг А.1 – Скрипт базы данных
USE [master]
GO
/****** Object: Database [Служба_такси] Script Date: 17.12.2022 9:11:38 ******/
CREATE DATABASE [Служба_такси]
CONTAINMENT = NONE
ON PRIMARY
( NAME = N'Taxi_service', FILENAME = N'E:\SQL\базы\Taxi_service.mdf' ,
SIZE = 8192KB , MAXSIZE = UNLIMITED, FILEGROWTH = 65536KB )
LOG ON
( NAME = N'Taxi_service_log', FILENAME = N'E:\SQL\базы\Taxi_service_log.ldf' ,
SIZE = 8192KB , MAXSIZE = 2048GB , FILEGROWTH = 65536KB )
WITH CATALOG_COLLATION = DATABASE_DEFAULT
GO
ALTER DATABASE [Служба_такси] SET COMPATIBILITY_LEVEL = 150
GO
IF (1 = FULLTEXTSERVICEPROPERTY('IsFullTextInstalled'))
begin
EXEC [Служба_такси].[dbo].[sp_fulltext_database] @action = 'enable'
end
GO
ALTER DATABASE [Служба_такси] SET ANSI_NULL_DEFAULT OFF
GO
ALTER DATABASE [Служба_такси] SET ANSI_NULLS OFF
GO
ALTER DATABASE [Служба_такси] SET ANSI_PADDING OFF
GO
ALTER DATABASE [Служба_такси] SET ANSI_WARNINGS OFF
GO
ALTER DATABASE [Служба_такси] SET ARITHABORT OFF
GO
ALTER DATABASE [Служба_такси] SET AUTO_CLOSE OFF
GO
ALTER DATABASE [Служба_такси] SET AUTO_SHRINK OFF
GO
ALTER DATABASE [Служба_такси] SET AUTO_UPDATE_STATISTICS ON
GO
ALTER DATABASE [Служба_такси] SET CURSOR_CLOSE_ON_COMMIT OFF
GO
ALTER DATABASE [Служба_такси] SET CURSOR_DEFAULT GLOBAL
GO
ALTER DATABASE [Служба_такси] SET CONCAT_NULL_YIELDS_NULL OFF
GO
ALTER DATABASE [Служба_такси] SET NUMERIC_ROUNDABORT OFF
GO
ALTER DATABASE [Служба_такси] SET QUOTED_IDENTIFIER OFF
GO
ALTER DATABASE [Служба_такси] SET RECURSIVE_TRIGGERS OFF
GO
ALTER DATABASE [Служба_такси] SET DISABLE_BROKER
GO
ALTER DATABASE [Служба_такси] SET AUTO_UPDATE_STATISTICS_ASYNC OFF
GO
ALTER DATABASE [Служба_такси] SET DATE_CORRELATION_OPTIMIZATION OFF
GO
ALTER DATABASE [Служба_такси] SET TRUSTWORTHY OFF
GO
ALTER DATABASE [Служба_такси] SET ALLOW_SNAPSHOT_ISOLATION OFF
GO
ALTER DATABASE [Служба_такси] SET PARAMETERIZATION SIMPLE
GO
ALTER DATABASE [Служба_такси] SET READ_COMMITTED_SNAPSHOT OFF
GO
ALTER DATABASE [Служба_такси] SET HONOR_BROKER_PRIORITY OFF
GO
ALTER DATABASE [Служба_такси] SET RECOVERY FULL
GO
ALTER DATABASE [Служба_такси] SET MULTI_USER
GO
ALTER DATABASE [Служба_такси] SET PAGE_VERIFY CHECKSUM
GO
ALTER DATABASE [Служба_такси] SET DB_CHAINING OFF
GO
ALTER DATABASE [Служба_такси] SET FILESTREAM( NON_TRANSACTED_ACCESS = OFF )
Продолжение листинга А.1
GO
ALTER DATABASE [Служба_такси] SET TARGET_RECOVERY_TIME = 60 SECONDS
GO
ALTER DATABASE [Служба_такси] SET DELAYED_DURABILITY = DISABLED
GO
ALTER DATABASE [Служба_такси] SET ACCELERATED_DATABASE_RECOVERY = OFF
GO
EXEC sys.sp_db_vardecimal_storage_format N'Служба_такси', N'ON'
GO
ALTER DATABASE [Служба_такси] SET QUERY_STORE = OFF
GO
USE [Служба_такси]
GO
/****** Object: Table [dbo].[Автомобили] Script Date: 17.12.2022 9:11:39 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[Автомобили](
[Гос_номер] [nvarchar](50) NOT NULL,
[ID_марка] [int] NOT NULL,
[ID_модель] [int] NOT NULL,
[ID_цвет] [int] NOT NULL,
[Год_выпуска] [int] NOT NULL,
[ID_тех_состояние] [int] NOT NULL,
CONSTRAINT [PK_Автомобили] PRIMARY KEY CLUSTERED
([Гос_номер] 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
/****** Object: Table [dbo].[Адреса] Script Date: 17.12.2022 9:11:39 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[Адреса](
[ID_адрес] [int] IDENTITY(1,1) NOT NULL,
[ID_район] [int] NOT NULL,
[ID_улица] [int] NOT NULL,
CONSTRAINT [PK_Адреса] 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
/****** Object: Table [dbo].[Водители] Script Date: 17.12.2022 9:11:39 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[Водители](
[ID_водитель] [int] IDENTITY(1,1) NOT NULL,
[Фамилия] [nvarchar](50) NOT NULL,
[Имя] [nvarchar](50) NOT NULL,
[Отчество] [nvarchar](50) NULL,
[Дата_рождения] [date] NOT NULL,
[Телефон] [nvarchar](50) NOT NULL,
[Стаж_работы] [int] NOT NULL,
[Номер_водительского_удостоверения] [nvarchar](50) NOT NULL,
[Дата_выдачи_водительского_удостоверения] [date] NOT NULL,
[Гос_номер] [nvarchar](50) NOT NULL,
[ID_причина_нетрудоспособности] [int] NOT NULL,
[ID_статус] [int] NOT NULL,
CONSTRAINT [PK_Водители] 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
/****** Object: Table [dbo].[Диспетчеры] Script Date: 17.12.2022 9:11:39 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[Диспетчеры](
[ID_диспетчер] [int] IDENTITY(1,1) NOT NULL,
[Фамилия] [nvarchar](50) NOT NULL,
Продолжение листинга А.1
[Имя] [nvarchar](50) NOT NULL,
[Отчество] [nvarchar](50) NOT NULL,
CONSTRAINT [PK_Диспетчер] 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
/****** Object: Table [dbo].[Заявки] Script Date: 17.12.2022 9:11:39 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[Заявки](
[ID_заявка] [int] IDENTITY(1,1) NOT NULL,
[ID_клиента] [int] NOT NULL,
[ID_диспетчер] [int] NOT NULL,
[ID_тип_автомобиля] [int] NOT NULL,
[ID_адрес_отправки] [int] NOT NULL,
[ID_адрес_прибытия] [int] NOT NULL,
[Дата_время_отправки] [datetime] NOT NULL,
[Дата_время_прибытия] [datetime] NOT NULL,
[ID_тариф] [int] NOT NULL,
CONSTRAINT [PK_Заявки] 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
/****** Object: Table [dbo].[Клиенты] Script Date: 17.12.2022 9:11:39 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[Клиенты](
[ID_клиент] [int] IDENTITY(1,1) NOT NULL,
[Телефон] [nvarchar](50) NOT NULL,
CONSTRAINT [PK_Клиенты] 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
/****** Object: Table [dbo].[Марки] Script Date: 17.12.2022 9:11:39 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[Марки](
[ID_марка] [int] IDENTITY(1,1) NOT NULL,
[Марка] [nvarchar](50) NOT NULL,
CONSTRAINT [PK_Марка] 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
/****** Object: Table [dbo].[Модели] Script Date: 17.12.2022 9:11:39 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[Модели](
[ID_модель] [int] IDENTITY(1,1) NOT NULL,
[Модель] [nvarchar](50) NOT NULL,
CONSTRAINT [PK_Модель] 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
/****** Object: Table [dbo].[Обслуживание_заявок] Script Date: 17.12.2022 9:11:39 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[Обслуживание_заявок](
[ID_обслуживание_заявки] [int] IDENTITY(1,1) NOT NULL,
Продолжение листинга А.1
[ID_заявка] [int] NOT NULL,
[ID_водитель] [int] NOT NULL,
[ID_статус] [int] NOT NULL,
CONSTRAINT [PK_Обслуживание_заявок] 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
/****** Object: Table [dbo].[Причина_нетрудоспособности] Script Date: 17.12.2022 9:11:39 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[Причина_нетрудоспособности](
[ID_причина_нетрудоспособности] [int] IDENTITY(1,1) NOT NULL,
[Причина] [nvarchar](50) NOT NULL,
CONSTRAINT [PK_Причина_нетрудоспособности] 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
/****** Object: Table [dbo].[Путевой_лист] Script Date: 17.12.2022 9:11:39 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[Путевой_лист](
[ID_путевой_лист] [int] IDENTITY(1,1) NOT NULL,
[ID_водитель] [int] NOT NULL,
[ID_смена] [int] NOT NULL,
[Дата_Время_открытия] [datetime] NOT NULL,
[Дата_Время_закрытия] [datetime] NOT NULL,
[Коичество_выполненых_заявок] [int] NOT NULL,
[Зарплата] [money] NOT NULL,
CONSTRAINT [PK_Путевой_лист] 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
/****** Object: Table [dbo].[Район] Script Date: 17.12.2022 9:11:39 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[Район](
[ID_район] [int] IDENTITY(1,1) NOT NULL,
[Район] [nvarchar](50) NOT NULL,
CONSTRAINT [PK_Район] 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
/****** Object: Table [dbo].[Смена] Script Date: 17.12.2022 9:11:39 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[Смена](
[ID_смена] [int] IDENTITY(1,1) NOT NULL,
[Смена] [nvarchar](50) NOT NULL,
CONSTRAINT [PK_Смена] 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
/****** Object: Table [dbo].[Статус_водителя] Script Date: 17.12.2022 9:11:39 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[Статус_водителя](
[ID_статус] [int] IDENTITY(1,1) NOT NULL,
[Статус] [nvarchar](50) NOT NULL,
Продолжение листинга А.1
CONSTRAINT [PK_Статус_водителя] 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
/****** Object: Table [dbo].[Статус_ОЗ] Script Date: 17.12.2022 9:11:39 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[Статус_ОЗ](
[ID_статус] [int] IDENTITY(1,1) NOT NULL,
[Статус] [nvarchar](50) NOT NULL,
CONSTRAINT [PK_Статус_заявки] 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
/****** Object: Table [dbo].[Тариф] Script Date: 17.12.2022 9:11:39 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[Тариф](
[ID_тариф] [int] IDENTITY(1,1) NOT NULL,
[Тариф] [nvarchar](50) NOT NULL,
[Цена_за_км] [nvarchar](50) NOT NULL,
CONSTRAINT [PK_Тариф] 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
/****** Object: Table [dbo].[Техническое_состояние] Script Date: 17.12.2022 9:11:39 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[Техническое_состояние](
[ID_тех_состояние] [int] IDENTITY(1,1) NOT NULL,
[Тех_состояние] [nvarchar](50) NOT NULL,
CONSTRAINT [PK_Тех_состояние_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
/****** Object: Table [dbo].[Тип_автомобиля] Script Date: 17.12.2022 9:11:39 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[Тип_автомобиля](
[ID_тип_автомобиля] [int] IDENTITY(1,1) NOT NULL,
[Тип_автомобиля] [nvarchar](50) NOT NULL,
CONSTRAINT [PK_Тип_авто] 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
/****** Object: Table [dbo].[Улица] Script Date: 17.12.2022 9:11:39 ******/