4.1 The nature of SQL

Source: Internet
Author: User
Tags what sql

For the early relational database, the whole industry made a lot of efforts to unify the different specialized query languages. IBM has established an early standard, known as structured English Query Language, which is abbreviated as sequel. Another language, called the Select query Language (LANGUAGE,SQL), contains commands that read data only for the purposes of making reports and finding records. When the language becomes a popular, product-independent standard, database people are still insisting on using the acronym sequel. Finally, by adding a number of commands, the database can be added, deleted, modify the record operation. But there is a dilemma: they have struggled to create a standard language, but this lovely name is inappropriate. The last select was replaced by structured, so the whole industry's debates tended to ease. Of course, Orthodox people insist on reading SQL as ESS CUE el instead of sequel. So, how should we read the word? It's all good to read, but I choose to omit a syllable and read it as a sequel (though you might disagree with this reading). To make the SQL language independent of a particular product or company, the SQL Standard is published and held by a separate, standardized organization. The SQL standard was originally registered by the National Standards Association, the official name is the ANSI SQL standard, published in 1986. This standard has been revised several times, and these revisions are as follows:

ANSI SQL-86

ANSI SQL-89

ANSI SQL-92

ANSI sql:1999

ANSI sql:2003

ANSI sql:2006

Although the concept seems simple, there are some stories. In fact, the ANSI SQL standard at this time is no longer exclusively owned by the National Standards Institute-the American Native standard has been adopted worldwide. In 1987, SQL became an international standard, and the registrant was the International Organization for Standardization (ISO), but still used the previous copyright name, ANSI SQL. This means that the 1992 revision of the SQL standard is actually called the ISO ANSI SQL-92. Although this standard was revised separately in 1999, 2003 and 2006, most SQL-based database products are still built on the ANSI SQL-92 standard and have not been modified to fully conform to the ANSI SQL-99, 2003, or 2006 specifications. Like most of its competitors, T-SQL does not fully conform to the recent ANSI standard, but it implements some of these features.

Finally, the ANSI SQL standard actually defines three levels of compatibility: entry-level, intermediate-level, and full-scale. Most products, including SQL Server, are fully compliant with entry-level standards, partly in line with higher standards.

4.1 The nature of SQL

Many people who use T-SQL have experience with other languages. If the user has never been in touch with programming, please do not close the book and give up. Programming experience is not a prerequisite for writing SQL, but it can be used as a reference for people who have used other languages of the computer system.

Comparing T-SQL to a procedural or object-oriented programming language (such as Java, C, C + +, C #, or Visual Basic), as compared to apples and pomegranates, is no better or worse, even if there is a similarity in syntax or in the structure of some statements, But there is a big difference between SQL and the real programming language. For different types of operations, T-SQL may be much more advanced or worse than these languages because they achieve different goals. It is difficult to generalize the functionality of different languages because they are evolving, one version after another, adding more and more features. The problem with industry standards is that everyone is protecting and enhancing their products. Over time, the functionality of each technology (here, the programming language) begins to overlap, providing a whole bunch of different options to accomplish the same task.

is it possible to use a procedural programming language to accomplish data access or data manipulation (inserting, modifying, or deleting values in a database) without using SQL? The answer is yes, but it's clumsy and often inefficient. can you implement complex mathematical operations, loops, string parsing, and multidimensional array management in T-SQL? Yes, but it will take a lot of time and effort. The 1th chapter mentions that SQL Server 2005 allows programmers to write stored procedures and user-defined functions entirely using object-oriented program code rather than SQL, which does not give the SQL Server local language the T-SQL a performance flaw, but only gives the programmer another option.

T-SQL is primarily used for relational data operations, which is nothing to be surprised about. T-SQL also has many useful functions to implement scalar (single-valued) data manipulation, logical operations, mathematical calculations, decision structures, text string parsing, and looping mechanisms. However, compared to most programming languages, SQL is not as powerful as a real programming language. If you need to go beyond the SQL-scoped advanced features, consider using another method, such as custom extended stored procedures, application programming interfaces (APIs),. NET assemblies or other programming solutions. Therefore, SQL Server Integration Services can use either programming code or T-SQL. After solving this problem, you should now know what T-SQL can do? It's very much. So what do you do with T-SQL? This is a better question. I hope the reader can find out the answer after reading this chapter.

T-SQL is a language that is communicated with SQL Server, and query expressions are used primarily to tell the server what to do. Be sure to know what you can ask SQL Server to do and what SQL Server can do. Query operations can be divided into three categories, briefly describing them below, and then explaining a few examples. Like everything in the world of technology, these categories are represented by three-letter abbreviations (Three-letter Abbreviations,tla), which are described in the following order:

Data definition Language (LANGUAGE,DDL): Used to create and manage objects in a database. DLL statements can create, modify, and delete databases, tables, indexes, views, stored procedures, and other objects. such as create/alter and drop.

Data Control Language (LANGUAGE,DCL): DCL statements are used to control security permissions for users and database objects. Some objects have different permission sets. You can grant or deny these permissions to specific users or groups of users. These users or groups of users belong to a database role or to a Windows user group (such as Grant, REVOKE, and deny).

Data manipulation language (manipulation LANGUAGE,DML): DML statements are used to process data, including data retrieval, inserting rows in a table, modifying values, deleting rows, and so on. Examples include SELECT, INSERT, update, and delete.

"Editor: Clouds TEL: (010) 68476606"

4.1 The nature of SQL

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.