SQL Server2008基本CRUD用法和一些基础知识
2016-11-22 19:31
417 查看
CRUD的使用
1 CRUD简介
2 CRUD使用
基础知识
1 存储过程
2 事务
3 数据完整性
4 约束
5 试图
6 索引
7 触发器
1 CRUD简介
2 CRUD使用
基础知识
1 存储过程
2 事务
3 数据完整性
4 约束
5 试图
6 索引
7 触发器
1.CRUD的使用
1.1 CRUD简介
CRUD指的是--Create(创建)、Retrieve(读取查询)、Update(更新)、Delete(删除)四种数据库的基本用法。
1.Create: 1)创建数据库: if exists(select*from sysdatabases where name='db_name') drop database db_name go create database db_name 2)创建表: if exists(select*from sysobjects where name='table_name') drop table table_name go create table table_name() 2.Retrieve: 1)查询所有:select column_name(one or more) from table_name 2)条件查询:select column_name(o o m) from table_name where conditions 3)分页查询: select top ${next}(数据长度) column_name(o o m) from table_name where id not in(select top $ 9bee {jump}(数据起点) id from allstatus order by id desc) order by id desc 如: select top 3 * from Employee where employeeId not in(select top 1 employeeId from Employee order by employeeId desc) order by employeeId desc![这里写图片描述](https://img-blog.csdn.net/20161122192855617) select top 3 * from Employee where employeeId not in(select top 2 employeeId from Employee order by employeeId desc) order by employeeId desc![这里写图片描述](https://img-blog.csdn.net/20161122192933425) select top 4 * from Employee where employeeId not in(select top 1 employeeId from Employee order by employeeId desc) order by employeeId desc![这里写图片描述](https://img-blog.csdn.net/20161122193001285) --今天就到这,下次再写 --by 2016-11-22
1.2 CRUD使用
2.基础知识
2.1 存储过程
2.2 事务
2.3 数据完整性
2.4 约束
2.5 试图
2.6 索引
2.7 触发器
相关文章推荐
- SQLServer学习笔记<>.基础知识,一些基本命令,单表查询(null top用法,with ties附加属性,over开窗函数),排名函数
- KVC的一些基础知识和用法
- 计算机一些基本进制单位及细节基础知识
- C++学习(1)--基础知识(1)--一些基本的格式
- while()的一些基础知识与用法,及scanf返回值问题。(新人求罩^_^)
- UIImagePickerController 的基本用法 - iOS - UI基础知识总结14
- Linux的一些基本命令--入门级Linux基础知识
- 【Android基础知识】WebView基本用法
- 关于DSP的一些基本知识和用法(资料来源于合众达网页)
- c语言学习之基础知识点介绍(八):函数的基本用法
- 基础知识|数据库的一些基本概念
- 【基础知识】Oracle的一些基本操作和
- mongoDB基础知识2----基本操作(CRUD),索引(常见、全文、地理位置)
- [置顶] Android开发之数据存储——SharedPreferences基础知识详解,饿补学会基本知识,开发者必会它的用法。
- 密码学需要了解的一些基础术语和基本知识
- 计算机一些基本进制单位及细节基础知识
- WEB标准开发中的一些基本用法(连载中...)
- 关于DNS的一些基础知识
- [转载]关于数据库的一些基本知识
- 开始学习asp.net,一些基础的知识。