MySQL: CHECK constraint is easy

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

КОМЕНТАРІ •

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

    - The CHECK constraint is used to limit what values can be placed in a column.
    CREATE TABLE employees(
    employee_id INT,
    first_name VARCHAR(50),
    last_name VARCHAR(50),
    hourly_pay DECIMAL (5, 2),
    hire_date DATE,
    CONSTRAINT chk_hourly_pay CHECK (hourly_pay >= 10.00)
    );
    ALTER TABLE employees
    ADD CONSTRAINT chk_hourly_pay CHECK (hourly_pay >= 10.00);
    INSERT INTO employees
    VALUES (6, "Sheldon", "Plankton", 5.00, "2023-01-07");
    ALTER TABLE employees
    DROP CHECK chk_hourly_pay;

  • @MinhVu-bz6fe
    @MinhVu-bz6fe 2 роки тому +10

    You're literally carrying me through Uni right now. Thank you, Bro. Truly.

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

    That fast forwarded typing sound so satisfying

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

    We literally started sql today your timing is great thank you.

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

    best channel ever!

  • @mdjahangirhossain6203
    @mdjahangirhossain6203 11 місяців тому

    You are good man you make it easy for us

  • @avaygc5646
    @avaygc5646 2 роки тому

    your tutorial is great could please make a tutorial for node js and dyango 💗

  • @enlightened7354
    @enlightened7354 2 роки тому

    Can you make also mongo db and Java Spring tutorials? Thanks man. Because of you i learned MySQL. I was struggling and now im able to write my own database in Java using JDBC.

  • @mhreda1849
    @mhreda1849 7 місяців тому

    Thank you !
    Notice :
    when i want to delete constraint check
    drop check "constraintName" => is not working for me
    but when i do : drop constraint "constraintName"
    maybe the first syntax is not correct
    and thank you again :) (FROM MOROCCO)

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

    ALTER ADD not working with constrain. Error code 3819 Check Constraint 'chk_hourly_pay' is violated

  • @KoenigOne
    @KoenigOne Рік тому

    thanks bro

  • @sifatniloy3783
    @sifatniloy3783 8 місяців тому +1

    I got Error Code: 3821. Check constraint 'check_hourly_pay' is not found in the table, may be I mistyped the constraint. How to find out what I gave the constraint name for that column?

    • @mateenraza7340
      @mateenraza7340 8 місяців тому

      In the output window, it lists the action you make; you can find out what name have you mistyped from there.

  • @haole1815
    @haole1815 2 роки тому

    First comment !!! U make my day Bro :D

  • @f15srinivas82
    @f15srinivas82 7 місяців тому

    there should be another name for this channel that is 'bro god" really you are god for us bro.

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

      This is extreme man. "god" ?. You should speak for yourself.

    • @mechagear4819
      @mechagear4819 Місяць тому

      @@richardsijebor2059 shut your dumbass up lil boy

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

    ✅ 10th October - 2024

  • @ابوعمر-ذ3س3ج
    @ابوعمر-ذ3س3ج 8 місяців тому

    Drop check doesn't work in Microsoft sql can anyone help

    • @dae-dalus
      @dae-dalus 8 місяців тому

      DROP CONSTRAINT should work

  • @OliviaChen0806
    @OliviaChen0806 2 роки тому

    Morning, Where is the game bro 🥹

  • @Kanal-l6o
    @Kanal-l6o 2 роки тому

    S

  • @Kanal-l6o
    @Kanal-l6o 2 роки тому

    Y

  • @Kanal-l6o
    @Kanal-l6o 2 роки тому

    E

  • @fyrukmcoo100
    @fyrukmcoo100 2 роки тому

    :((