MySQL: How to create a TABLE

Поделиться
HTML-код
  • Опубликовано: 9 июл 2024
  • #sql #MySQL #table
    00:00:00 Intro
    00:00:36 CREATE TABLE
    00:03:00 SELECT * FROM TABLE
    00:03:21 RENAME TABLE
    00:03:54 DROP TABLE
    00:04:11 Add a column
    00:05:13 Rename a column
    00:05:50 Modify a column
    00:06:34 Change column position AFTER
    00:07:32 Change column position FIRST
    00:07:52 Drop a column
    00:08:09 Conclusion
    CREATE TABLE employees (
    employee_id int PRIMARY KEY,
    first_name VARCHAR(50),
    last_name VARCHAR(50),
    hourly_pay DECIMAL(5, 2),
    hire_date DATE
    );
    RENAME TABLE employees TO workers;
    DROP TABLE employees;
    ALTER TABLE employees
    ADD phone_number VARCHAR(15);
    ALTER TABLE employees
    RENAME COLUMN phone_number TO email;
    ALTER TABLE employees
    MODIFY COLUMN email VARCHAR(15);
    ALTER TABLE employees
    MODIFY email VARCHAR(100)
    AFTER last_name;
    ALTER TABLE employees
    MODIFY email VARCHAR(100)
    FIRST;
    ALTER TABLE employees
    DROP COLUMN email;

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

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

    CREATE TABLE employees (
    employee_id int,
    first_name VARCHAR(50),
    last_name VARCHAR(50),
    hourly_pay DECIMAL(5, 2),
    hire_date DATE
    );
    SELECT * FROM employees;
    RENAME TABLE employees TO workers;
    DROP TABLE employees;
    ALTER TABLE employees
    ADD phone_number VARCHAR(15);
    ALTER TABLE employees
    RENAME COLUMN phone_number TO email;
    ALTER TABLE employees
    MODIFY COLUMN email VARCHAR(100);
    ALTER TABLE employees
    MODIFY email VARCHAR(100)
    AFTER last_name;
    ALTER TABLE employees
    MODIFY email VARCHAR(100)
    FIRST;
    ALTER TABLE employees
    DROP COLUMN email;

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

      Twelfth comment I was the tenth

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

      Yo man 👋 I have a question about your SQL lessons: will there be a complete tutorial for beginners for it like for the other languages?
      Thanks again for all of your work

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

      @@matthewmurdock7329 it depends if people continue watching.

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

      ​@@YeahEsCerealin 😅hindi 2:26 😅😅😮😅😅😅

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

      ​@@matthewmurdock7329in 😅😅

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

    Crazy how you post this the same week as I start with SQL. Thanks a lot.

  • @andredubbs4854
    @andredubbs4854 Год назад +7

    hey bro, its so nice seeing you cover sql, an incredibly important language. thanks alot and keep the vids coming!!

  • @dewaldschuler9736
    @dewaldschuler9736 10 месяцев назад +3

    I completely forgot how to do MySQL, after a year of not taking a subject that utilizes it.
    Now I suddenly have an assignment due by midnight. So I just quickly needed a refresher.
    Thank you for providing a short and to-the-point tutorial.

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

    FINALLYYYYY, here's a series for SQL. Thanks a lot Bro!

  • @gamerslog4135
    @gamerslog4135 Год назад +17

    Your teaching methods are to the point, full of information, but can be easily and clearly understood. Thank you so much!

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

      Assalam o alaikum .
      Kindly guide kryen .
      Ye kis app per bnai ha .
      Mean Kia install Kia then is per work Kia ha.

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

    Thank you very much for a very useful hand-on training!

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

    you are out here doing the LORD'S WORK THANK YOU!!!!!!!!

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

    THANKS A LOT KING

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

    Bro, you are awesome, bro!

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

    simple and clear, thanks.

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

    Thank you!!

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

    Legendary !

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

    I'm gonna recommend this to everyone, your methods are just brilliant it goes to the point and just amazing thanks bro.
    (sorry for bad English still learning)

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

      Bro that's perfect, Never apologise for trying to learn a new language, Your doing good buddy

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

    good to see u again

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

    Broilliant vid as usual.
    Clear and and easy to follow.
    Thanks Bro

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

    Just wow❤

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

    bro i love u ur amazing

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

    bro u are just awesome

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

    reallyyyy happy to see you back again🥺🥺

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

    bro ur beast in teaching

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

    Ty bro

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

    great work dear

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

    Bro you are wonderful 👍

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

    I’m a regular visitor on this channel hahaha

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

    thank you bro

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

    Hey bro, love your videos!!
    Would you consider making NoSQL,GIT/GITHUB,Linux terminal videos in the near future?

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

    thenks bro 🤔

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

    thanks bro

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

    thank you so much bro code I'm your handicap student

  • @imhungry7692
    @imhungry7692 Год назад +24

    stop giving me exactly what I need for tomorrow every time its getting creepy .

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

    Top top top

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

    For numbers suppose if this is a real life job scenario, do we still use VARCHAR as a data type or is there any alternative to add larger numbers in a database? Like in Java you can use double or even long so is there something similar?

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

    Thanks

  • @spacex6997
    @spacex6997 Год назад +9

    I did not know that Mr Krabs had a first name.

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

    Love you bro❤️❤️

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

    yes pleaaaase full SQL tutorial

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

    good

  • @user-vu5cv2tn1v
    @user-vu5cv2tn1v 6 месяцев назад +3

    Please help me with this problem: I type the same thing as BroCode did However, the issue is Error while executing SQL query on database 'sample': near "RENAME": syntax error.

    • @VesaShehu-bj8js
      @VesaShehu-bj8js 5 месяцев назад

      Same as me.Did you find a solution til now?

    • @user-vu5cv2tn1v
      @user-vu5cv2tn1v 5 месяцев назад

      @@VesaShehu-bj8js it actually depends on which SQL application u are using. I'm using SQLite so this query will work for me:
      ALTER TABLE table_name RENAME TO new_table_name;

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

    👍👍

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

    I’m self teaching. So I am a beginner and unfamiliar so please be patient with me. When do you use semi colons, asterisk and parenthesis? I know underscore is used for two words. Can you use sql for any software or is sql for a specific program ? What careers use sql? I see this skill listed under duties for data analyst . Thanks for this video very informative

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

    SQL, sweet. Maybe react or firebase tutorials in the future.

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

    Please create a full tutorial on rust

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

    For:
    ALTER TABLE employees
    MODIFY COLUMN email VARCHAR(50)
    my ALTER is error-highlighted with the statement ' "ALTER" is not valid at this point, expecting EOF, ';' '
    I've refreshed, checked my version (8.0.36), and generally looked it over, but no luck.

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

    The Modify clause isnt working. It does'nt highlight or anthing like ALTER or SELECT, almost as if mysql is reading it as normal txt. Anyone else has this problem?

  • @jeevanredd
    @jeevanredd 7 дней назад

    Hi,
    I am getting an error when trying to create a table.
    'Can't find master key from keyring'.

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

    First bro!

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

    Why is my interface different than yours? 😢
    Where did the dark thingy thing comes from

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

    Hello sir,
    I'm glad that i found your channel to learn SQL. I'm completely new to this subject.
    i came across an error while creating a table column (" hourly pay decimal(5,1)"). could you please clarify?

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

      You need to have an underscore in between when it has two words. So it should be
      "hourly__pay DECIMAL(5,1)"

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

      float can also be used@@syedathif3357

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

    Code king 👑 bro code

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

    HOW to get rid if error Table already exists

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

    Bro or Sir please upload REACTJS full course

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

    More SQL please sir

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

    sir thr was error in install the key ring pugin plss hlp

  • @somba-gz4gx
    @somba-gz4gx 9 месяцев назад +1

    hey bro code
    i'm trying to tape the same scrito but i get this error:
    ''Error Code: 1046. No database selected Select the default DB to be used by double-clicking its name in the SCHEMAS list in the sidebar.''
    how to solve it please

    • @larrissa-wolverine
      @larrissa-wolverine Месяц назад

      Double-click on the database to be used on the schemas, for example, he is using mydb, it'd be in bold

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

    yo bro can u teach us php because im strugling with it ❤

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

    Astrix is also known as star.

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

    HELLLOOOOOOOIOO

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

    We want courses in cyber security and ethical hacking

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

    Second

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

    React Js please!

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

    First haha

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

    Why make things complicated using this SQL when companies can use excel and Microsoft access?

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

    #heidisqlgang

  • @alimirzajani-vl7nz
    @alimirzajani-vl7nz 5 месяцев назад

    i wish i could shake hands with you

  • @sammyay-man2754
    @sammyay-man2754 6 месяцев назад

    I got an error 1064. please help me

    • @rzkk33
      @rzkk33 7 дней назад

      Same. Did u figure it out? It keeps happening with decimals😫

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

    #bringbackjavatut lol!

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

    BroDeed

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

    SQL

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

    Bro code!

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

    React Js please!