• 范例-项目-.NET-PetShop-4.0-数据库设计:MSPetShop4Order


    ylbtech-范例-项目-.NET-PetShop-4.0-数据库设计:MSPetShop4Order
    1. 数据库关系图返回顶部
    1、
    2、
    2.返回顶部
     
    3.返回顶部
     
    4. SQL脚本 返回顶部
    1、
    USE [master]
    GO
    /****** Object:  Database [MSPetShop4Orders]    Script Date: 2020/4/13 21:31:01 ******/
    CREATE DATABASE [MSPetShop4Orders]
     CONTAINMENT = NONE
     ON  PRIMARY 
    ( NAME = N'MSPetShop4Orders', FILENAME = N'C:Program FilesMicrosoft SQL ServerMSSQL12.MSSQLSERVERMSSQLDATAMSPetShop4Orders.mdf' , SIZE = 4288KB , MAXSIZE = UNLIMITED, FILEGROWTH = 1024KB )
     LOG ON 
    ( NAME = N'MSPetShop4Orders_log', FILENAME = N'C:Program FilesMicrosoft SQL ServerMSSQL12.MSSQLSERVERMSSQLDATAMSPetShop4Orders_log.ldf' , SIZE = 1072KB , MAXSIZE = 2048GB , FILEGROWTH = 10%)
    GO
    ALTER DATABASE [MSPetShop4Orders] SET COMPATIBILITY_LEVEL = 120
    GO
    IF (1 = FULLTEXTSERVICEPROPERTY('IsFullTextInstalled'))
    begin
    EXEC [MSPetShop4Orders].[dbo].[sp_fulltext_database] @action = 'enable'
    end
    GO
    ALTER DATABASE [MSPetShop4Orders] SET ANSI_NULL_DEFAULT OFF 
    GO
    ALTER DATABASE [MSPetShop4Orders] SET ANSI_NULLS OFF 
    GO
    ALTER DATABASE [MSPetShop4Orders] SET ANSI_PADDING OFF 
    GO
    ALTER DATABASE [MSPetShop4Orders] SET ANSI_WARNINGS OFF 
    GO
    ALTER DATABASE [MSPetShop4Orders] SET ARITHABORT OFF 
    GO
    ALTER DATABASE [MSPetShop4Orders] SET AUTO_CLOSE OFF 
    GO
    ALTER DATABASE [MSPetShop4Orders] SET AUTO_SHRINK OFF 
    GO
    ALTER DATABASE [MSPetShop4Orders] SET AUTO_UPDATE_STATISTICS ON 
    GO
    ALTER DATABASE [MSPetShop4Orders] SET CURSOR_CLOSE_ON_COMMIT OFF 
    GO
    ALTER DATABASE [MSPetShop4Orders] SET CURSOR_DEFAULT  GLOBAL 
    GO
    ALTER DATABASE [MSPetShop4Orders] SET CONCAT_NULL_YIELDS_NULL OFF 
    GO
    ALTER DATABASE [MSPetShop4Orders] SET NUMERIC_ROUNDABORT OFF 
    GO
    ALTER DATABASE [MSPetShop4Orders] SET QUOTED_IDENTIFIER OFF 
    GO
    ALTER DATABASE [MSPetShop4Orders] SET RECURSIVE_TRIGGERS OFF 
    GO
    ALTER DATABASE [MSPetShop4Orders] SET  ENABLE_BROKER 
    GO
    ALTER DATABASE [MSPetShop4Orders] SET AUTO_UPDATE_STATISTICS_ASYNC OFF 
    GO
    ALTER DATABASE [MSPetShop4Orders] SET DATE_CORRELATION_OPTIMIZATION OFF 
    GO
    ALTER DATABASE [MSPetShop4Orders] SET TRUSTWORTHY OFF 
    GO
    ALTER DATABASE [MSPetShop4Orders] SET ALLOW_SNAPSHOT_ISOLATION OFF 
    GO
    ALTER DATABASE [MSPetShop4Orders] SET PARAMETERIZATION SIMPLE 
    GO
    ALTER DATABASE [MSPetShop4Orders] SET READ_COMMITTED_SNAPSHOT OFF 
    GO
    ALTER DATABASE [MSPetShop4Orders] SET HONOR_BROKER_PRIORITY OFF 
    GO
    ALTER DATABASE [MSPetShop4Orders] SET RECOVERY FULL 
    GO
    ALTER DATABASE [MSPetShop4Orders] SET  MULTI_USER 
    GO
    ALTER DATABASE [MSPetShop4Orders] SET PAGE_VERIFY CHECKSUM  
    GO
    ALTER DATABASE [MSPetShop4Orders] SET DB_CHAINING OFF 
    GO
    ALTER DATABASE [MSPetShop4Orders] SET FILESTREAM( NON_TRANSACTED_ACCESS = OFF ) 
    GO
    ALTER DATABASE [MSPetShop4Orders] SET TARGET_RECOVERY_TIME = 0 SECONDS 
    GO
    ALTER DATABASE [MSPetShop4Orders] SET DELAYED_DURABILITY = DISABLED 
    GO
    EXEC sys.sp_db_vardecimal_storage_format N'MSPetShop4Orders', N'ON'
    GO
    USE [MSPetShop4Orders]
    GO
    /****** Object:  User [mspetshop]    Script Date: 2020/4/13 21:31:01 ******/
    CREATE USER [mspetshop] FOR LOGIN [mspetshop] WITH DEFAULT_SCHEMA=[mspetshop]
    GO
    ALTER ROLE [db_owner] ADD MEMBER [mspetshop]
    GO
    /****** Object:  Schema [mspetshop]    Script Date: 2020/4/13 21:31:01 ******/
    CREATE SCHEMA [mspetshop]
    GO
    /****** Object:  Table [dbo].[LineItem]    Script Date: 2020/4/13 21:31:01 ******/
    SET ANSI_NULLS ON
    GO
    SET QUOTED_IDENTIFIER ON
    GO
    SET ANSI_PADDING ON
    GO
    CREATE TABLE [dbo].[LineItem](
        [OrderId] [int] NOT NULL,
        [LineNum] [int] NOT NULL,
        [ItemId] [varchar](10) NOT NULL,
        [Quantity] [int] NOT NULL,
        [UnitPrice] [decimal](10, 2) NOT NULL,
     CONSTRAINT [PkLineItem] PRIMARY KEY CLUSTERED 
    (
        [OrderId] ASC,
        [LineNum] 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
    SET ANSI_PADDING OFF
    GO
    /****** Object:  Table [dbo].[Orders]    Script Date: 2020/4/13 21:31:01 ******/
    SET ANSI_NULLS ON
    GO
    SET QUOTED_IDENTIFIER ON
    GO
    SET ANSI_PADDING ON
    GO
    CREATE TABLE [dbo].[Orders](
        [OrderId] [int] IDENTITY(1,1) NOT NULL,
        [UserId] [varchar](20) NOT NULL,
        [OrderDate] [datetime] NOT NULL,
        [ShipAddr1] [varchar](80) NOT NULL,
        [ShipAddr2] [varchar](80) NULL,
        [ShipCity] [varchar](80) NOT NULL,
        [ShipState] [varchar](80) NOT NULL,
        [ShipZip] [varchar](20) NOT NULL,
        [ShipCountry] [varchar](20) NOT NULL,
        [BillAddr1] [varchar](80) NOT NULL,
        [BillAddr2] [varchar](80) NULL,
        [BillCity] [varchar](80) NOT NULL,
        [BillState] [varchar](80) NOT NULL,
        [BillZip] [varchar](20) NOT NULL,
        [BillCountry] [varchar](20) NOT NULL,
        [Courier] [varchar](80) NOT NULL,
        [TotalPrice] [decimal](10, 2) NOT NULL,
        [BillToFirstName] [varchar](80) NOT NULL,
        [BillToLastName] [varchar](80) NOT NULL,
        [ShipToFirstName] [varchar](80) NOT NULL,
        [ShipToLastName] [varchar](80) NOT NULL,
        [AuthorizationNumber] [int] NOT NULL,
        [Locale] [varchar](20) NOT NULL,
    PRIMARY KEY CLUSTERED 
    (
        [OrderId] 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
    SET ANSI_PADDING OFF
    GO
    /****** Object:  Table [dbo].[OrderStatus]    Script Date: 2020/4/13 21:31:01 ******/
    SET ANSI_NULLS ON
    GO
    SET QUOTED_IDENTIFIER ON
    GO
    SET ANSI_PADDING ON
    GO
    CREATE TABLE [dbo].[OrderStatus](
        [OrderId] [int] NOT NULL,
        [LineNum] [int] NOT NULL,
        [Timestamp] [datetime] NOT NULL,
        [Status] [varchar](2) NOT NULL,
     CONSTRAINT [PkOrderStatus] PRIMARY KEY CLUSTERED 
    (
        [OrderId] ASC,
        [LineNum] 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
    SET ANSI_PADDING OFF
    GO
    ALTER TABLE [dbo].[LineItem]  WITH CHECK ADD FOREIGN KEY([OrderId])
    REFERENCES [dbo].[Orders] ([OrderId])
    GO
    ALTER TABLE [dbo].[OrderStatus]  WITH CHECK ADD FOREIGN KEY([OrderId])
    REFERENCES [dbo].[Orders] ([OrderId])
    GO
    USE [master]
    GO
    ALTER DATABASE [MSPetShop4Orders] SET  READ_WRITE 
    GO
    View Code
    2、
    5.返回顶部
     
     
    6.返回顶部
     
    warn 作者:ylbtech
    出处:http://ylbtech.cnblogs.com/
    本文版权归作者和博客园共有,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文连接,否则保留追究法律责任的权利。
  • 相关阅读:
    Xcode 8.2 想使用插件 怎么办? 教你科学的使用插件
    JSAPI_Ticket签名
    Java中HashMap,LinkedHashMap,TreeMap的区别[转]
    微信支付开发,再次签名,APP调用
    微信支付开发,统一下单
    android studio安装插件
    java实现mysql数据库的备份及还原
    java项目中读取src目录下的文件
    eclipse增加浏览器chrome
    cd 命令
  • 原文地址:https://www.cnblogs.com/storebook/p/12694082.html
Copyright © 2020-2023  润新知