T-SQL for Querying Microsoft SQL Server: Selected Topics

所在平台: Udemy

课程主页: https://www.udemy.com/course/t-sql-for-querying-microsoft-sql-server-selected-topics/

课程评论:没有评论

第一个写评论        关注课程

课程简介

本课程《T-SQL查询Microsoft SQL Server:精选主题》旨在教授IT专业人员在Microsoft SQL Server中查询数据的关键T-SQL技能。课程重点关注五个核心主题: 1. **T-SQL查询基础:** 强调以关系型方式编写查询的重要性,避免使用游标。介绍T-SQL语言的根源、SQL Server的实现,以及逻辑查询处理的重要性。学员将学习T-SQL的基础、以关系型方式使用T-SQL的意义,并能准确描述T-SQL相关元素。 2. **过滤和排序数据:** 涵盖数据查询中最常见的数据过滤和排序技术。学习使用谓词(Predicates)进行过滤,掌握`TOP`和`OFFSET-FETCH`子句来限制行数和排序。课程还将深入讲解`ORDER BY`子句的使用、三值逻辑、搜索参数、字符和日期时间数据的过滤,以及排序的保证问题。 3. **集合组合:** 讲解从多个表中组合数据的多种T-SQL方法,包括: * **`JOIN`操作:** 学习使用`CROSS JOIN`、`INNER JOIN`和`OUTER JOIN`连接相关表以查询数据。 * **子查询:** 掌握自包含子查询、相关子查询、返回标量和多值结果的子查询,以及派生表和表表达式(如`Common Table Expressions (CTEs)`、视图、内联表值函数)。 * **`APPLY`运算符:** 学习`CROSS APPLY`和`OUTER APPLY`。 * **集合运算符:** 掌握`UNION`、`UNION ALL`、`INTERSECT`和`EXCEPT`。 4. **窗口函数:** 专注于数据分析操作,讲解应用于一组行并返回单个值的窗口函数。内容包括: * **窗口聚合函数:** 使用`SUM`、`AVG`、`COUNT`、`MAX`、`MIN`等函数,结合`OVER`子句实现运行总计等功能。 * **窗口偏移函数:** 学习`LAG`、`LEAD`、`FIRST_VALUE`和`LAST_VALUE`函数。 * **窗口定义:** 理解窗口分区、排序和框架的定义,掌握`OVER`子句的语法,并避免常见的框架错误。 5. **创建表和强制数据完整性:** 教授在Microsoft SQL Server中创建表以及保护数据完整性的方法。包括: * 使用`CREATE TABLE`和`ALTER TABLE`语句创建和修改表。 * 为列指定数据类型。 * 实现声明式数据完整性,定义和使用主键、唯一约束、外键约束和检查约束,以及默认约束。 6. **插入、更新和删除数据:** 涵盖数据修改方面,学习使用T-SQL语句进行数据的增、删、改操作,包括`INSERT VALUES`、`INSERT SELECT`、`INSERT EXEC`、`SELECT INTO`、`UPDATE`(包括带`JOIN`的更新和通过表表达式更新)以及`DELETE`和`TRUNCATE`语句。 **课程结构与学习方式:** * **视频教学:** 课程主要以视频形式呈现,包含概念讲解和SQL Server Management Studio (SSMS)中的代码示例。 * **实践操作:** 鼓励学员在自己的SSMS环境中跟随代码进行实践,课程基于名为“AcotexDB”的示例数据库。 * **测验:** 每节课后提供多项选择题测验,以检验学习效果。 * **习题和案例场景:** 每节课结束后提供动手练习和案例场景,以Word文档或Excel宏文件(.docm)形式提供,并附带可切换显示的答案。学员需在SSMS中完成练习。 * **互动设计:** 练习中包含VBA代码,增加互动性和趣味性。 通过本课程的学习,学员将深入掌握T-SQL查询和数据管理的核心技能。

课程评论(0条)

课程详情

In this Microsoft Transact-SQL (T-SQL) course we concentrate on five Transact-SQL topic that every IT professional who need to query data in Microsoft SQL Server should know. These topics are:Foundation of T-SQL querying - You learn the importance of writing your queries in a relational way and how to avoid using cursors. We describe the root of the T-SQL language and the Microsoft SQL Server implementation of the standard SQL. The course provides you will clues for the mindset that you have to adopt. In this section, we describe the most important concepts you need to know about the language: the logical query processing. After this lesson, you will be able to (a) describe the foundation that T-SQL is based on (b) describe the importance of using Transact-SQL in a relational way, and (c) use correct terminology when describing T-SQL-related elements. This lesson finishes with exercises and case scenarios and quizzes to test your understanding of the topics.Filtering and sorting data - Filtering and sorting data are the most foundational, as well as most common, aspect of querying data, and many queries involve sorting. The traditional way to filter data in T-SQL is based on predicates. However, T-SQL also supports filtering data based on another concept - a specified number of rows and ordering. In this option, we look at TOP and OFFSET-FETCH. As for sorting, even though it might seem like a trivial aspect of querying, it is actually a source of quite a lot of confusion and misunderstanding, which this lesson tries to clarify. Lesson in this section includes: (a) Filtering data with predicates (b) Sorting data and (c) Filtering data with TOP and OFFSET-FETCH. We treat topics such as predicates, three-valued logic, search arguments, combining sets, filtering character data, filtering date and time, using the ORDER BY clause to sort data, understanding when order is/is not guaranteed. This lesson finishes with exercises, quizzes and case scenarios.Combining sets - T-SQL provides a number of different ways to combine data from multiple tables. In this part of the course, we describe the different options including: joins: often data that you need to query is spread across multiple tables. The more normalized the environment is, the more tables you usually have. The tables are usually related through keys, such as foreign key in one table and primary key in the other. Then you can use joins to query the data from the different tables to match the rows that need to be related. Here, you learn how to write queries that use cross joins, inner joins and outer joins.subqueries: T-SQL supports nesting queries. This is a convenient part of the language that you can use to refer to one query's result from another. Under this topic we learn how to use: (1) self-contained subqueries and correlated subqueries (2) Subqueries that return scalar and multi-valued results, derived tables table expressions (names queries): derived tables; common table expressions (CTEs); views; inline table-valued functionsthe APPLY operator: CROSS APPLY and OUTER APPLYset operators: UNION; UNION ALL; INTERSECT; EXCEPT set operatorsWindow functions: This section of our course focuses on data analysis operations. A data analysis function is a function applied to a set of rows, and returns a single value (e.g. the SUM aggregate function). A data analysis function can be either a group function or a window function. In this section we treat only window functions. We teach you the following:Use window aggregate: Window aggregate functions (SUM, AVG, COUNT, MAX, MIN) apply to a window of rows defined by the OVER clause. We teach you how to use these powerful functions to produce results such as running totals, optionally partitioned by any column of your choice and show both detail and aggregate values in the same result Window offset functions: Window offset functions return an element from a single row that is a given offset from the current row in the window partition, or from the first or last row in the window frame. You will learn about the following window offset functions: LAG, LEAD, FIRST_VALUE, and LAST_VALUEDefine window partitioning, ordering and framing in your window functionsUnderstand the OVER clause syntax and how to control the windowAvoid framing errors that can lead to unexpected resultsCreating tables and enforcing data integrity: Tables are the primary method of data storage in Microsoft SQL Server. To use tables, you need to master how to create them, in addition to adding constraints to protect the integrity of the stored data. In this section, you learn how to create and alter tables, in addition to enforcing data integrity between tables by using table constraints: We treat the following topics:Use the CREATE TABLE statement to create a tableUnderstand how to specify data types for columnsUse the ALTER TABLE statement to change some properties of columnsImplement declarative data integrity on your tablesDefine and use primary key constraintsDefine and use unique constraintsDefine and use foreign key constraintsDefine and use check constraintsDefine default constraintsInserting, Updating, and Deleting Data: This section of the course covers certain aspects of data modification. It describes how to insert , update, and delete data using T-SQL statements. You will master the following topics after this section:Insert single and multiple rows into a table by using the INSERT VALUES statementInsert the result of a query into a table by using the INSERT SELECT statementInsert the result of a stored procedure or a dynamic batch into a table by using the INSERT EXEC statementUse a query result to create and populate a table by using the SELECT INTO statementUse UPDATE statement to modify rowsUpdate data by using joinsDescribe the circumstances in which you get nondeterministic updatesUpdate data through table expressionsUpdate data by using variablesDescribe the implications of the all-at-once property of SQL on updatesUse the DELETE and TRUNCATE statements to delete rows from a tableUse a DELETE statement based on joinsUse a DELETE statement based on table expressionsCOURSE STRUCTURE:· The course is video-based. We utilize a custom interface to explain concepts and use SQL Server Management Studio (SSMS) to provide coding examples and exercises. Please watch our promotional video see a demonstration of our video presentation. We expect you to follow the codes we explain to you in your own SSMS. The course is based on a sample database called AcotexDB. Run the AcotexDB.sql SQL script in your SSMS to create the sample database.2. QUIZZES:· Each lesson comes with about half a dozen multiple choice quizzes. We suggest that you immediately repeat the lesson if you experience difficulties completing these quizzes.3. HANDS-ON EXERCISES and CASE SCENARIOS:At the end of each section, we provide both hands-on exercises and case scenarios in Word document or Excel macro files (docm) based on the topics in the section. Answers to the exercises are provided but hidden. We display a button beneath each exercise that you can click (toggle) to display/hide the solutions to the exercises. We suggest that you give the exercises a go before you look at the solution. You are to perform these exercises in your SSMS.In the case scenarios, we describe a scenario about a problem for a fiticious company and ask you (a consultant) to provide solution. Again, we provide solutions to these scenarios.4. SOLUTIONS TO EXERCISESWe have powered our exercises with VBA code (with buttons) to make the exercises as interactive and interesting as possibel. We hope you will enjoy the design of our course, and please, if you go ahead to take this course, let us receive your feedback and suggestions for improvement.THANK YOU and GOOD LUCK

课程标签

0人关注该课程

主题相关的课程