zoukankan      html  css  js  c++  java
  • MySQL数据库(增删查改)

    创建一个表:
    create table user(
    uid varchar(10) ,
    pwd int(10)
    );
    学生表:
    create table student(
    sno varchar(20) not null primary key comment '学号' ,
    sname varchar(20) not null comment '学生姓名' ,
    ssex varchar(20) not null comment '学生性别' ,
    sbirthday datetime comment '学生出生年月' ,
    class varchar(20) comment '学生所在班级'

    );
    课程表:
    create table course(
    con varchar(20) not null primary key comment '课程号' ,
    cname varchar(20) not null comment '课程名称' ,
    ton varchar(20) not null comment '教工编号'

    );
    成绩表:
    create table score(
    id int primary key auto_increment,
    sno varchar(20) not null comment '学号' ,
    con varchar(20) not null comment '课程号' ,
    degree decimal(4,1) not null comment '成绩'

    );
    教师表:
    create table teacher(
    tno varchar(20) not null primary key comment '教工编号',
    tname varchar(20) not null comment '教工姓名',
    tsex varchar(20) not null comment '教工性别' ,
    tbirthday datetime comment '教工出生年月' ,
    prof varchar(20) comment '职称',
    depart varchar(20) not null comment '教工所在部门'
    );

    插入数据:
    use z_0705;
    set names gbk;
    insert into students1 values
    ('108','曾华','男','1977-09-01','95033'),
    ('105','匡明','男','1975-10-02','95031'),
    ('107','王丽','女','1976-01-23','95033'),
    ('101','李军','男','1976-02-20','95033'),
    ('109','王芳','女','1975-02-10','95031'),
    ('103','陆君','男','1974-06-03','95031');

    desc students1 查看表结构
    select * from students1 查看表里的数据
    show create table students1:查看表的具体信息

    drop databases 数据库名;

    drop table 表名;

    use 数据库名 ;进入数据库

  • 相关阅读:
    http协议
    web应用
    前端基础-jquery
    jQuery的事件
    2.UML类图基本介绍
    1.设计模式的七大原则
    使用OpenFeign远程调用时请求头处理报错问题
    SpringCloud Config-分布式配置中心
    19. 类加载器详解
    18. 类加载过程详解
  • 原文地址:https://www.cnblogs.com/awdsjk/p/9481255.html
Copyright © 2011-2022 走看看