Creating Company Database | SQL | Tutorial 12

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

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

  • @StRik3EagLe
    @StRik3EagLe 5 лет назад +38

    You don't have to include "INSERT INTO employee VALUES" for subsequent rows.
    Using following way you can get rid of these redundant entries.
    INSERT INTO Employee
    VALUES
    (100, 'David', 'Wallace', '1967-11-17', 'M', 250000, NULL, 1),
    (101, 'Jan', 'Levinson', '1961-05-11', 'F', 110000, 100, 1),
    (102, 'Michael', 'Scott', '1964-03-15', 'M', 75000, 100, 1);

    • @zoebai7991
      @zoebai7991 5 лет назад +4

      Thanks! That saved me a lot of work :)

    • @nabhay583
      @nabhay583 4 года назад +3

      Thanks buddy!

    • @s3m3dov
      @s3m3dov 4 года назад +1

      Thanks, man.

  • @AndreGMendes
    @AndreGMendes 5 лет назад +33

    I'm so glad to have found you Mike. I've been watching all your videos for these last 2 weeks and I'm gradually starting to see the big picture. I've started with C# because I wanted to have some basis for Unity (regarding sound design) but as I went on thought your tutorials I felt like I could take it a little bit further and actually learn some other programming languages just for curiosity. From there I went onto PYTHON and JAVASCRIPT which in the case of this last one I had to go a little back in time to revisit and learn some concepts about implementing CSS and HTML. At this moment I'm in the middle of the SQL tutorials, but I just wanted to tell you man that you're a great teacher and that I'm learning a lot from you. Thank you soo much for your effort and dedication. You have a bright future ahead. All the best!

    • @ibiamapexcel
      @ibiamapexcel 3 года назад

      He's soo so good. Am personally recommending him to anyone that wants to learn programming.

  • @theoreticalphysics3644
    @theoreticalphysics3644 4 года назад +6

    If you're having trouble finding the source code, click the link in the description and then notice that on the left, there is a list of all of the videos, which will contain their respective code.

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

    i'm getting the error "Failed to add the foreign key constraint. Missing column 'employee_id' for constraint 'branch_ibfk_1' in the referenced table 'employee'"; when creating the table branch and giving the condition of mgr_id as foreign key. Can somebody help me resolve this error !!!!

  • @az6604
    @az6604 3 года назад +3

    where's the mentioned pdf?

  • @mramzanali1724
    @mramzanali1724 10 месяцев назад +1

    Could you kindly share the PDF document for this database with me?

  • @BadMoonRisin68
    @BadMoonRisin68 6 лет назад +8

    The Office references are awesome! Thanks for the great instructional!

  • @wendyfan5276
    @wendyfan5276 5 лет назад +6

    I have to say a massive thank you to you, Mike!! Your tutorials are incredibly clear and helpful!! Thanks for offering these great videos for free!!!

  • @UnKnown-id7ih
    @UnKnown-id7ih 2 года назад +1

    I'm getting error You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'FOREIGN KEY(mgr_id) REFERENCES employee(emp_id) )' at line 6

    • @jiaxuantian6103
      @jiaxuantian6103 2 года назад

      i got the same erro message at this place!

  • @scottisitt
    @scottisitt 4 года назад +1

    For source code, click on source code link in the description --> Then in the list of tutorials on the left hand side of the page, click on "Creating Company Database" (same as the title of this RUclips video) --> and you will find the code under the embedded video.

  • @hv3300
    @hv3300 6 лет назад +2

    Awesome Mike....
    I do not see the code in description.Which tool do you use to draw ER diagram?

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

    Hey MIke when i am trying to exciute the code for Server: Msg 1785, Level 16, State 1, Line 1 Introducing FOREIGN KEY constraint may cause cycles or multiple cascade paths. Specify ON DELETE NO ACTION or ON UPDATE NO ACTION, or modify other FOREIGN KEY constraints. Server: Msg 1750, Level 16, State 1, Line 1 Could not create constraint. See previous errors
    . Not sure how to fix this

  • @bini2036
    @bini2036 4 года назад +2

    at 10:00min Can you do
    UPDATE Employee
    SET branch_id = 1
    WHERE branch_name = 'Corporate'; ??

  • @AnotherAgnostic
    @AnotherAgnostic 5 лет назад +2

    Too bad this is MySQL... I need to learn MS SQL Server.

  • @pawenobis5386
    @pawenobis5386 5 лет назад +2

    Mike, how about getting back? The world needs your tuts! Great work!

  • @htetlynnhtun101
    @htetlynnhtun101 5 лет назад +2

    Thank you so much Mike! Your way of explaining things really click with me. Hope you make more and more precious tutorials.

  • @StRik3EagLe
    @StRik3EagLe 5 лет назад +4

    Instead of going circular(due to Foreign Key Constraint) for Inserting Rows, we can Create all the Rows first and then add Foreign Keys.

    • @stanleyjohn4670
      @stanleyjohn4670 5 лет назад

      What happens if we add in the branch_id number in the employee table before we create the branch table itself? Will it cause an error?

    • @StRik3EagLe
      @StRik3EagLe 5 лет назад +2

      ​@@stanleyjohn4670 No problem with adding values in Employee Table before creating Branch Table without adding a Foreign Key.
      Also, when you add a Foreign Key in Employee Table referencing Branch Table, it would definitely cause an error because Branch Table doesn't exist yet.

    • @stanleyjohn4670
      @stanleyjohn4670 5 лет назад

      @@StRik3EagLe makes sense. Are you working as a DBA or anything related to SQL? I want to find some advanced SQL courses after this but can't get hold of any.

    • @StRik3EagLe
      @StRik3EagLe 5 лет назад +1

      ​@@stanleyjohn4670 No, I was taking this course just for the heck of it.
      Try Udemy or Coursera if you're unable to find any advanced level courses on RUclips.

    • @theoreticalphysics3644
      @theoreticalphysics3644 4 года назад

      Perhaps he does it circular as to show how values could be added even after foreign keys are made? Either way, your comment is good to know.

  • @laurennguyen9720
    @laurennguyen9720 4 года назад +1

    how about brand_supplier. I couldn't see you create it.

    • @thiagomoreira5287
      @thiagomoreira5287 4 года назад

      I had any troubles trying to create the campany database haha

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

    i have a similar assignment but no values are given, just telling us to come up with tables, is there any need for me to fake populate it with data? if yes, where do i get the data from?

  • @Berciq
    @Berciq 4 года назад +1

    It's not better to first put values in branch and than use them typing values in Employee without updating?

  • @heisdolo
    @heisdolo 2 года назад

    INSERT INTO employee VALUES(100, 'David', 'Wallace', '1967-11-17', 'M', 25000, NULL, NULL); I get literal does not match format string

  • @ibnbattuta1304
    @ibnbattuta1304 4 года назад

    Outside of training purposes, you don't have to do the ALTER TABLE employee
    ADD FOREIGN KEY(branch_id) right away. You can just enter the branch #'s first, do the ALTER TABLE later, and not have to do those UPDATE employee commands.

  • @shaileshhd4964
    @shaileshhd4964 2 года назад

    You should have include Dwight Schrute and Pam and Oscar and Kevin. Damn You also missed Toby(HR). 😁😁. I'm a huge fan of The office Sitcom which is more than enough for my motivation to learn mysql. Parkour Parkour. 🤘✊

  • @harikrishna-zg6gh
    @harikrishna-zg6gh Год назад

    At 5:43 ruclips.net/video/LzeVPZtJglE/видео.html
    While executing below syntax:
    ALTER TABLE employee
    ADD FOREIGN KEY(super_id)
    REFERENCES employee(emp_id)
    ON DELETE SET NULL;
    Error:
    Msg 1785, Level 16, State 0, Line 27
    Introducing FOREIGN KEY constraint 'FK__employee__super___3D5E1FD2' on table 'employee' may cause cycles or multiple cascade paths. Specify ON DELETE NO ACTION or ON UPDATE NO ACTION, or modify other FOREIGN KEY constraints.
    Msg 1750, Level 16, State 1, Line 27
    Could not create constraint or index. See previous errors.
    Could you please help me what went wrong?

  • @alexongarrido8024
    @alexongarrido8024 5 лет назад +2

    Be careful Mike!! When you create the table "employee" following your source code, you create the birth date as "birth_day" instead of "birth_date" :))
    Anyway, this course its so helpful!! Thank you so much!!

    • @kushalshah4728
      @kushalshah4728 4 года назад

      Hey ... Can u help me . I can't find the source code on the link mentioned

    • @asharharoon6899
      @asharharoon6899 4 года назад +2

      @@kushalshah4728 Go to the link, and look in the left side there will be a bunch of tabs naming each of the tutorials in the series, click onto the tab with the name "Creating Company Database", below that video you will find the code.

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

    Hello Mike, all the good words had been written to you already ❤ so I'd only like to ask if any of your video covers stored procedures as well?

  • @ibiamapexcel
    @ibiamapexcel 3 года назад

    I give it to you my friend and tutor, you are the best.
    You have a unique way of making it all so simple and fun too. I have really learnt enough from this tutorial and I hope to follow on the others you did on different other programming languages.
    Thanks bro ...from Nigeria

  • @kushalshah4728
    @kushalshah4728 4 года назад

    Can't find the source code in your website. Please can u help....

  • @muhammadfarooq5925
    @muhammadfarooq5925 3 года назад

    Good Mann. your little efforts made beginner's life easy ... please keep it up.

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

    You helped with my schoolwork! Thank you!

  • @srdjanmalinovic1085
    @srdjanmalinovic1085 2 года назад

    @Mike Dane Are you still Here i could use some help as a beginner. I need Conversation Table, where we got Date of sent or date when message was received also What message is, and Who send it and who received it. So TIme and Date when Message is Received, Who received it and who send it Also should Save Sent messages and also Status of the message...

  • @nooooony1430
    @nooooony1430 6 лет назад

    thank you so much .. it' was useful tutorial..and I'm sorry for bothering you but I have problem when I try to insert the data.. it gives me an error says(literal does not match format string)and I use oracle sql developer

  • @MegaMaliak
    @MegaMaliak 5 лет назад

    hi mike, interesting tutorial and all.. why dont u show how a few different computers will connect to it? they cant use localhost like you do, cant they? can u make a tutorial on how to run a company database and let other users from different computers upload into it?

  • @tauheedakbar3524
    @tauheedakbar3524 4 года назад

    foreign keys have to be unique or priamry keys

  • @hemanthrgh5270
    @hemanthrgh5270 3 года назад

    Can you share this compony er diagram

  • @phaacwesipartey4187
    @phaacwesipartey4187 4 года назад

    please am having this alert saying i have duplicate data.....Whats the way forward? ...Please help me am stuck

    • @tauheedakbar3524
      @tauheedakbar3524 4 года назад

      you must be trying to create the same table twice or something drop it first

  • @zivwtv
    @zivwtv 5 лет назад

    how would you get any tables or data out of the database via a web interface, or for use in an office environment via a shared network?

  • @user-lk4ub3tq8e
    @user-lk4ub3tq8e 2 года назад

    can we create the whole tables, insert all the values and then add primary and foreign keys in alter statements?

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

      did you give this a try? How did it go? Thinking of doing same

  • @parteystephenson814
    @parteystephenson814 4 года назад

    inserting data into corporate i said , i get this alert that i have a duplicate primary key ie 100 , WHAT should i do to reverse this

  • @shailypriya3921
    @shailypriya3921 5 лет назад +1

    thankyou

  • @mesutandres2330
    @mesutandres2330 5 лет назад

    Awesome mike thanks for the awesome video I really needed it :-D

  • @prasadsawool6670
    @prasadsawool6670 3 года назад

    great content. Thanks Mike

  • @syedmubazir4371
    @syedmubazir4371 2 года назад

    A real Code Professor ❤️🙏

  • @insideyourcloset2725
    @insideyourcloset2725 6 лет назад

    When I use the DATE datatype, it doesn’t work, is this common

    • @insideyourcloset2725
      @insideyourcloset2725 5 лет назад

      Amobi Ndubuisi T. Yes, but when i use DATE, it doesn’t highlight like it’s a command

  • @蹦太君-o4d
    @蹦太君-o4d 2 года назад

    good practice!!

  • @sonamuhialdeen7866
    @sonamuhialdeen7866 3 года назад

    So good tutorial

  • @mk9834
    @mk9834 5 лет назад

    appreciate your effort!

  • @nandaarya2178
    @nandaarya2178 5 лет назад

    Thank You

  • @244889i
    @244889i 5 лет назад

    Thank you!

  • @handnou7660
    @handnou7660 5 лет назад

    I CAN NOT SEE THE SOURCE CODE
    CAN YOU DIRECT ME
    I CLICKED THE LINK BUT STILL I CAN NOT SEE IT

    • @Svarastis
      @Svarastis 4 года назад

      Broke ur caps button? calm the fuck down son

  • @lovingnaturewithruth
    @lovingnaturewithruth 6 лет назад

    so im looking into developing a database and would love to know which text editor you were using to create the database

  • @wilfredpadambo6186
    @wilfredpadambo6186 6 лет назад

    have installed mysql and dbeaver how can I create database?

    • @Arnonis
      @Arnonis 4 года назад

      I just typed CREATE DATABASE database_name; and then USE database_name;