Important Concepts of databases

Source: Internet
Author: User

Some important concepts in database learning are as follows:

Http://hi.baidu.com/sundensky/item/5e5b075fb865d5424fff2014)

MACRO:

Relational databases, collections, databases, database objects, T-SQL statements, enterprise managers, transactions, locks, and database files.

Hard to understand:

Cursors (t-SQL statements), triggers, and stored procedures (database objects ).

In addition:
Permission, backup, and recovery.


1. Why is relational database set-oriented?
In VB, the idea of object-oriented is to call all things in VB as objects, and then "targeting these objects" for engineering. Then, relational databases use datasets as the basis for operations. So what is a dataset?
A Data Set (or dataset) is a collection of data, usually in the form of tables. Each column represents a specific variable. Each row corresponds to a member's dataset. It lists the values for each variable, such as the height and weight of an object or a random number of values. Each value is called data. The number of rows. The data in this dataset may contain one or more members.
Http://baike.baidu.com/view/262162.htm
However, after the result set is checked, the idea of collection-oriented is confused.
Ii. Concepts of cursors:
1. Why should I introduce a cursor?
2. What is a cursor and what functions can it accomplish?
3. cursor type
4. Life Cycle of the cursor
5. Scope of the cursor
6. Use of cursors
Core understanding: it is a data buffer zone provided by the system for users to store the execution results of SQL statements, and the mechanism for extracting a record from the (Dataset) result set each time, that is, to store a dataset, and one-by-one access mechanism.
A cursor is a tool used to process multiple row records retrieved from a database using a SELECT statement. With the help of the cursor function, database applications can process a group of records one by one, processing one row at a time. Its implementation function is similar to the WHERE clause. It processes a row of records. The difference is that the WHERE clause can only process one record at a time. If there is a record in this set of records, to read them all, use ten where clauses. However, the cursor can be read one by one. Of course, loop statements are used (so pay attention to the endless loop ).
The cursor is for a result set and reads the records in its corresponding result set. Therefore, to use the cursor, you must first declare the cursor for this result set, you must close and release the cursor after use. Closing the cursor does not release the memory associated with the cursor. Closing the cursor only releases the lock associated with the cursor. To ensure that all resources used by the cursor are completely released, the cursor must be released.
A cursor is always associated with an SQL selection statement.

3. The first two concepts are the most difficult concepts for me to understand. The following will explain the concepts mentioned in the beginning.
1. Relational databases:
Stores data in the form of rows and columns. rows and columns form tables, and a group of tables form a database. Data records between tables are related. Such a database is called a relational database. As the name suggests, there is a relationship between rows, columns, and tables.
2. Set-oriented (unsolved)
3. database:
The objects to be processed by all computers are called data, and databases are the warehouses for organizing, storing, and managing data according to the data structure ".
Strictly speaking, a database is a collection of related data stored together. The data is structured and serves a variety of applications without harmful or unnecessary redundancy; data storage is independent of programs that use it. New data is inserted into the database, and the original data can be modified and retrieved in a public and controllable manner. When a system contains several fully separated databases, the system contains a "database set ".
4. database objects:
Is a component of the database, mainly including: Table/index/View/digoal/default/Rule/trigger/
Stored Procedure/user
5. T-SQL statement: (starting with SP)
T-SQL is an enhanced version of the standard SQL programming language, which is the main language for applications to communicate with SQL Server. The T-SQL provides standard SQL DDL and DML functions, along with extended functions, system pre-stored programs, and programming structures
(Such as if and while) make the program design more flexible. The functionality of the T-SQL continues to grow with the new SQL Server.
6. Enterprise Manager:
It is an application tool for databases. We can use this tool to perform many database operations, that is, a system tool and a platform for database management.
7. transactions:
A mechanism is an operation sequence. It contains a group of database operation commands. All the commands are submitted to the system as a whole, or the operation request is either executed or not executed. is an inseparable logical unit of work.
Transaction rollback transaction rollback means that when a statement in the transaction fails to be executed
To the transaction execution or a specified position.
8. Lock)
Resource Access is a restriction mechanism in multi-user environments. When a data source is locked, the data source has certain access restrictions.

9. cursor:
It is a data buffer that stores the execution results of SQL statements and extracts a record from the result set each time.

10. Stored Procedure storeprocedure
It is a set of SQL statement sets for specific functions that are compiled and stored in the database. Users specify the name of the stored procedure and provide parameters if the stored procedure has parameters to execute it.
Although stored procedures have both parameters and return values, the returned values of stored procedures are different from those of functions. The returned values only indicate whether the execution is successful or not and cannot be directly called as a function, that is, when a stored procedure is called the process name must contain exec Reserved Words

11. triggers
It is a special type of stored procedure, which is different from the Stored Procedure trigger that we introduced earlier. It is triggered by an event and executed. The stored procedure can be directly called by the stored procedure name. When an operation such as update insert Delete is performed on a table, the SQL server will automatically execute the operation.
The SQL statement defined by the trigger to ensure that data processing must comply with the rules defined by these SQL statements.

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.