MySQL: PRIMARY KEYS are easy

Поділитися
Вставка
  • Опубліковано 1 гру 2024

КОМЕНТАРІ • 21

  • @BroCodez
    @BroCodez  2 роки тому +10

    - EXAMPLE 1 --
    CREATE TABLE transactions (
    transaction_id INT PRIMARY KEY,
    amount DECIMAL(5, 2)
    );
    - EXAMPLE 2 --
    ALTER TABLE transactions
    ADD CONSTRAINT
    PRIMARY KEY (transaction_id);

  • @dph4944
    @dph4944 2 місяці тому +1

    You explained in 5 minutes what my Argentinian teacher couldn't in one hour. My main language is Spanish and yet it was way clearer with you. Thank you!!!

  • @RGGBMGO
    @RGGBMGO 2 роки тому +6

    First, heart?Btw ur coding videos are the best, you help and educate so many 😁

  • @MissP3224
    @MissP3224 4 місяці тому +1

    Love the channel name!
    I'm here to try and understand why the null values in the last row if I specify the Primary key?

  • @mohaymenul-islam
    @mohaymenul-islam Місяць тому

  • @MohammadMomin
    @MohammadMomin Рік тому +4

    John Smith Lol😂😂

  • @princeakinolaoluwagbemigag1750

    Thank you for this video big bro.
    Pls what is the difference between the primary key and the unique constraint?

    • @farisabufarha531
      @farisabufarha531 Рік тому +2

      unique constraint could be null

    • @arihantgupta4480
      @arihantgupta4480 4 місяці тому

      Also when using primary key, the data is inserted into the table as sorted, based on the value of the primary key column.

  • @themachina7713
    @themachina7713 2 роки тому +3

    why does my sql table add a null row after i added a PRIMARY KEY constraint?

  • @farhangmdc
    @farhangmdc 2 роки тому +4

    Good Video , How to get Primary Key Auto Generated ? 🔑🔑

  • @luistroyparaiso5853
    @luistroyparaiso5853 2 роки тому +5

    How do you make primary keys like "AA-0001"??

  • @crackrokmccaib
    @crackrokmccaib 2 роки тому +2

    For whatever reason, I thought you were Canadian until now.

  • @kusumaparimi2929
    @kusumaparimi2929 9 місяців тому +1

    create table transaction (
    trans_id int,
    amount decimal(10,2),
    constraint pk_transaction primary key(trans_id, amount)
    ); we apply primary key for multiple columns using this query... but in this video said, only one primary key for each table??

  • @emanuelitalo5073
    @emanuelitalo5073 2 роки тому +4

    make subtitles for portuguese br please😳😳😳

  • @lucasfranke5161
    @lucasfranke5161 3 місяці тому

    Damn, a hamburger and a soda for 4.99? That's cheap even here in Brazil lol