当前位置:网站首页>T-SQL language of SQL Server database
T-SQL language of SQL Server database
2022-04-21 18:42:00 【Mushroom poison】
T-SQL Language
1. summary
SQL Server All functions that can be accomplished using the graphical interface can be utilized T-SQL To achieve ;
Use T-SQL In operation , And SQL Server All references to the communication are sent to the server by T-SQL Statement , It has nothing to do with the interface of the application ;
T-SQL Generated by multiple applications , It mainly includes 9 Parts of :
- Through the office production process ;
- Use common language statements to determine the application of the data the user wants to query ;
- Using a graphical user interface GUI Applications for , Enables the user to select the tables and columns that contain the data to view ;
- Store its data with SQL Server Commercial applications in databases ; These applications can be applications from other vendors , It can also be an internally written application ;
- Use osql And other utilities T-SQL Script ;
- The development system implements an excuse for public database application (API, Such as ADO、OLE DB as well as ODBC) Created applications ;
- from SQL Server The database submits the data Web page ;
- Distributed database system , In this system, data is transferred from SQL Server Copy to various databases or execute distributed queries ;
- Database warehouse , From online transactions (OLTP) Extract data from the system , And summarize the data for decision support analysis , Can be carried out in this warehouse ;
2. T-SQL The composition of language
T-SQL As a process language , In addition to establishing a connection with the database 、 In addition to processing data , It also has the elements of procedural language : Batch command 、 identifier 、 System function 、 expression 、 Variable 、 data type 、 Operator 、 Flow control statement 、 notes 、 Keep keywords, etc ;
T-SQL Several process language elements supported :
-
notes
notes Is a text string that is not executed in the program code ( Also known as annotation );
stay SQL Server in , Two types of comment characters can be used : One is ANSI Standard annotators “–”, It is used for Single-line comments ; The other is with C Program annotation symbols with the same language , namely “/**/”, For multiline comments ; -
Variable
Variable Is an essential part of language ;T-SQL There are two forms of variables in a language , One is user-defined local variables , A local variable is an object that can have a specific data type , Its scope of action is limited to Inside the program ;
local variable It can be used as a counter to calculate the number of times the loop is executed , Or control the number of times the fantasy is executed ; Using local variables can also save data values , For control flow statement testing and saving the value returned by the stored procedure , When a local variable is referenced, its name should be preceded by a flag“@”, And must first useDECLAREThe command cannot be used until it is defined ;
The other is provided by the system Global variables , The global variable is SQL Server Variables used inside the system , Its scope is not limited to a certain procedure , But any program can be called at any time ; Global variables usually store some SQL Server Configuration settings and statistics for ;
The user can use global variables to test the set value or... Of the system in the program T-SQL State value after command execution ; -
Operator
Operator It's some symbols , It can be used to perform arithmetic operators 、 String connection 、 Assignment and in field 、 Constant 、 Compare between variables ;
stay SQL Server in , There are six main categories of operators : Arithmetic operator 、 Assignment operator 、 An operator 、 Comparison operator 、 Logical operators 、 String concatenation operator ;
T-SQL It is also an important part of process control statements ,T-SQL The program block is inseparable from process control ;
3. T-SQL Sentence structure
T-SQL The referenced syntax diagram is as follows :

4. T-SQL sentence
utilize T-SQL , Users can create database devices 、 Databases and other database objects , Extract data from the database 、 Modifying data , Can also dynamically change SQL Server Settings in ;
By function ,SQL Language mainly includes : Data manipulation statement 、 Data definition statement 、 Data control statement ;
- Data operation statement (DML): It mainly includes the query of object database data 、 Insert 、 Delete 、 Modify the operating ;
- Data definition statement (DDL): Used to define the structure and organization of the stored database , And the relationship between data items , As shown in the table 、 View 、 Triggers and stored procedures ;
- Data control statement (DCL): Including data storage control and integrity control , To prevent illegal users from using and destroying data ;
4.1 Data definition statement (DDL)
Data definition statements are used to perform data tasks , Create the database and various objects in the database 、 Delete 、 Modification and other operations ;
DDL The main sentences and functions are shown in the following table :

4.2 Data operation statement (DML)
Data operation statements are used to operate various objects in the database 、 Retrieve and modify data ;
DML The main sentences and functions are shown in the following table :

4.3 Data control statement (DCL)
Data control statements are used for security management , Determine which users can view or modify data in the database ,DCL The main sentences and functions are shown in the following table :

版权声明
本文为[Mushroom poison]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204211835161928.html
边栏推荐
- CVPR2022 Oral | 多模态学习中的贡献不平衡问题
- Four digit C language composed of Statistics
- Appium principle and jsonwp protocol analysis of automatic testing of dry goods app
- Can we find the next "cheese stick" product in the 2022 Q1 financial report of miaolando?
- C#多线去对数据库进行添加操作,ManualResetEvent报The number of WaitHandles must be less than or
- Single case model of hand tear
- 如何用PS制作动图
- 高等数学公式(第5部分)
- Frida hook variable parameters
- Singleton mode you have to know the underlying principle
猜你喜欢

Frida hook variable parameters

妙可蓝多的2022年Q1财报中,能否发现下一个“奶酪棒”产品?

C language operator summary
![[short-time amplitude spectrum] matlab simulation of short-time amplitude spectrum estimation in speech enhancement](/img/b5/a3843896a33bdb94dead3a9be489b8.png)
[short-time amplitude spectrum] matlab simulation of short-time amplitude spectrum estimation in speech enhancement

终于搞定微信扫码登录了,真香。。

MySQL数据库学习---第六章多表查询的课后习题

天创速盈简述静态创意是怎么收费的呢?

Les produits qui ont été achetés sont de retour.

Les poignées vous apprennent à construire des composants et des applications

A simple and easy-to-use file upload scheme
随机推荐
【GAMES101】作业5 简单光线追踪与框架理解
Hero King C language
MySQL安装的初始密码在哪看?
cnpm|npm设置镜像地址操作
Single case model of hand tear
Kotlin | these things you should know about lazy
曾經被爆買的產品又來了,求穩買他准沒錯
No more simple intention lock
Digital IC tutorial 02 quartz prime and Modelsim installation tutorial
Comment voir la structure zskiplist dans le code source redis
How to parameterize use cases for dry goods app automation
On caching in Hibernate
可愛的Tommy C語言
Target penetration exercise 77-dc9
CVPR2022 Oral | 多模态学习中的贡献不平衡问题
启牛证券账户app怎么样?谁开户了?安全吗?
业绩最好 C语言
Calculation method of MATLAB: e
初始redis基础了解
The central bank defines the key points of payment supervision in 2022, and all platform enterprises should pay attention to clearing risks