SQL and PLSQL development practices

Source: Internet
Author: User

Editor's note: when talking about performance optimization and cases, we need to think about how to understand from the developer's perspective, how to execute SQL, and how to learn advanced SQL, this article provides a brief summary of the above issues.

 

▲Itpub moderator Ding Jun

 

▲Comprehensive oracle SQL Knowledge System

Speaking of the logic and physical execution sequence of SQL, Ding Jun mentioned two points: 1. Understanding the logic execution sequence of SQL can greatly reduce the compilation of erroneous SQL statements. 2. Understanding the logic execution sequence of SQL can deepen the understanding of SQL and facilitate the processing of more complex business logic.

 

▲Understand the logic and physical execution sequence of SQL

PLSQL is a good supplement to SQL.

 

▲Understand the logic of SQL and the logic sequence of physical execution.

The physical EXECUTION sequence of SQL statements is the actual EXECUTION PATH. The physical EXECUTION sequence depends on the CBO optimizer component and is very complicated.

 

▲Introduction to the logic and physical execution sequence of SQL

 

▲Understanding of the logic and physical execution sequence of SQL

 

▲Learn how to learn SQL from analysis functions

Extract analysis function features from documents:

The analysis function relies on the analysis clause to analyze the group to which the current row belongs. It is used to calculate complex inter-line and accumulative values.

The analysis function is different from the group function. According to the characteristics of 1, the analysis function can calculate the group value and retain the values of other columns in the current row. -- Important features

Analysis Function Classification: ranking (rank, dense_rank, row_number, first/last, ntile, etc.), aggregate report functions (sum, count, and ratio_to_report), row comparison (lead/lag, first_value/last_value), mathematical statistics (stddev, var_pop, etc.) and other functions.

How to Learn SQL summary from Analysis Function Learning

Analysis functions can implement complex inter-line computing functions, such as accumulative values, comparison between rows, and report statistics. To learn and analyze functions, you must grasp the characteristics of each analysis function and master the relationship between key elements in the analysis function, such as the difference between ROWS and RANGE, and the relationship between window clauses and partition and order, master the concepts of windows and current rows. ORACLE also supports custom Aggregate functions to implement analysis functions. For details, refer to Data Cartridge Developer's Guide.

Related Article

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.