zoukankan      html  css  js  c++  java
  • create table常用命令

    CREATE TABLE students(  
      stuID INTEGER     NOT NULL ,  
      stuname char(30)     not null,   
      sex     int     NOT NULL  
    );  
    CREATE TABLE students(  
      stuID INTEGER     NOT NULL ,  
      stuname char(30)     not null,  
      sex     int     NOT NULL,  
      PRIMARY KEY (stuID)  
    );  
    CREATE TABLE students(  
      stuID INTEGER     NOT NULL PRIMARY KEY,  
      stuname char(30)     not null,  
      sex     int     NOT NULL  
    );  
    CREATE TABLE score(  
      scoreID INTEGER NOT NULL PRIMARY KEY,  
      stuID     INTEGER NOT NULL,  
      KEMUID     INTEGER NOT NULL,  
      score     FLOAT,  
      FOREIGN KEY SCORE_ID_FK (stuID) REFERENCES students (stuid),  
      CONSTRAINT CHK_SCORE_ZIP CHECK (SCORE > 0)  
    );  
    show tables;  
    insert into students values(1,'张三',1);  
    SELECT * FROM STUDENTS;  
    INSERT INTO STUDENTS  
    SELECT * FROM STUDENTS;  
    DELETE STUDENTS FROM STUDENTS  
    WHERE stuID = 1;  
    DROP TABLE STUDENTS;  
    ALTER TABLE STUDENTS ADD CONSTRAINT PRIMARY KEY (stuID);  
    ALTER TABLE STUDENTS ADD PRIMARY KEY (stuID); 
  • 相关阅读:
    MODBUS 数据格式相关记录
    STM32Cube基础工程配置
    QT5学习记录(一)
    求最大值
    算法训练方格取数
    传纸条
    分组背包
    混合背包
    二维背包
    多重背包
  • 原文地址:https://www.cnblogs.com/wgphp/p/8119025.html
Copyright © 2011-2022 走看看