程序師世界是廣大編程愛好者互助、分享、學習的平台,程序師世界有你更精彩!
首頁
編程語言
C語言|JAVA編程
Python編程
網頁編程
ASP編程|PHP編程
JSP編程
數據庫知識
MYSQL數據庫|SqlServer數據庫
Oracle數據庫|DB2數據庫
 程式師世界 >> 數據庫知識 >> SyBase數據庫 >> SyBase教程 >> CREATETABLE常用命令

CREATETABLE常用命令

編輯:SyBase教程

CREATETABLE常用命令


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);


  1. 上一頁:
  2. 下一頁:
Copyright © 程式師世界 All Rights Reserved