zoukankan      html  css  js  c++  java
  • 初学者一些常用的SQL语句(一)

    一、数据库的创建
    create database 数据库名
    create database bbb
    二、表的创建
    ***[]:可选项
    *** null:空值 not null 不为空
    ***只有字符型能指定长度 char varchar nchar nvarchar
    create table 表名
    (列名1 类型 [not null],
    列名2 类型 [not null],...)
    创建表6-3 class
    create table class
    (classno char(8) not null,
    classname varchar(20) not null,
    departno char(2) not null)

    create table class
    (classno char(8) not null,
    classname varchar(20) not null,
    departno char(2) not null)


    create table student
    (stuno char(8) not null,
    stuname varchar(10) not null,
    pwd char(8) not null,
    classno char(8) not null)
    real 实数
    create table class11
    (couno char(3) not null,
    couname varchar(30) not null,
    kind char(8) not null,
    credit float not null,
    credit1 decimal(2,1) not null,
    teacher varchar(20) not null,
    departno varchar(2) not null,
    schooltime char(10) not null,
    limitnum int not null,
    willnum int not null,
    choosenum int not null)

    三,打开数据库
    use 数据库
    use student
    四.删除表
    drop table 表名
    drop table 学生信息

  • 相关阅读:
    路由守卫
    this.$nextTick() 的一些理解
    3d饼图
    element ui 可编辑的表格
    vue 路由传参
    vue+element ui 时间格式化
    element ui 选择期 传对象
    数据结构学习第十天
    数据结构学习第九天
    数据结构学习第八天
  • 原文地址:https://www.cnblogs.com/tcam/p/7596590.html
Copyright © 2011-2022 走看看