数据库脚本:
USE [master] GO /****** Object: Database [U201715959] Script Date: 12/12/2019 17:34:20 ******/ IF NOT EXISTS (SELECT name FROM sys.databases WHERE name = N\'U201715959\') BEGIN CREATE DATABASE [U201715959] ON PRIMARY ( NAME = N\'U201715959\', FILENAME = N\'D:\Database\U201715959\U201715959.mdf\' , SIZE = 3072KB , MAXSIZE = 716800KB , FILEGROWTH = 1024KB ) LOG ON ( NAME = N\'U201715959_log\', FILENAME = N\'D:\Database\U201715959\U201715959_log.ldf\' , SIZE = 1024KB , MAXSIZE = 204800KB , FILEGROWTH = 10%) END GO ALTER DATABASE [U201715959] SET COMPATIBILITY_LEVEL = 100 GO IF (1 = FULLTEXTSERVICEPROPERTY(\'IsFullTextInstalled\')) begin EXEC [U201715959].[dbo].[sp_fulltext_database] @action = \'enable\' end GO ALTER DATABASE [U201715959] SET ANSI_NULL_DEFAULT OFF GO ALTER DATABASE [U201715959] SET ANSI_NULLS OFF GO ALTER DATABASE [U201715959] SET ANSI_PADDING OFF GO ALTER DATABASE [U201715959] SET ANSI_WARNINGS OFF GO ALTER DATABASE [U201715959] SET ARITHABORT OFF GO ALTER DATABASE [U201715959] SET AUTO_CLOSE OFF GO ALTER DATABASE [U201715959] SET AUTO_CREATE_STATISTICS ON GO ALTER DATABASE [U201715959] SET AUTO_SHRINK OFF GO ALTER DATABASE [U201715959] SET AUTO_UPDATE_STATISTICS ON GO ALTER DATABASE [U201715959] SET CURSOR_CLOSE_ON_COMMIT OFF GO ALTER DATABASE [U201715959] SET CURSOR_DEFAULT GLOBAL GO ALTER DATABASE [U201715959] SET CONCAT_NULL_YIELDS_NULL OFF GO ALTER DATABASE [U201715959] SET NUMERIC_ROUNDABORT OFF GO ALTER DATABASE [U201715959] SET QUOTED_IDENTIFIER OFF GO ALTER DATABASE [U201715959] SET RECURSIVE_TRIGGERS OFF GO ALTER DATABASE [U201715959] SET DISABLE_BROKER GO ALTER DATABASE [U201715959] SET AUTO_UPDATE_STATISTICS_ASYNC OFF GO ALTER DATABASE [U201715959] SET DATE_CORRELATION_OPTIMIZATION OFF GO ALTER DATABASE [U201715959] SET TRUSTWORTHY OFF GO ALTER DATABASE [U201715959] SET ALLOW_SNAPSHOT_ISOLATION OFF GO ALTER DATABASE [U201715959] SET PARAMETERIZATION SIMPLE GO ALTER DATABASE [U201715959] SET READ_COMMITTED_SNAPSHOT OFF GO ALTER DATABASE [U201715959] SET HONOR_BROKER_PRIORITY OFF GO ALTER DATABASE [U201715959] SET READ_WRITE GO ALTER DATABASE [U201715959] SET RECOVERY FULL GO ALTER DATABASE [U201715959] SET MULTI_USER GO ALTER DATABASE [U201715959] SET PAGE_VERIFY CHECKSUM GO ALTER DATABASE [U201715959] SET DB_CHAINING OFF GO EXEC sys.sp_db_vardecimal_storage_format N\'U201715959\', N\'ON\' GO USE [U201715959] GO /****** Object: Table [dbo].[Customer] Script Date: 12/12/2019 17:34:21 ******/ IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N\'[dbo].[Customer]\') AND type in (N\'U\')) DROP TABLE [dbo].[Customer] GO /****** Object: Table [dbo].[Hall] Script Date: 12/12/2019 17:34:21 ******/ IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N\'[dbo].[Hall]\') AND type in (N\'U\')) DROP TABLE [dbo].[Hall] GO /****** Object: Table [dbo].[Movie] Script Date: 12/12/2019 17:34:21 ******/ IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N\'[dbo].[Movie]\') AND type in (N\'U\')) DROP TABLE [dbo].[Movie] GO /****** Object: Table [dbo].[Schedule] Script Date: 12/12/2019 17:34:21 ******/ IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N\'[dbo].[Schedule]\') AND type in (N\'U\')) DROP TABLE [dbo].[Schedule] GO /****** Object: Table [dbo].[Ticket] Script Date: 12/12/2019 17:34:21 ******/ IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N\'[dbo].[Ticket]\') AND type in (N\'U\')) DROP TABLE [dbo].[Ticket] GO /****** Object: User [U201715959] Script Date: 12/12/2019 17:34:20 ******/ IF EXISTS (SELECT * FROM sys.database_principals WHERE name = N\'U201715959\') DROP USER [U201715959] GO /****** Object: User [U201715959] Script Date: 12/12/2019 17:34:20 ******/ IF NOT EXISTS (SELECT * FROM sys.database_principals WHERE name = N\'U201715959\') CREATE USER [U201715959] FOR LOGIN [U201715959] WITH DEFAULT_SCHEMA=[dbo] GO /****** Object: Table [dbo].[Ticket] Script Date: 12/12/2019 17:34:21 ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N\'[dbo].[Ticket]\') AND type in (N\'U\')) BEGIN CREATE TABLE [dbo].[Ticket]( [TicketID] [int] IDENTITY(1,1) NOT NULL, [ScheduleID] [int] NULL, [DetailSeat] [nvarchar](50) NULL, CONSTRAINT [PK_Ticket] PRIMARY KEY CLUSTERED ( [TicketID] ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] ) ON [PRIMARY] END GO SET IDENTITY_INSERT [dbo].[Ticket] ON INSERT [dbo].[Ticket] ([TicketID], [ScheduleID], [DetailSeat]) VALUES (1, 5, N\'1-1\') INSERT [dbo].[Ticket] ([TicketID], [ScheduleID], [DetailSeat]) VALUES (2, 5, N\'1-2\') INSERT [dbo].[Ticket] ([TicketID], [ScheduleID], [DetailSeat]) VALUES (3, 1, N\'3-4\') INSERT [dbo].[Ticket] ([TicketID], [ScheduleID], [DetailSeat]) VALUES (4, 5, N\'1-3\') INSERT [dbo].[Ticket] ([TicketID], [ScheduleID], [DetailSeat]) VALUES (5, 5, N\'3-1\') INSERT [dbo].[Ticket] ([TicketID], [ScheduleID], [DetailSeat]) VALUES (6, 18, N\'1-1\') INSERT [dbo].[Ticket] ([TicketID], [ScheduleID], [DetailSeat]) VALUES (7, 4, N\'1-1\') INSERT [dbo].[Ticket] ([TicketID], [ScheduleID], [DetailSeat]) VALUES (8, 4, N\'1-2\') INSERT [dbo].[Ticket] ([TicketID], [ScheduleID], [DetailSeat]) VALUES (9, 5, N\'1-4\') INSERT [dbo].[Ticket] ([TicketID], [ScheduleID], [DetailSeat]) VALUES (10, 5, N\'1-5\') INSERT [dbo].[Ticket] ([TicketID], [ScheduleID], [DetailSeat]) VALUES (11, 5, N\'1-6\') INSERT [dbo].[Ticket] ([TicketID], [ScheduleID], [DetailSeat]) VALUES (12, 5, N\'2-6\') SET IDENTITY_INSERT [dbo].[Ticket] OFF /****** Object: Table [dbo].[Schedule] Script Date: 12/12/2019 17:34:21 ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N\'[dbo].[Schedule]\') AND type in (N\'U\')) BEGIN CREATE TABLE [dbo].[Schedule]( [ScheduleID] [int] IDENTITY(1,1) NOT NULL, [MovieID] [int] NULL, [HallID] [int] NULL, [Price] [int] NULL, [DateTime] [nvarchar](50) NULL, CONSTRAINT [PK_Schedule] PRIMARY KEY CLUSTERED ( [ScheduleID] ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] ) ON [PRIMARY] END GO SET IDENTITY_INSERT [dbo].[Schedule] ON INSERT [dbo].[Schedule] ([ScheduleID], [MovieID], [HallID], [Price], [DateTime]) VALUES (1, 4, 1, 32, N\'12-06 9:30\') INSERT [dbo].[Schedule] ([ScheduleID], [MovieID], [HallID], [Price], [DateTime]) VALUES (2, 2, 1, 35, N\'12-06 10:40\') INSERT [dbo].[Schedule] ([ScheduleID], [MovieID], [HallID], [Price], [DateTime]) VALUES (3, 3, 1, 45, N\'12-06 13:10\') INSERT [dbo].[Schedule] ([ScheduleID], [MovieID], [HallID], [Price], [DateTime]) VALUES (4, 5, 1, 38, N\'12-06 15:30\') INSERT [dbo].[Schedule] ([ScheduleID], [MovieID], [HallID], [Price], [DateTime]) VALUES (5, 1, 1, 35, N\'12-06 18:00\') INSERT [dbo].[Schedule] ([ScheduleID], [MovieID], [HallID], [Price], [DateTime]) VALUES (6, 5, 1, 40, N\'12-06 20:10\') INSERT [dbo].[Schedule] ([ScheduleID], [MovieID], [HallID], [Price], [DateTime]) VALUES (7, 3, 1, 36, N\'12-06 22:30\') INSERT [dbo].[Schedule] ([ScheduleID], [MovieID], [HallID], [Price], [DateTime]) VALUES (8, 3, 2, 36, N\'12-06 9:25\') INSERT [dbo].[Schedule] ([ScheduleID], [MovieID], [HallID], [Price], [DateTime]) VALUES (9, 5, 2, 36, N\'12-06 11:30\') INSERT [dbo].[Schedule] ([ScheduleID], [MovieID], [HallID], [Price], [DateTime]) VALUES (10, 4, 2, 40, N\'12-06 13:30\') INSERT [dbo].[Schedule] ([ScheduleID], [MovieID], [HallID], [Price], [DateTime]) VALUES (11, 2, 2, 36, N\'12-06 15:40\') INSERT [dbo].[Schedule] ([ScheduleID], [MovieID], [HallID], [Price], [DateTime]) VALUES (12, 2, 2, 40, N\'12-06 17:55\') INSERT [dbo].[Schedule] ([ScheduleID], [MovieID], [HallID], [Price], [DateTime]) VALUES (13, 3, 2, 36, N\'12-06 20:10\') INSERT [dbo].[Schedule] ([ScheduleID], [MovieID], [HallID], [Price], [DateTime]) VALUES (14, 1, 2, 36, N\'12-06 10:20\') INSERT [dbo].[Schedule] ([ScheduleID], [MovieID], [HallID], [Price], [DateTime]) VALUES (15, 5, 3, 100, N\'12-06 13:30\') INSERT [dbo].[Schedule] ([ScheduleID], [MovieID], [HallID], [Price], [DateTime]) VALUES (16, 3, 3, 100, N\'12-06 15:30\') INSERT [dbo].[Schedule] ([ScheduleID], [MovieID], [HallID], [Price], [DateTime]) VALUES (17, 2, 3, 100, N\'12-06 20:05\') INSERT [dbo].[Schedule] ([ScheduleID], [MovieID], [HallID], [Price], [DateTime]) VALUES (18, 1, 3, 100, N\'12-05 10:30\') INSERT [dbo].[Schedule] ([ScheduleID], [MovieID], [HallID], [Price], [DateTime]) VALUES (19, 4, 3, 100, N\'12-05 15:30\') INSERT [dbo].[Schedule] ([ScheduleID], [MovieID], [HallID], [Price], [DateTime]) VALUES (20, 5, 3, 100, N\'12-05 20:20\') SET IDENTITY_INSERT [dbo].[Schedule] OFF /****** Object: Table [dbo].[Movie] Script Date: 12/12/2019 17:34:21 ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N\'[dbo].[Movie]\') AND type in (N\'U\')) BEGIN CREATE TABLE [dbo].[Movie]( [MovieID] [int] IDENTITY(1,1) NOT NULL, [MovieName] [nvarchar](50) NULL, [Actor] [nvarchar](50) NULL, [Director] [nvarchar](50) NULL, [Duration] [int] NULL, [MovieType] [nvarchar](50) NULL, [Poster] [nvarchar](50) NULL, CONSTRAINT [PK_Movie] PRIMARY KEY CLUSTERED ( [MovieID] ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] ) ON [PRIMARY] END GO SET IDENTITY_INSERT [dbo].[Movie] ON INSERT [dbo].[Movie] ([MovieID], [MovieName], [Actor], [Director], [Duration], [MovieType], [Poster]) VALUES (1, N\'海蒂和爷爷\', N\'阿努克·斯特芬\', N\'阿兰·葛斯彭纳\', 111, N\'剧情、家庭\', N\'海蒂和爷爷.jpg\') INSERT [dbo].[Movie] ([MovieID], [MovieName], [Actor], [Director], [Duration], [MovieType], [Poster]) VALUES (2, N\'海上钢琴师\', N\'蒂姆·罗斯\', N\'吉赛贝·托纳多雷\', 125, N\'剧情\', N\'海上钢琴师.jpg\') INSERT [dbo].[Movie] ([MovieID], [MovieName], [Actor], [Director], [Duration], [MovieType], [Poster]) VALUES (3, N\'冰雪奇缘2\', N\'安娜、艾莎\', N\'詹妮弗·李\', 112, N\'喜剧,冒险\', N\'冰雪奇缘.jpg\') INSERT [dbo].[Movie] ([MovieID], [MovieName], [Actor], [Director], [Duration], [MovieType], [Poster]) VALUES (4, N\'夏目友人帐\', N\'井上和彦\', N\'大森贵弘\', 106, N\'妖怪,治愈,温暖\', N\'夏目友人帐.jpg\') INSERT [dbo].[Movie] ([MovieID], [MovieName], [Actor], [Director], [Duration], [MovieType], [Poster]) VALUES (5, N\'利刃出鞘\', N\'丹尼尔·克雷格\', N\'莱恩·约翰逊\', 130, N\'喜剧 、悬疑 、犯罪\', N\'利刃出鞘.jpg\') SET IDENTITY_INSERT [dbo].[Movie] OFF /****** Object: Table [dbo].[Hall] Script Date: 12/12/2019 17:34:21 ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N\'[dbo].[Hall]\') AND type in (N\'U\')) BEGIN CREATE TABLE [dbo].[Hall]( [HallID] [int] IDENTITY(1,1) NOT NULL, [rowsCount] [int] NULL, [colsCount] [int] NULL, CONSTRAINT [PK_Hall] PRIMARY KEY CLUSTERED ( [HallID] ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] ) ON [PRIMARY] END GO SET IDENTITY_INSERT [dbo].[Hall] ON INSERT [dbo].[Hall] ([HallID], [rowsCount], [colsCount]) VALUES (1, 7, 4) INSERT [dbo].[Hall] ([HallID], [rowsCount], [colsCount]) VALUES (2, 7, 4) INSERT [dbo].[Hall] ([HallID], [rowsCount], [colsCount]) VALUES (3, 7, 4) SET IDENTITY_INSERT [dbo].[Hall] OFF /****** Object: Table [dbo].[Customer] Script Date: 12/12/2019 17:34:21 ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N\'[dbo].[Customer]\') AND type in (N\'U\')) BEGIN CREATE TABLE [dbo].[Customer]( [CustomerID] [int] IDENTITY(1,1) NOT NULL, [UserName] [nvarchar](50) NULL, [PassWord] [nvarchar](50) NULL, CONSTRAINT [PK_Customer] PRIMARY KEY CLUSTERED ( [CustomerID] ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] ) ON [PRIMARY] END GO SET IDENTITY_INSERT [dbo].[Customer] ON INSERT [dbo].[Customer] ([CustomerID], [UserName], [PassWord]) VALUES (1, N\'张三\', N\'123456\') INSERT [dbo].[Customer] ([CustomerID], [UserName], [PassWord]) VALUES (2, N\'小兔子\', N\'123456\') INSERT [dbo].[Customer] ([CustomerID], [UserName], [PassWord]) VALUES (3, N\'lalala\', N\'123\') INSERT [dbo].[Customer] ([CustomerID], [UserName], [PassWord]) VALUES (4, N\'可爱宋\', N\'123456\') INSERT [dbo].[Customer] ([CustomerID], [UserName], [PassWord]) VALUES (5, N\'可爱郝\', N\'123456\') INSERT [dbo].[Customer] ([CustomerID], [UserName], [PassWord]) VALUES (6, N\'小名\', N\'123\') INSERT [dbo].[Customer] ([CustomerID], [UserName], [PassWord]) VALUES (7, N\'Angela\', N\'1234567\') INSERT [dbo].[Customer] ([CustomerID], [UserName], [PassWord]) VALUES (8, N\'小张\', N\'123\') INSERT [dbo].[Customer] ([CustomerID], [UserName], [PassWord]) VALUES (9, N\'123\', N\'123\') INSERT [dbo].[Customer] ([CustomerID], [UserName], [PassWord]) VALUES (10, N\'12345\', N\'123\') INSERT [dbo].[Customer] ([CustomerID], [UserName], [PassWord]) VALUES (11, N\'445\', N\'234\') INSERT [dbo].[Customer] ([CustomerID], [UserName], [PassWord]) VALUES (12, N\'黎明\', N\'111\') INSERT [dbo].[Customer] ([CustomerID], [UserName], [PassWord]) VALUES (13, N\'Lina\', N\'666666\') INSERT [dbo].[Customer] ([CustomerID], [UserName], [PassWord]) VALUES (14, N\'酷酷酷\', N\'111\') SET IDENTITY_INSERT [dbo].[Customer] OFF干货 | C#开发的电影售票系统 (4)
内容版权声明:除非注明,否则皆为本站原创文章。