MySQL: STORED PROCEDURES

Поделиться
HTML-код
  • Опубликовано: 21 июл 2024
  • #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 ;

Комментарии • 55

  • @BroCodez
    @BroCodez  Год назад +23

    ----- 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 ;

    • @annam3533
      @annam3533 Год назад

      Great

    • @MasterZhao
      @MasterZhao 7 месяцев назад

      Can you do an example where you DECLARE variables and use CONTINUE HANDLER FOR SQLEXCEPTION?

  • @dharmawangsa9592
    @dharmawangsa9592 Год назад +16

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

  • @renyirish
    @renyirish Год назад +8

    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 ❤

  • @seyonmahendran7182
    @seyonmahendran7182 8 месяцев назад +9

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

  • @yvonnetatah2084
    @yvonnetatah2084 Год назад +3

    Best video on the subject so far. Thank you!

  • @CristianIordache22091996
    @CristianIordache22091996 Год назад +2

    I like so much the way you explain everything

  • @sk00pidis
    @sk00pidis Год назад +4

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

  • @ruthladenegan4075
    @ruthladenegan4075 8 месяцев назад

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

  • @mrhhh693
    @mrhhh693 9 месяцев назад +3

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

  • @pabloqp7929
    @pabloqp7929 Год назад

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

  • @smtxtv
    @smtxtv 3 месяца назад +1

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

  • @gabrielodiase7357
    @gabrielodiase7357 Год назад

    This is absolutely amazing. Thanks

  • @philipking1788
    @philipking1788 5 месяцев назад

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

  • @rominasepulveda570
    @rominasepulveda570 11 месяцев назад

    great video

  • @khantechsolution
    @khantechsolution 9 месяцев назад +1

    great sir

  • @aldrinjohnencina6153
    @aldrinjohnencina6153 3 месяца назад

    thank you so much clear explaination.

  • @ruthladenegan4075
    @ruthladenegan4075 8 месяцев назад

    You are the best

  • @lubna99
    @lubna99 8 месяцев назад

    great .. thank u alot

  • @AronLuchan
    @AronLuchan Год назад +1

    Thank you very much!

  • @khanhduluong4355
    @khanhduluong4355 2 месяца назад

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

  • @teshalex
    @teshalex 11 месяцев назад

    Thank you, it was easy to understand

  • @ahmadzaini1297
    @ahmadzaini1297 Месяц назад

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

  • @al-cadaalachannel3194
    @al-cadaalachannel3194 2 месяца назад

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

  • @chathurid
    @chathurid Год назад

    Thank You so much!!

  • @nagendradevara1
    @nagendradevara1 Год назад +3

    Please continue this MySql series

  • @tenebrae1191
    @tenebrae1191 Год назад

    👏👏

  • @sahaninimesha9895
    @sahaninimesha9895 11 месяцев назад

    Thnks a lot❤

  • @user-bt3zq2sl6r
    @user-bt3zq2sl6r 7 месяцев назад

    thank you so much

  • @thunderhamilton1
    @thunderhamilton1 Год назад

    Having issue with code in which for some reason. I successfully made 2 stored procedures in a database however the one I did for a parameter that's supposed to be for when finding a particular date within the table when I call the stored procedure it's returns empty set. Yet when I call an asp for all records it'll do so successfully

  • @nicholasiliev
    @nicholasiliev 6 месяцев назад

    Thanks bro!

  • @SistaYana-ru1yc
    @SistaYana-ru1yc Год назад

    I love you 🥰

  • @rubysrivastava2288
    @rubysrivastava2288 Год назад +1

    pls explain OUT and INOUT procedures as well

  • @pranatianuse243
    @pranatianuse243 Год назад

    HI,
    Tell me what if I want to provide Customerid 1 and 2 at one time means 1,2 then what will be my sp?

  • @Ritesh-pv4yi
    @Ritesh-pv4yi 11 месяцев назад

    Is that all in stored procedures?
    Can't we use insert, update and delete in stored procedure?

  • @vanshgrover_19
    @vanshgrover_19 5 месяцев назад

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

  • @ekcanok2412
    @ekcanok2412 Год назад

    Can this be used on microsoft sql server?

  • @cusematt23
    @cusematt23 3 месяца назад

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

  • @parajf
    @parajf 15 дней назад

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

  • @productivityaccount7705
    @productivityaccount7705 3 месяца назад

    Can you please do a video on cursor

  • @fearless6141
    @fearless6141 8 месяцев назад

    Can we use date function as parameter

  • @SIDEKICKONYOUTUBE
    @SIDEKICKONYOUTUBE 8 месяцев назад

    im confused. you have to change the delimiter every time ?
    why hasn't MySQL made a fix for this ?

  • @phongtranquoc7557
    @phongtranquoc7557 Год назад

    whats the differences between create functions and procedures guys? =

  • @HoaNguyen-uq8vh
    @HoaNguyen-uq8vh 9 месяцев назад

    How to debug Stored Procedure in mySQL workbench

  • @queryhsje7514
    @queryhsje7514 Год назад +1

    Whats the difference between stored Procedure and Views? I'm confused.

    • @TheAnimeSounds
      @TheAnimeSounds Год назад +1

      Procedure is just an action that executes your statements
      Views are virtual tables (your rensponses), unlike normal tables that hold data and are stored in Databases, views create tables with data filled dynamically on the fly. You use those if you dont really need store specific tables, but said tables can help ya with solving some problem / calculation.

    • @queryhsje7514
      @queryhsje7514 Год назад

      @@TheAnimeSounds Oh ok, thanks!

  • @ATGalaxy94
    @ATGalaxy94 8 месяцев назад

    Where can i find this database ???

  • @sundaypodcom
    @sundaypodcom Год назад

    Why varchar is "WarCHAR" and not "WarKar" when character is "Karactor"

  • @cbbcbb6803
    @cbbcbb6803 Год назад

    Don't you have to use a database first?

    • @mitigozman-pop2
      @mitigozman-pop2 Год назад

      He did create a database. Otherwise he wouldn't be able to extract data. He did so in previous videos of this series.

  • @theBATfamiliar
    @theBATfamiliar 11 месяцев назад

    Thanks a lot for this tutorial :)

  • @moe583
    @moe583 9 месяцев назад

    Can you please do a course on developing a web application with nodeJS, there isn't any good tutorials on youtube for that and I think you would be great at breaking it down.