Triggers and Events in MySQL | Advanced MySQL Series

Поделиться
HTML-код
  • Опубликовано: 19 янв 2025

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

  • @mustafaabdelaziz3142
    @mustafaabdelaziz3142 9 месяцев назад +88

    Hey Alex, just wanted to say I’ve been following your projects and followed your videos on how to build your resume, and was blessed to receive a job offer because of you. Thank you for everything.

    • @MOHAMEDMAHMOUD-zr9ds
      @MOHAMEDMAHMOUD-zr9ds 9 месяцев назад

      ممكن مساعدة ازاى عملت بروفايل عشان يجى لك وظيفة

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

      Awesome!

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

      are you from pakistan? i need your help.

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

      Congratulations

    • @pandabear0
      @pandabear0 Месяц назад +1

      Congratulations! I hope to be in the same boat as you soon!

  • @zainabusama-ut9os
    @zainabusama-ut9os 8 месяцев назад +37

    🎯 Key Takeaways for quick navigation:
    00:00 *📝 Introduction to Triggers in MySQL*
    - Triggers in MySQL automatically execute code when specific events occur on a table.
    - Triggers are useful for maintaining data consistency and automating tasks based on data changes.
    - A trigger consists of a name, event, and action to perform after the event.
    03:26 *🔧 Creating a Trigger in MySQL*
    - Delimiters in MySQL are essential for handling multi-line queries, allowing multiple statements within a single query.
    - Triggers are defined using the `CREATE TRIGGER` statement with specific event conditions.
    - Triggers can be set to execute before or after an event, such as insertion, deletion, or update.
    08:50 *🔄 Testing and Utilizing Triggers*
    - Triggers provide a mechanism for automating tasks, such as updating related tables when data changes occur.
    - Testing triggers involves inserting data to observe trigger behavior and ensure proper functionality.
    - Triggers save time and effort in maintaining data integrity and consistency in real-world database operations.
    09:04 *🗓️ Introduction to Events in MySQL*
    - Events in MySQL are scheduled tasks that can be executed at specified intervals.
    - Unlike triggers, events are not triggered by data changes but are executed according to a predefined schedule.
    - Events are beneficial for automating recurring tasks such as data imports, exports, or cleanup operations.
    11:08 *⏰ Creating Scheduled Events in MySQL*
    - MySQL events are created using the `CREATE EVENT` statement, specifying the schedule and actions to be performed.
    - Scheduled events can execute SQL statements, allowing for data manipulation, cleanup, or reporting tasks.
    - Events provide a convenient way to automate routine database maintenance and management tasks.
    13:52 *🔍 Testing and Troubleshooting MySQL Events*
    - Testing MySQL events involves verifying their execution according to the defined schedule and expected actions.
    - Troubleshooting event creation issues may require checking the status of the event scheduler and adjusting user permissions.
    - Understanding the nuances of event scheduling ensures effective automation of database tasks while minimizing errors.
    Made with HARPA AI

  • @sound-mind
    @sound-mind Месяц назад +4

    Hey Alex,
    I wanted to thank you for this bootcamp. It's so kind of you to offer these treasures for free. You've made becoming a DA even easier and less daunting. Thank you!

  • @bystander7114
    @bystander7114 3 месяца назад +8

    Can't wait to start the projects next!
    I'm so glad I came across this series 👍
    Thanks Alex!

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

    Hey Alex, thanks for this series on MySQL. The way you explain things is so dynamic and clear, you really do a great work! Also, your examples with The Office and Parks and Recs characters are simply fantastic. We have fun while learning and this is amazing. Thanks for all that !

  • @justinkings635
    @justinkings635 5 месяцев назад +3

    Just finished the series and I'm amazed on how you teach. I full understand every detail unlike other online courses.

  • @sarthakshriram
    @sarthakshriram 17 дней назад +1

    hey alex recently found your channel and has followed through this series had amazing chance to learn new things and clear out the previous topics thanx for this bootcamp

  • @srp4024
    @srp4024 5 месяцев назад +3

    I am having a great time learning with your series for MySQL which I did not even learn in my Coursera course ! Everything is explained in a simple way to understand. I plan to finish the bootcamp and land up in job as data analyst. Thanks a lot for the great work and helping out so many people around the globe.

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

    I have just finished the course series and am eager to get started on the upcoming projects!

  • @DasaHerrera
    @DasaHerrera 5 месяцев назад +1

    for some reason this was by far my favorite lesson. Thank you Alex!

  • @emansabra-n7g
    @emansabra-n7g 6 месяцев назад +1

    Hey Alex, thank you so much for this series on Mysql. I really appricaite all the hard work you've put to bring us this amazing work. Your way of explaning topics is so easy. Thanks again.

  • @AnastasiaFreeland
    @AnastasiaFreeland 7 месяцев назад +3

    very useful series, i finished the sql and excel so far. very excited for the projects

  • @BruceBeck-f1n
    @BruceBeck-f1n 8 месяцев назад +4

    Greetings Alexs & All. Just finished watching this lesson at work. Can hardly wait until I get home to run the code on my personal laptop (No MySQL @ work - BOO!). Everything Alex presented here made sense to me. Lots to digest & eventually memorize. Good thing there's a couple of projects to work through to start the process. Cheers! BB😎
    UPDATE: Just finished working through Alex's code at home. Worked perfectly, no issues. Thanks again Alex!

  • @shilpa2637
    @shilpa2637 8 месяцев назад +2

    Hi Alex I am really really glad that I went through with this. I already have a masters degree in this but I don’t know about the coding language and anything but now I am starting to click into 8t. Thank you lots of love

  • @NaijagoldgistNaijagoldgistcom
    @NaijagoldgistNaijagoldgistcom Месяц назад +3

    Alex made learning so easy with the way he teaches, he made me come this far. Thank you Alex. I'm really Hoping I become an expert in D.A soon.
    Anybody want to connect so that we can learn together?

  • @raphaelmarkd
    @raphaelmarkd 12 дней назад +2

    Thanks Alex!

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

    Thank you Alex! You're my SQL idol!

  • @JairajRegan
    @JairajRegan 4 месяца назад +2

    An amazing SQL course Alex, thank you so much! I heard about normalisation, primary and foreign keys and optimisation, would there be any way of creating a couple videos for these? Love the way you teach so if this is possible I would be truly thankful!

  • @josephoche7081
    @josephoche7081 2 дня назад

    No badges on this level?🎉🎉
    Thank you so much Alex

  • @nadeemjan1000
    @nadeemjan1000 5 месяцев назад +1

    Thank you, Alex, I am very great full that I have learned a lot of things from Basic to Advanced level. you are Great

  • @AmanTiwari-ow6rc
    @AmanTiwari-ow6rc 9 месяцев назад +10

    your videos trigger me to excel SQL

  • @thipetebogo
    @thipetebogo 7 месяцев назад +3

    Enjoyed, poor Jerry finally getting a break

  • @afunsizedmia1886
    @afunsizedmia1886 2 месяца назад +1

    Hi Alex! I love your videos, I've been watching them to review for my technical interviews! Do you think you could make a video going over date and time functions in MySQL? I'm having a hard time finding some good ones here on RUclips. Thanks for everything!

  • @WilnerSumagingsing
    @WilnerSumagingsing 4 месяца назад +1

    Hoping you can make a playlist for SQL Debugging (Exploring errors and how to fix that, I know there's a lot of error we may encounter but this is very helpful). Anyway thanks for the SQL topics, very insightful.

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

    Love your videos Alex, always learn something new. 'Preciate you

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

    Hi Alex, thanks for the great work. I am a beginner and these videos are beneficial.

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

    Hello Mr. Freberg. I have a short question.first of all Thanks for your channel. I am following you from your freecodecamp video. I just find out that you teach other things in your freecodecamp course ( like here it is Mysql and there you use Microsoft sql . of course all they both uses sql but there are some differences as well) I just want to ask you which one of your courses do you recommend ?

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

    Great! Thanks!!! I was looking to Know More about triggers!

  • @habibullah7425
    @habibullah7425 4 месяца назад

    Great Work Alex.

  • @salmanahmed-wm1dz
    @salmanahmed-wm1dz 7 месяцев назад +2

    Hi Alex, could you please create a tutorial for 'views'?

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

    Hey Alex, quick question, when do we have to use "Lightning bolt without the "I" and the one WITH the "I" to run individual queries?

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

    Thank you Alex
    I will enjoy it here 🥰

  • @vangiang2071
    @vangiang2071 5 месяцев назад +1

    hi, where can I look at those 2 projects that you are mentioned in the video: Data Cleaning Project & Exploratory Data Analysis Project. Thanks Alex!!

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

      Check his RUclips channel; there's a data analyst boot camp playlist
      The video you mentioned is there

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

    GOD BLESS YOU, ALEX!

  • @melvin6228
    @melvin6228 26 дней назад

    To what extent is it needed to know stored procedures + triggers and events? I've asked it also on Reddit and it seems that it is in the realm of "things SQL can do" but not "things you need to know, unless you encounter it"
    What do you think?
    I don't mind (re)learning it (I'm coming from a dev background), but I'd rather do the 80/20 as I don't need to secure a job. I got one in 2 weeks

  • @tutran-pv3vu
    @tutran-pv3vu 8 месяцев назад

    What is an event used for? When will it be used in real life situation?

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

    if the "event scheduler" value is off, do we edit it on the table itself or is there a specific code to write to turn it on?

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

    nice and informative video, but can you tell me that, how do we decide that when to use AFTER trigger and when to use BEFORE trigger?? like is there any general rule?

  • @benardwanjai2131
    @benardwanjai2131 4 месяца назад +1

    Thank You Alex, and sorry for Jerry Gergich

  • @akinlooluwasemilogo3225
    @akinlooluwasemilogo3225 5 дней назад

    How can you delete a trigger, I made an error when creating trigger employee insert and the insert into employee salary won’t work

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

    what's the code for "before" - to store the data somewhere BEFORE its deleted

  • @MJ-eq4bw
    @MJ-eq4bw 9 месяцев назад

    Hi Alex, is the market for Data Analysts oversaturated?

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

    @Alex The Analyst how do you insert multiple row data in one go?

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

    when i am running this trigger getting error
    11:55:29 insert into employee_salary (employee_id, first_name,last_name,occupation ,salary,dept_id) values (13,'anshu','saxena','ceo',1000000,null) Error Code: 1054. Unknown column 'empoyee_id' in 'field list' 0.000 sec
    can someone help

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

      You can seee that you mistyped the name of the column "
      empoyee_id, you forgot 'l'
      It's 'employee_id'

  • @adityadhiman3456
    @adityadhiman3456 7 месяцев назад +1

    Hi, I did everything (troubleshooting), but jerry still doesn't get deleted. Can anyone explain that to me please?

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

      me too. I went back and it doesnt delete as well.

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

      Same here

    • @valerioharvey7289
      @valerioharvey7289 6 месяцев назад +3

      let jerry have a job

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

    thank you so much it was very helpful

  • @Abi.haspurpose
    @Abi.haspurpose 2 месяца назад

    This is cool!

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

    Thank you very much!

  • @julienmonso-lq1qr
    @julienmonso-lq1qr 9 месяцев назад

    Ok Alex the analyst ; intend to make a huge session of learning how to do things with your vidéo that are just incredeables, but the question will be : how did you learned so
    much in such a short Time (sorry for my english speacking, i'm french)

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

    Events not working for me, tried troubleshooting the also

  • @Mr.Arshad-oc1fd
    @Mr.Arshad-oc1fd 6 месяцев назад

    Thanks for this .
    O little bit difficult 😊

  • @isaacjoseph8725
    @isaacjoseph8725 7 месяцев назад +1

    Damn you Ron Swanson!

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

    Thank you so much sempai🙏🔥💌

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

    How do i add multiple entries into a my trigger

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

    I did all the recommendations but creation of event still doesn't work , anyone to help please?

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

    Thanks

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

    I am getting syntax errors and the error 'CREATE TRIGGER' must be the first statement in a query batch. I can't seem to find a solution. Does anyone know the cause of this error?

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

      End the before statement with the 'go' statement and issue will be resolved.

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

    Not working for me

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

      Why not?

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

    make VDOs on recursive query ...

  • @sachin-b8c4m
    @sachin-b8c4m 8 месяцев назад

    thank you

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

    AMAZING

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

    Hey guys, is there anyone who got error code 1442 (Can't update table in stored function/trigger because it is already used by statement which invoked this stored function) while practicing with Triggers in mysql? If so, let me know how you handled the problem, I've been stuck at it for a while.

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

      DROP EVENT IF EXISTS delete_retirees; (try this)
      DELIMITER $$ (then run this again)
      CREATE EVENT delete_retirees
      ON SCHEDULE EVERY 30 SECOND
      DO
      BEGIN
      DELETE FROM employee_demographics
      WHERE age >= 60;
      END $$
      DELIMITER ;
      select* (then run this)
      from employee_demographics;

    • @Kiki-yp9te
      @Kiki-yp9te 5 месяцев назад

      Hiii. I just started this and I'm getting the same error. Were you able to fix it by chance?

    • @Alfa10869
      @Alfa10869 4 месяца назад

      DROP TRIGGER name_trigger

  • @michaeldenkyi
    @michaeldenkyi 4 месяца назад +1

    even after every check jerry gergich still exist in my employee demographics

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

      I had the same problem. However, after doing everything Alex suggested, I changed the event name to 'delete_retirees' (I just recreated the event with a different name). I reran the code, and it worked. It might work for you too!

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

      check if you also remembered to change the "select * " statement to "delete" instead, inside the begin-end command

  • @geminientertainment8090
    @geminientertainment8090 5 месяцев назад +2

    Poor Jerry got deleted

  • @supernoobie1497
    @supernoobie1497 5 месяцев назад +1

    alex youre mean to older people

  • @valerioharvey7289
    @valerioharvey7289 6 месяцев назад +1

    not jerry again

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

    Poor Jerry

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

    Thank you

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

    AMAZING