序列、索引
来源:互联网 发布:端游发展史 知乎 编辑:程序博客网 时间:2024/06/07 10:49
自增序列
-- Create sequence create sequence SDICT_IDminvalue 1maxvalue 99999999start with 193increment by 1cache 16order;oracle索引
-- Create tablecreate table DICT( id NUMBER(8) not null, type VARCHAR2(32), name VARCHAR2(64), value VARCHAR2(32))tablespace GBITS pctfree 10 initrans 1 maxtrans 255 storage ( initial 64K next 1M minextents 1 maxextents unlimited );-- Create/Recreate primary, unique and foreign key constraints alter table DICT add constraint PK_DICT_ID primary key (ID) using index tablespace GBITS pctfree 10 initrans 2 maxtrans 255 storage ( initial 64K next 1M minextents 1 maxextents unlimited );
mysql:
- DROP TABLE IF EXISTS `workers_info`;
- CREATE TABLE `workers_info` (
- `id` int(11) primary key NOT NULL AUTO_INCREMENT,
- `workername` varchar(20) NOT NULL,
- `sex` enum(F,M,S),
- `salary` int(11) DEFAULT '0',
- `email` varchar(30),
- `EmployedDates` date,
- `department` varchar(30),
- PRIMARY KEY (`id`)
- ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
- mysql> alter table workers_info ADD sex enum('F','M','S');
ALTER TABLE table_name ADD INDEX index_name (column_list)
ALTER TABLE table_name ADD UNIQUE (column_list)
ALTER TABLE table_name ADD PRIMARY KEY (column_list)
sqlserver:
drop table stuMarkscreate table stuMarks( ExamNo int identity(1,1) primary key, stuNo char(6) not null, writtenExam int not null, LabExam int not null)go-- 其中,列属性"identity(起始值,递增量)" 表示"ExamNo"列为自动编号, 也称为标识列ALTER TABLE cust_id ADD cust_id_seq number(9) identity(1,1)0 0
- 序列、索引
- 【序列】索引
- 序列数索引(排序索引)
- oracle索引与序列
- 关于索引和序列
- 索引、序列、视图
- 索引序列的应用
- 序列:索引,分片,运算
- 索引视图序列
- oracle索引与序列
- 视图、序列、索引、同义词
- 序列和索引
- oracle_序列、索引、同义词
- oracle索引与序列
- Oracle-序列、索引
- Oracle,视图,序列,索引
- 序列和索引
- 序列、索引、触发器
- 我在路上---贪懒
- CVPR 2016-12-01
- 2016/12/8 1003. 简单哈希
- 利用ajaxSubmit提交的时候,解决多个input name相同的问题
- javascript学习(四)表达式与运算符
- 序列、索引
- 【nova】nova resize,通过数据库修改flavor绕过迁移
- Kafka集群配置
- 【Spring】Spring高级话题-@Enable***注解的工作原理
- JavaSE学习(8) 排序
- laravel框架中使用QueryList插件采集数据
- 安装 Android_JDK遇到的问题(32位ubuntu16.4)
- 实习第四天
- 公共字符串长度问题求解——华为OJ题目