|
所在平台: Udemy |
课程主页: https://www.udemy.com/course/sql-server-part2-intermediate-level/
课程评论:没有评论
SQL Server Part 2 - 进阶 SQL Server 课程总结 本课程是 SQL Server 系列的第二部分,重点介绍一系列进阶 SQL Server 概念,帮助您更有效地查询和处理数据。 **您将学到:** * **子查询(内查询):** 学习如何在 SELECT、FROM 或 WHERE 子句中使用嵌套的查询来动态过滤和组织您的查询结果。 * **嵌套子查询:** 理解如何将子查询嵌套在其他子查询中,以解决更复杂的数据问题。 * **ROW\_NUMBER(), RANK(), DENSE\_RANK() 结合 OVER():** 使用 OVER() 子句为结果集中的每一行生成行号和排名。 * ** OVER() 结合 PARTITION BY:** 使用 PARTITION BY 在每个分组(例如,按部门划分的排名)内重置行号或排名。 * **反向行号:** 在 OVER() 函数中使用 ORDER BY.DESC 创建降序排列的行号。 * **使用通配符搜索模式 (LIKE, %, \_):** 利用模式匹配进行灵活的字符串匹配(例如,查找以“A”开头或以“Z”结尾的姓名)。 * **RANK() vs. DENSE\_RANK():** 了解何时使用每个排名函数以及它们如何处理并列值。 * **IIF(condition, true, false) - 内联 IF:** 一个简洁的条件函数,允许您根据条件返回不同的值。 * **CASE...WHEN...THEN...ELSE...END:** 在查询中处理多个条件,类似于编程中的 IF...ELSE IF...ELSE 逻辑。了解这两种方法之间的区别以及何时选择它们。 * **OFFSET 和 FETCH NEXT:** 学习如何跳过行并获取特定数量的行,这对于分页和高效的数据浏览非常有用。
What You'll Learn - Key SQL Server Concepts (This is our PART2)Subqueries (Inner Queries):Learn to use queries inside SELECT, FROM, or WHERE to filter and shape your results dynamically.Nested Subqueries:Understand how to write subqueries inside other subqueries to solve more complex data problems.ROW_NUMBER(), RANK(), DENSE_RANK() with OVER():Generate row numbers and rankings for each row in a result set using the OVER() clause.OVER() with PARTITION BY:Reset row numbers or rankings within each group (like department-wise ranks) using PARTITION BY.Reverse Row Numbers:Create row numbers in descending order using ORDER BY.DESC within the OVER() function.Search Patterns with Wildcards (LIKE, %, _):Use pattern-matching to find flexible string matches (e.g., names starting with "A" or ending with "Z").RANK() vs. DENSE_RANK():Know when to use each ranking function and understand how they handle ties differently.IIF(condition, true, false) - Inline IF:A shorthand conditional function that lets you return different values based on a condition.CASE...WHEN...THEN...ELSE...END:Handle multiple conditions within a query - similar to IF...ELSE IF...ELSE logic in programming. Know the difference between these two approaches and which one should you choose when?OFFSET and FETCH NEXT:Learn how to skip rows and fetch a specific number of rows - useful for pagination and efficient data browsing.