The MySQL syntax for stored procedures
来自 365 Careers 的免费视频教程
Creating opportunities for Data Science and Finance students
133 门课程
4328970 名学生
讲座描述
In this lecture, we will focus on the SQL syntax allowing us to create a specific type of a stored routine – the MySQL stored procedure.
通过完整课程学习更多知识
SQL - MySQL for Data Analytics and Business Intelligence
SQL that will get you hired – SQL for Data Science, Data Engineering, Business Analysis, Marketing, and Data Management
11:21:43的随选视频 • 更新于 September 2026
Become an expert in SQL
Learn how to code in SQL
Boost your resume by learning an in-demand skill
Create, design, and operate with SQL databases
Start using MySQL – the #1 Database Management System
Prepare for SQL developer, Database administrator, Business Analyst, and Business Intelligence job opportunities
Adopt professionally tested SQL best practices
Gain theoretical insights about relational databases
Work with a sophisticated real-life database throughout the course
Get maximum preparation for real-life database management
Add data analytical tools to your skillset
Develop business intuition while solving tasks with big data
Study relational database management theory that you will need in your workplace every day
Learn how to create a database from scratch
The ability to take control of your dataset – insert, update, and delete records from your database
Be confident while working with constraints and relating data tables
Become a proficient MySQL Workbench user
Acquire top-notch coding techniques and best practices
Know how to answer specific business questions by using SQL’s aggregate functions
Handle complex SQL joins with ease
Approach more advanced topics in programming like SQL’s triggers, sequences, local and global variables, indexes, and more
Merge coding skills and business acumen to solve complex analytical problems
Become a proficient SQL user by writing flawless and efficient queries
Tons of exercises that will solidify your knowledge
The freedom to query anything you like from a database
简体中文 [自动]
在本课中, 我们将重点介绍SQL语法, 它允许我们创建存储过程。 在开始之前, 请记住我们将对雇员数据库应用所有过程和函数。 因此, 为了避免在本节中键入代码时出现任何混乱, 让我们编写一个execute。 使用雇员分号。 好极了。 我们已经准备好继续前进。 想想分号在SQL中是如何使用的。 我们说它们的作用是作为语句终止符, 但从技术上讲, 它们也可以被称为限制器。 通过键入Delimiter和美元符号两次, 您将能够使用美元符号作为分隔符。 分号不再是您的分隔符。 你为什么要这么做? 好吧, 考虑一下SQL编辑器中可能存在的一长串代码。 每个查询都以分号结束。 好吧, 我知道了 现在, 假设您正在叫用或呼叫某个使用分号做为分隔符号的程序。 在这种情况下, SQL引擎将只运行过程中的第一个语句, 我们将继续处理过程之外的下一个查询。 它不会读取第一个分号之后的代码。 若要避免此问题, 您需要一个不同于标准分号的临时分隔符。 有各种各样的符号。 例如, 您可以使用双美元符号或双正斜杠。 你选择哪一个并不重要。 我会选择双美元符号。 好极了。 然后, 我们必须编写、 创建过程, 并附加我们要分配给它的名称。 旁边的名字。 请记住, 必须始终打开和关闭括号。 它们是创建过程的语法所固有的, 因为通常要在这些括号中插入参数。 参数的作用是什么? 它们表示过程将用来完成它应该执行的计算的某些值。 这个概念比你一开始想象的更直观。 为了在本节中阐明这一点, 我们准备了几个视频来演示如何使用带参数的过程。 不过, 目前请记住, 可以在没有参数的情况下建立程序。 但是, 必须始终将括号附加到其名称上。 否则, 我的SQL将显示错误消息。 安全。 以下是程序的主体。 它总是被括在关键字开始、 关键字end和临时分隔符之间, 在我们的例子中是一个双美元符号。 我的SQL工作台将沿着过程主体的左侧显示一条黑色垂直线, 顶部有一个小框。 单击此框中的减号或加号, 可以隐藏。 或展开代码的正文。 看到了吗? 好极了。 请注意以下几点。 过程的主体由一个查询组成, 而该查询是您首先创建整个过程的原因。 它将被放置在开始和end关键字之间。 然而, 更重要的是, 在这个查询的结尾, 我们将使用通常的分隔符分号, 而不是双美元符号。 怎么会这样? 如果我们再次使用分隔符, 过程的创建将在此处停止, 并且SQL将显示错误。 好极了。 最后, 不要忘记将分隔符重置为传统的分号符号。 如果您忘记这样做, 您可能会犯相反的错误, 不运行任何代码, 而是继续运行您正在调用过程的行。 从这一刻起, 双美元符号将不再作为分隔符。 同样, 分号也会有这样的规则。 好极了。 我希望你喜欢这个视频。 接下来, 我们将学习如何创建过程并调用它。 感谢您的收看。