Home Database Mysql Tutorial 事物索引视图

事物索引视图

Jun 07, 2016 pm 05:45 PM
index view

虽然学过SQLServer,但是在脑海里总是觉得很乱,并且有很多疑问和盲点,如今走入工作岗位,那么这些关于自己知识和技术的漏洞是不应该存在了,至少学一种语言或是技术,最起码要知道是什么、做什么、有什么用、什么时候用、怎么用。如果连这一点都不是很清楚

虽然学过SQLServer,但是在脑海里总是觉得很乱,并且有很多疑问和盲点,如今走入工作岗位,那么这些关于自己知识和技术的漏洞是不应该存在了,至少学一种语言或是技术,最起码要知道是什么、做什么、有什么用、什么时候用、怎么用。如果连这一点都不是很清楚的话那么我不敢相信你做出来的东西有多好,香港服务器,有多强。以前在学习的时候,总觉得这些理论知识,自己知道就行了,不必太在意,会操作,能使用就行了,可是如今我不这么认为了,可能这些很基础的理论知识学起来很抽象,很枯燥,但是他们真的很有用。作为一名技术人员,没有清晰透彻的理论作为基础,那么在技术这条道路上是走不远,飞不高的。。。最近我在业余时间抽空复习自己所学的东西,找到一些不错的资料,在此分享给正在学习中的朋友们,我相信这些资源对你们的学习是很有用的。好了,废话有点多了,咱们开始吧。声明:一下内容是我转载的一些内容,稍作些许加工,以下有地址来源。。。 SQL教程: 事务

我们知道各种子查询的用法,包括简单子查询、IN子查询和EXISTS子查询。除此之外,我们在实际开发中还会用到一些比较特殊的高级查询,包括事务、索引和视图。

例如,银行转账问题:假定资金从账户A转到账户B,至少需要两步,网站空间,即账户A的资金减少,然后账户B的资金相应增加。在进行资金转账时,系统必须保证:这些步骤是一个整体,如果其间任一步骤失败,则将撤销对这两个账户数据所做的任何修改,这时就需要使用事务处理。事务是指一个工作单元,该单元可以包含多个步骤来完成所需的任务。一个事务作为一个整体,要么成功,要么失败。

正如汉语字典中的汉字按页存放一样,SQL Server中的数据记录也是按页存放的,每页容量一般为4KB。为了加快查找的速度,汉语字(词)典一般都有按拼音、笔画、偏旁部首等排序的目录(索引),我们可以选择按拼音或笔画查找,快速查找到需要的字(词)。同理,SQL Server允许用户在表中创建索引,指定按某列预先排序,从而大大提高查询速度。

同一星球,用望远镜从不同的角度或方位观看,将看到星球的不同位置,从而得到不同的结果。同一张员工信息表数据,因为公司保密的原因,可能要求不同权限的人员看到不同的员工信息。例如:财务人员只能查看员工的姓名、工资、奖金等;技术部经理只能查看员工的姓名,职称、技能等;人事部经理只能查看员工的姓名、工作经历和发展方向等;总经理当然可以全部查看。如何更加安全、直观地显示数据结果呢?SQL Server中允许用户创建视图,在同一原始数据表的基础上,为不同的用户选择不同的列,从而达到不同用户的需求。

下面我们将详细讨论事务、索引和视图的具体使用。

事务(Transaction)是单个的工作单元。如果某一事务成功,则在该事务中进行的所有数据更改均会提交,香港虚拟主机,成为数据库中的永久组成部分。如果事务遇到错误且必须取消或回滚,则所有数据更改均被清除。

一、为什么需要事务

一般来说,只要是同一银行(例如都是农行),一般都支持账户间直接转账。我们来看看上述提及的转账问题,假定张三的账户直接转账1000元到李四的账户,就需要创建账户表,存放用户的账户信息,T-SQL语句如示例1

/* stuDB (sysobjects ) DROP TABLE bank bank ( customerName CHAR(10), --顾客姓名 currentMoney ) bank ) bank(customerName,currentMoney) ,1000) ,1) bank --customerNamebank customerName bank GO

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Roblox: Bubble Gum Simulator Infinity - How To Get And Use Royal Keys
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Nordhold: Fusion System, Explained
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Mandragora: Whispers Of The Witch Tree - How To Unlock The Grappling Hook
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Hot Topics

Java Tutorial
1664
14
PHP Tutorial
1269
29
C# Tutorial
1249
24
How to implement editable tables in Vue How to implement editable tables in Vue Nov 08, 2023 pm 12:51 PM

Tables are an essential component in many web applications. Tables usually have large amounts of data, so tables require some specific features to improve user experience. One of the important features is editability. In this article, we will explore how to implement editable tables using Vue.js and provide specific code examples. Step 1: Prepare the data First, we need to prepare the data for the table. We can use a JSON object to store the table's data and store it in the data property of the Vue instance. In this case

What are the Oracle index types? What are the Oracle index types? Nov 16, 2023 am 09:59 AM

Oracle index types include: 1. B-Tree index; 2. Bitmap index; 3. Function index; 4. Hash index; 5. Reverse key index; 6. Local index; 7. Global index; 8. Domain index ; 9. Bitmap connection index; 10. Composite index. Detailed introduction: 1. B-Tree index is a self-balancing tree data structure that can efficiently support concurrent operations. In Oracle database, B-Tree index is the most commonly used index type; 2. Bit Graph index is an index type based on bitmap algorithm and so on.

Understand the differences and comparisons between SpringBoot and SpringMVC Understand the differences and comparisons between SpringBoot and SpringMVC Dec 29, 2023 am 09:20 AM

Compare SpringBoot and SpringMVC and understand their differences. With the continuous development of Java development, the Spring framework has become the first choice for many developers and enterprises. In the Spring ecosystem, SpringBoot and SpringMVC are two very important components. Although they are both based on the Spring framework, there are some differences in functions and usage. This article will focus on comparing SpringBoot and Spring

What are the views in Word? What are the views in Word? Mar 19, 2024 pm 06:10 PM

I guess that many students want to learn the typesetting skills of Word, but the editor secretly tells you that before learning the typesetting skills, you need to understand the word views clearly. In Word2007, 5 views are provided for users to choose. These 5 views include pages. View, reading layout view, web layout view, outline view and normal view, let’s learn about these 5 word views with the editor today. 1. Page view Page view can display the appearance of the print result of the Word2007 document, which mainly includes headers, footers, graphic objects, column settings, page margins and other elements. It is the page view closest to the print result. 2. Reading layout view Reading layout view displays Word2007 documents and Office in the column style of a book

PHP returns the string from the start position to the end position of a string in another string PHP returns the string from the start position to the end position of a string in another string Mar 21, 2024 am 10:31 AM

This article will explain in detail how PHP returns the string from the start position to the end position of a string in another string. The editor thinks it is quite practical, so I share it with you as a reference. I hope you will finish reading this article. You can gain something from this article. Use the substr() function in PHP to extract substrings from a string. The substr() function can extract characters within a specified range from a string. The syntax is as follows: substr(string,start,length) where: string: the original string from which the substring is to be extracted. start: The index of the starting position of the substring (starting from 0). length (optional): The length of the substring. If not specified, then

How to improve the efficiency of data grouping and data aggregation in PHP and MySQL through indexes? How to improve the efficiency of data grouping and data aggregation in PHP and MySQL through indexes? Oct 15, 2023 am 11:39 AM

How to improve the efficiency of data grouping and data aggregation in PHP and MySQL through indexes? Introduction: PHP and MySQL are currently the most widely used programming languages ​​and database management systems, and are often used to build web applications and process large amounts of data. Data grouping and data aggregation are common operations when processing large amounts of data, but if indexes are not designed and used appropriately, these operations can become very inefficient. This article will introduce how to use indexes to improve the efficiency of data grouping and data aggregation in PHP and MySQL, and improve

How to solve the problem that the index exceeds the array limit How to solve the problem that the index exceeds the array limit Nov 15, 2023 pm 05:22 PM

The solutions are: 1. Check whether the index value is correct: first confirm whether your index value exceeds the length range of the array. The index of the array starts from 0, so the maximum index value should be the array length minus 1; 2. Check the loop boundary conditions: If you use the index for array access in a loop, make sure the loop boundary conditions are correct; 3. Initialize the array: Before using an array, make sure that the array has been initialized correctly; 4. Use exception handling: You can use the exception handling mechanism in the program to catch errors where the index exceeds the bounds of the array, and handle it accordingly.

Microsoft updates Visual Studio Code 1.80 Microsoft updates Visual Studio Code 1.80 Jul 10, 2023 pm 08:13 PM

Microsoft recently launched Visual Studio Code 1.80. Although this update was released in July, the official still calls it the June update. After users install this update, the built-in terminal can directly display images, and auxiliary functions have also been optimized. In the previously released preview version of Visual Studio Code, support for images in the terminal has been supported, and it is enabled by default in the new 1.80 version. In order to be able to display the image in the terminal, the image pixel data is converted into text through a special escape sequence and finally written to the terminal. If you want to pipe typical PNG, GIF or JPEG files to the terminal, you need to install the imgcatpython package and then run imgc in the terminal

See all articles