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. CSS modules 与 React中实践

    最近一直在学习React,看上去蛮简单的内容,其实学习曲线还是比较高的. 目前学到css绑定的问题,看到有一篇好的文章,就转过来了. CSS 模块化的解决方案有很多,但主要有两类.一类是彻底抛弃 CS ...

  2. xcode中create groups 和 create folder reference 的区别

    (文章为博主原创,未经允许,不得转载!) 今天在项目中搭建框架忽然发现工程中有黄蓝文件夹的区别,而且对应到不同的情况: 1.蓝色文件夹下文件不能被读取: 2.蓝色文件夹下创建新的文件类会直接跳过选择类 ...

  3. IPv6介绍

    一.为什么需要IPv6 为了扩大地址空间,拟通过IPv6重新定义地址空间.IPv4采用32位地址长度,只有大约43亿个地址,估计在2005-2010年间将被分配完毕,而IPv6采用128位地址长度,几 ...

  4. C#-动态生成40个按钮,大小(20,20),要求每行6个放置

    应该为for (int i=0;i<基本数据DataSet3.Tables [0].Rows .Count ;i++)                 {                 int ...

  5. C#利用lambda表达式将函数作为参数或属性跨类传递

    在编码时,由于开始是在winform下进行简单的测试开发的,后来代码多了,就想分到不同的类里边去,可是因为原来的测试是在同一个form下的,所以对于函数调用可以很方便,而一旦跨类之后,就会发现,这函数 ...

  6. JNI总结(一)

    JNI 是 Java平台中的一个强大特性.应用程序能够通过 JNI把 C/C++代码集成进 Java程序中.通过 JNI.开发人员在利用 Java平台强大功能的同一时候,又不必放弃对原有代码的投资.由 ...

  7. EXE文件结构及读取方法

    一.EXE文件概念 EXE File英文全名executable file ,译作可运行文件,可移植可运行 (PE) 文件格式的文件,它能够载入到内存中,并由操作系统载入程序运行.是可在操作系统存储空 ...

  8. C#_MVC_Repository_CRUD_Model

    using System.Collections.Generic; using System.ComponentModel.DataAnnotations; namespace iFlytekDemo ...

  9. 设置su和sudo为不需要密码

    设置su和sudo为不需要密码 一 设置sudo为不需要密码   有时候我们只需要执行一条root权限的命令也要su到root,是不是有些不方便?这时可以用sudo代替.默认新建的用户不在sudo组, ...

  10. Porsche Piwis Tester II “No VCI has been detected”,how to do?

    Hi,Joy, I am sorry that my Porsche Piwis Tester II from your shop said “No VCI has been detected” wh ...