• ylbtech-dbs:ylbtech-2,PAM(个人资产管理系统)


    ylbtech-dbs:ylbtech-2,PAM(个人资产管理系统)

    -- =============================================
    -- Personal Assets Management(PAM)
    -- 个人资产管理系统
    -- yuanbo
    -- 21:45 2015/3/14
    -- =============================================

    1.A,数据库关系图(Database Diagram) 返回顶部
    1.B,数据库设计脚本(Database Design Script)返回顶部

    1.B.1,basic.sql

    -- =============================================
    -- Personal Assets Management(PAM)
    -- 个人资产管理系统
    -- yuanbo
    -- 21:45 2015/3/14
    -- =============================================
    USE master
    GO
    
    -- Drop the database if it already exists
    IF  EXISTS (
        SELECT name 
            FROM sys.databases 
            WHERE name = N'PurplePAM'
    )
    DROP DATABASE PurplePAM
    GO
    
    CREATE DATABASE PurplePAM
    GO
    use PurplePAM
    go
    go
    -- =============================================
    -- ylb:1,用户位置
    -- =============================================
    go
    -- =============================================
    -- ylb:1,帐户
    -- =============================================
    create table Account
    (
    accountId int identity(101001,1) primary key,    --编号【ID,PK】
    username varchar(400),    --用户名
    pwd varchar(400),        --密码
    intro varchar(400),        --个性签名
    
    pubdate datetime,        --注册时间
    [disable] bit    default(0)    --是否禁用 0:正常;1:禁用
    )
    go
    -- =============================================
    -- ylb:1,类别【2级层次】
    -- =============================================
    create table Category
    (
    categoryId int identity(101001,1) primary key,    --编号【ID,PK】
    categeryName varchar(400),    --类别名称
    baseId int default(-1),    --上级ID
    
    flagSystem bit    default(0),    --是否系统分类 0:系统(不许操作);1:用户
    flagVisable bit    default(0),    --是否可见 0:可见;1:隐藏
    [disable] bit    default(0),    --是否禁用 0:正常;1:禁用
    accountId int    --帐户ID【FK】
    )
    go
    -- =============================================
    -- ylb:1,标签
    -- =============================================
    create table Label
    (
    labelId int identity(101,1) primary key,    --编号【ID,PK】
    labelName varchar(400),    --标签
    
    accountId int    --帐户ID【FK】
    )
    go
    -- =============================================
    -- ylb:1,商品表(资产表)
    -- =============================================
    create table Product
    (
    productId int identity(101001,1) primary key,    --编号【ID,PK】
    productName varchar(400),    --商品名称
    
    unitprice decimal(6,2),    --单价
    number int,        --数量
    amount decimal,    --金额
    
    remark varchar(400),    --备注
    
    imgUrl varchar(400),    --商品图片【只允许一张】
    
    pubdate datetime,        --添加时间
    
    pubdate2 datetime,        --添加时间
    pubdate3 datetime,        --最后修改日期
    
    [disable] bit    default(0),    --是否禁用 0:正常;1:禁用
    
    accountId int,    --帐户ID【FK】
    categeryId int    --类别ID【FK】
    )
    go
    -- =============================================
    -- ylb:1,产品标签关系表
    -- =============================================
    create table ProductLabel
    (
    productLabelId int identity(101,1) primary key,    --编号【ID,PK】
    productId int,    --产品ID【FK】
    labelId int,    --标签ID【FK】
    
    accountId int    --帐户ID【FK】
    )
    View Code

    1.B.2,

    1.C,功能实现代码(Function Implementation Code)返回顶部
    warn 作者:ylbtech
    出处:http://ylbtech.cnblogs.com/
    本文版权归作者和博客园共有,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文连接,否则保留追究法律责任的权利。
  • 相关阅读:
    Elementary Methods in Number Theory Exercise 1.2.25
    Elementary Methods in Number Theory Exercise 1.2.14
    图解欧几里德算法
    图解欧几里德算法
    Elementary Methods in Number Theory Exercise 1.2.14
    Android中的长度单位详解(dp、sp、px、in、pt、mm)
    分享下多年积累的对JAVA程序员成长之路的总结
    android异常之都是deamon惹的祸The connection to adb is down, and a severe error has occured.
    TomatoCartv1.1.8.2部署时报错
    JavaScript浏览器对象之二Document对象
  • 原文地址:https://www.cnblogs.com/ylbtech/p/5058619.html
Copyright © 2020-2023  润新知