C/C ++ written question 03-Database

Source: Internet
Author: User

1. What is a stored procedure? What is the purpose? What are the advantages?

Stored Procedure is a set of SQL statements for specific functions. It is compiled and Stored in the database, you can run a stored procedure by specifying its name and providing parameters (if the stored procedure has parameters.

Stored procedures are used to implement frequently-used queries, business rules, and public routines used by other processes.

The stored procedure is compiled on the server when it is created, so it runs faster than a single SQL statement.


2. What happens if the database is full?

A: You can only perform read operations such as query, modification, backup, and other write operations, because logs must be recorded for any write operations. That is to say, it is basically in an unusable state.


3. Does SQL Server support row-level locks?

A: Yes. The blocking mechanism is mainly used to control concurrent operations and block interference to ensure data consistency and accuracy, row-level blocking ensures that the updated row is not modified by other users during this period. Therefore, row-level locks can ensure data consistency and improve the concurrency of data operations.


4. what can happen if the database is full?

A: see Figure 2.


5. How can I operate a table in the database and another table?

A: Put the operations that operate on multiple tables into transactions for processing.


6. How does a trigger work?

A: A trigger is executed when an event is triggered. When you perform operations such as UPDATE, INSERT, and DELETE on a table, the database will automatically execute the SQL statements defined by the trigger to ensure that the 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.