1、SQL Constraint

Integrity Constraints are used to apply business rules for the database tables.

The constraints available in SQL are Foreign Key, Not Null, Unique, Check.

Constraints can be defined in two ways
1) The constraints can be specified immediately after the column definition. This is called column-level definition.
2) The constraints can be specified after all the columns are defined. This is called table-level definition.

2、SQL Index

Index in sql is created on existing tables to retrieve the rows quickly.

When there are thousands of records in a table, retrieving information will take a long time. Therefore indexes are created on columns which are accessed frequently, so that the information can be retrieved quickly. Indexes can be created on a single column or a group of columns. When a index is created, it first sorts the data and then it assigns a ROWID for each row.

Syntax to create Index:

CREATE INDEX index_name
ON table_name (column_name1,column_name2...);

SQL Constraint/Index的更多相关文章

  1. SQL CREATE INDEX 语句

    CREATE INDEX 语句用于在表中创建索引. 在不读取整个表的情况下,索引使数据库应用程序可以更快地查找数据. 索引 您可以在表中创建索引,以便更加快速高效地查询数据. 用户无法看到索引,它们只 ...

  2. SQL DROP INDEX 语句

    SQL DROP INDEX 语句 我们可以使用 DROP INDEX 命令删除表格中的索引. 用于 Microsoft SQLJet (以及 Microsoft Access) 的语法: DROP ...

  3. SQL-W3School-高级:SQL CREATE INDEX 语句

    ylbtech-SQL-W3School-高级:SQL CREATE INDEX 语句 1.返回顶部 1. CREATE INDEX 语句用于在表中创建索引. 在不读取整个表的情况下,索引使数据库应用 ...

  4. The include feature of SQL Server Index

    1. Why we need the index 'include' feature? For SQLServer , the length of all the index key have a l ...

  5. substring 在C#,Javascript,SQL 中index开始值

    substring函数index参数在三个平台的开始值: 平台 index参数开始值 C# 0 Javascript 0 SQL 1

  6. SQL CREATE INDEX

    n relational database, Index will be the important mechanism for boosting performance. Index is impo ...

  7. [SQL Server]Index/deadlock

    http://www.cnblogs.com/tintown/archive/2005/04/24/144272.html http://coolshell.cn/ http://blogs.msdn ...

  8. SQL Server Index详解

    最近在进行数据库调优,对索引的使用和其内部的运转一知半解.在园子里看到一篇相关文章非常好.留下印记以便日常查找. http://www.cnblogs.com/xwdreamer/archive/20 ...

  9. 转:Sql Server中的表访问方式Table Scan, Index Scan, Index Seek

    0.参考文献 Table Scan, Index Scan, Index Seek SQL SERVER – Index Seek vs. Index Scan – Diffefence and Us ...

随机推荐

  1. centos7 挂载ntfs移动硬盘

    第一步:下载安装rpmforge ,下载地址 http://pkgs.repoforge.org/rpmforge-release/  安装 rpm -ivh rpmforge-release-0.5 ...

  2. 教你50招提升ASP.NET性能(四):精选的技巧

    (4)A selection of tips 招数4: 精选的技巧 Make sure HTTP compression is turned on for any uncompressed conte ...

  3. AndroidStudio快捷键汇总

    最近开始全面转向Android Studio开发了,经常要去查快捷键,索性汇总下,自己方便查找 IDE 按键 说明 F1 帮助 Alt(Option)+F1 查找文件所在目录位置 Alt(Option ...

  4. Objective-C 调用C++,C

    1. 建立一个C++类 2. 写一个Adaptor的Objective-C类 3. 在其他Objective-C的逻辑中调用Adaptor类. 1.C++类 // // CPlusPlusClass. ...

  5. Sql Server问题集锦

    Sql数据库默认实例和命名实例的区别: 1.服务中服务名称的区别: 默认实例:MSSQLSERVER; 命名实例:实列名为:benet,在服务中的名称是:MSSQL$BENET;   注:如果你有多个 ...

  6. [RxJS] ReplaySubject

    A ReplaySubject caches its values and re-emits them to any Observer that subscrubes late to it. Unli ...

  7. C++ Primer 学习笔记_95_用于大型程序的工具 --多重继承与虚继承

    用于大型程序的工具 --多重继承与虚继承 引言: 大多数应用程序使用单个基类的公用继承,可是,在某些情况下,单继承是不够用的,由于可能无法为问题域建模,或者会对模型带来不必要的复杂性. 在这些情况下, ...

  8. ajax表单提交插件jquery.form.js的运用

    该插件提交的数据包含上传的图片. 1.先导入jquery.form.js 2.form表单的元素: <form id="form2_form" method="po ...

  9. 使用pypi镜像源加速第三方库在线安装

    用easy_install和pip来安装第三方库很方便 它们的原理其实就是从Python的官方源pypi.python.org/pypi 下载到本地,然后解包安装. 不过因为某些原因,访问官方的pyp ...

  10. VC depends使用说明

    Depends用来显示与一个可执行文件(exe或者dll)相关的依赖项(动态链接库dll),以及该exe或dll引用了这些dll中的哪些接口,同时也可以看到每个被依赖的dll中的所有导出的函数接口. ...