MySQL: STORED PROCEDURES

preview_player
Показать описание
#MySQL #tutorial #course

----- Example 1 -----
DELIMITER $$
CREATE PROCEDURE get_customers()
BEGIN
SELECT * FROM customers;
END $$
DELIMITER ;

CALL get_customers();

DROP PROCEDURE get_customers;

----- Example 2 -----
DELIMITER $$
CREATE PROCEDURE find_customer(IN id INT)
BEGIN
SELECT *
FROM customers
WHERE customer_id = id;
END $$
DELIMITER ;

----- Example 3 -----
DELIMITER $$
CREATE PROCEDURE find_customer(IN f_name VARCHAR(50),
IN l_name VARCHAR(50))
BEGIN
SELECT *
FROM customers
WHERE first_name = f_name AND last_name = l_name;
END $$
DELIMITER ;
Рекомендации по теме
Комментарии
Автор

Example 1
DELIMITER $$
CREATE PROCEDURE get_customers()
BEGIN
SELECT * FROM customers;
END $$
DELIMITER ;

CALL get_customers();

DROP PROCEDURE get_customers;

Example 2
DELIMITER $$
CREATE PROCEDURE find_customer(IN id INT)
BEGIN
SELECT *
FROM customers
WHERE customer_id = id;
END $$
DELIMITER ;

Example 3
DELIMITER $$
CREATE PROCEDURE find_customer(IN f_name VARCHAR(50),
IN l_name VARCHAR(50))
BEGIN
SELECT *
FROM customers
WHERE first_name = f_name AND last_name = l_name;
END $$
DELIMITER ;

BroCodez
Автор

finnaly someone explain stored procedure clearly, thx bro. please more content

dharmawangsa
Автор

Please come to our university you deserve to be a lecturer😂

seyonmahendran
Автор

Wow, I love when people simplify things! No need for a giant table with a giant column to give an example. Thank you soooo much, very well explained ❤

renyirish
Автор

😅 To be honest, this lesson is more clear than the one from Meta Database Enginnering course. Thanks so much! ❤

mrhhh
Автор

Clear, concise, direct....but you know that. Thx !

smtxtv
Автор

Best video on the subject so far. Thank you!

yvonnetatah
Автор

I like so much the way you explain everything

CristianIordache
Автор

Thanks for explaining this so clearly. I now understand the changing of the DELIMITER thing.

philipking
Автор

What a great explanation! Very clear, straight and easy to understand. Thank you so much!

khanhduluong
Автор

Thanks ❤ for explaining clearly and simply. I have never seen this explanation before

al-cadaalachannel
Автор

This info came just the right time :) Thank you bro!

skpidis
Автор

Thx bro, even my lecture just ask me to find self the theory, bro you're my hero 😢

ahmadzaini
Автор

Always looking forward to your post. You make sql so easy

ruthladenegan
Автор

pls explain OUT and INOUT procedures as well

rubysrivastava
Автор

Thank you, it was easy to understand <3

teshalex
Автор

Hey @BroCode! Great playlist. Love your fancy dark theme! Let me ask since you didn't cover cursors, are they any good? Cheers

pabloqp
Автор

Great explanation, but what about stored procedure using OUT parameter??

vanshgrover_
Автор

How to update (refresh) stored procedure in Mysql workbench every minute (automate)

parajf
Автор

ill stick with the dollar signs because i think that's cooler. 😂

cusematt