Practical Analysis Strategies for SQL Questions

  • First get the sql question, and then disassemble it according to the following strategy

  • (1) Split the table and match the fields with the processing answers required by the question.
  • (2) Confirm the requirements for processing the answer. At this time, list the functions that need to be used. The commonly used functions are count(), coalesce()sum()greastest()position()round()month_between()trunc(,' MM'),TRUNC(,'Q'),TRUNC(,'DD'),row_number()over(partition by order by )
  • (3) Confirm the association scheme of the table and confirm whether the data is duplicated and deduplicated.
  • (4) Determine the conditions for the main schedule and the appendix
  • (5) Splice the integrated main schedule statements together
  • (6) If there is no problem after running, consider time optimization (whether statement optimization is indexing, server optimization, hardware optimization)
  • (7) If an error is reported after submission, first read the error message, integrate the error code, and organize the data and statements of the source of the error.

Guess you like

Origin blog.csdn.net/wtfsb/article/details/131148564