随笔分类 - 数据库相关
摘要:一、约束 1)主键 主键约束=非空约束+唯一约束 主键可以是一个列或者多个列 1)创表添加多个列作为主键 create table score1( sid int not null, cid int not null, PRIMARY key(sid,cid) ); 2)删除主键约束 alter t
阅读全文
摘要:一、约束 1)主键 主键约束=非空约束+唯一约束 主键可以是一个列或者多个列 1)创表添加多个列作为主键 create table score1( sid int not null, cid int not null, PRIMARY key(sid,cid) ); 2)删除主键约束 alter t
阅读全文
摘要:创建数据库 create database; 创建表 create table t1(id int not null auto_increment primary key, name varchar(20) not null, age varchar(20) not null, unique nam
阅读全文
浙公网安备 33010602011771号