• emmm......就当练习系列22(好久不见╮(╯▽╰)╭)


    作业布置

    练习:账号信息表,用户组,主机表,主机组

    #用户表
    create table user(
    id int not null unique auto_increment,
    username varchar(20) not null,
    password varchar(50) not null,
    primary key(username,password)
    );
    
    #用户组表
    create table usergroup(
    id int primary key auto_increment,
    groupname varchar(20) not null unique
    );
    
    #主机表
    create table host(
    id int primary key auto_increment,
    ip char(15) not null unique default '127.0.0.1'
    );
    
    #业务线表
    create table business(
    id int primary key auto_increment,
    business varchar(20) not null unique
    );
    
    #建关系:user与usergroup
    
    create table user2usergroup(
    id int not null unique auto_increment,
    user_id int not null,
    group_id int not null,
    primary key(user_id,group_id),
    foreign key(user_id) references user(id),
    foreign key(group_id) references usergroup(id)
    );
    
    #建关系:host与business
    create table host2business(
    id int not null unique auto_increment,
    host_id int not null,
    business_id int not null,
    primary key(host_id,business_id),
    foreign key(host_id) references host(id),
    foreign key(business_id) references business(id)
    );
    
    #建关系:user与host
    create table user2host(
    id int not null unique auto_increment,
    user_id int not null,
    host_id int not null,
    primary key(user_id,host_id),
    foreign key(user_id) references user(id),
    foreign key(host_id) references host(id)
    );

    练习:

    # 班级表
    cid	caption
    # 学生表
    sid sname gender class_id
    # 老师表
    tid	tname
    # 课程表
    cid	cname	teacher_id
    # 成绩表
    sid	student_id course_id number
  • 相关阅读:
    ASP扫盲学习班第六课 添加新保存的数据
    三级联动菜单免刷新加载
    ASP按定制格式导出word文件的完美解决思路
    通用客户资源管理系统(客户资料保护库)
    SmR 通用信息采集系统(新闻小偷)
    ASP扫盲学习班第三课 程序界面的设计
    我的新作品(单身贵族网全站)
    《将博客搬至CSDN》
    我的新作品
    asp函数大全
  • 原文地址:https://www.cnblogs.com/lucky-cat233/p/12831252.html
Copyright © 2020-2023  润新知