|
所在平台: Udemy |
课程主页: https://www.udemy.com/course/advanced-mysql-stored-proceduressubqueriesviewsfunctions/
课程评论:没有评论
**课程名称:** 高级MySQL:存储过程、子查询、视图、函数 **课程概要:** 本课程深入探讨数据库管理和开发中至关重要的“高级查询”技术。不恰当的高级查询可能导致程序错误甚至崩溃,因此熟练掌握这些技术对于任何数据库专业人士都至关重要。高级查询常用于报表生成、多表连接、嵌套查询以及事务锁定等场景。 **课程内容重点:** * **存储过程 (Stored Procedures):** * 学习如何使用 `CREATE PROCEDURE` 语句将SQL语句封装成可重用的代码块。 * 掌握在存储过程中使用条件语句(如 `IF`、`CASE`)和循环语句(如 `LOOP`)。 * 了解存储过程如何调用其他存储过程或函数,实现代码的模块化。 * 存储过程是存储在数据库中的一种子程序,拥有名称、参数列表和SQL语句。MySQL 5开始支持存储过程。 * **子查询 (Subqueries):** * 理解子查询(内层查询)是如何嵌套在另一个查询(外层查询)中的,这些查询可以是 `SELECT`、`INSERT`、`UPDATE` 或 `DELETE` 语句。 * 学习子查询的嵌套使用。 * 子查询可以作为表达式使用,并且必须用括号括起来。 * **视图 (Views):** * 了解视图是一种数据库对象,它本身不存储数据,而是基于基础表的查询结果。 * 视图的外观和操作方式类似于真实表,包含行和列。 * 在MySQL中,视图是通过连接一个或多个表创建的虚拟表。 * 视图与表的主要区别在于,视图是建立在其他表(或视图)之上的定义。基础表发生变化时,视图也会同步反映这些变化。 * **函数 (Functions):** * 介绍MySQL提供的多种函数,包括但不限于聚合函数(如 `SUM`、`AVG`)、字符串连接函数(如 `CONCAT`)和字符函数(如 `UPPER`、`LOWER`)等。 * 学习如何使用和组合这些函数来增强数据处理能力。 本课程旨在帮助学员更精细、更高效地处理数据库查询,提升数据库应用性能和稳定性。
Advanced queries are a part of every database administrator or developer job. Advanced queries must be handled delicately, because improperly coded SQL or poorly performing SQL can create bugs and application crashes. Advanced queries are typically used for reporting, joining multiple tables, nesting queries, and transaction locking.The stored procedure is SQL statements wrapped within the CREATE PROCEDURE statement. The stored procedure may contain a conditional statement like IF or CASE or the Loops. The stored procedure can also execute another stored procedure or a function that modularizes the code.A procedure (often called a stored procedure) is a subroutine like a subprogram in a regular computing language, stored in database. A procedure has a name, a parameter list, and SQL statement(s). All most all relational database system supports stored procedure, MySQL 5 introduce stored procedure.A MySQL subquery is a query nested within another query such as SELECT, INSERT, UPDATE or DELETE. Also, a subquery can be nested within another subquery.A MySQL subquery is called an inner query while the query that contains the subquery is called an outer query. A subquery can be used anywhere that expression is used and must be closed in parentheses.A view is a database object that has no values. Its contents are based on the base table. It contains rows and columns similar to the real table. In MySQL, the View is a virtual table created by a query by joining one or more tables. It is operated similarly to the base table but does not contain any data of its own. The View and table have one main difference that the views are definitions built on top of other tables (or views). If any changes occur in the underlying table, the same changes reflected in the View also.MySQL has a variety of functions you can use. examples includes aggregate functions , concat functions and character functions.