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 学生信息

  • 相关阅读:
    服务器端口
    Format(const wchar_t *,...)”: 不能将参数 1 从“const char [3]”转换为“const wchar_t *”.
    图片格式
    CreateEx
    电力谐波
    [OGeek2019]babyrop
    Simple Inject
    [GXYCTF2019]BabySQli
    [CISCN2019 华北赛区 Day2 Web1]Hack World
    极客大挑战2019
  • 原文地址:https://www.cnblogs.com/tcam/p/7596590.html
Copyright © 2011-2022 走看看