- 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;
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.
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)
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?
- 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;
You're literally carrying me through Uni right now. Thank you, Bro. Truly.
Literally?
That fast forwarded typing sound so satisfying
We literally started sql today your timing is great thank you.
same
best channel ever!
You are good man you make it easy for us
your tutorial is great could please make a tutorial for node js and dyango 💗
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.
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)
ALTER ADD not working with constrain. Error code 3819 Check Constraint 'chk_hourly_pay' is violated
thanks bro
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?
In the output window, it lists the action you make; you can find out what name have you mistyped from there.
First comment !!! U make my day Bro :D
🎉
there should be another name for this channel that is 'bro god" really you are god for us bro.
This is extreme man. "god" ?. You should speak for yourself.
@@richardsijebor2059 shut your dumbass up lil boy
✅ 10th October - 2024
Drop check doesn't work in Microsoft sql can anyone help
DROP CONSTRAINT should work
Morning, Where is the game bro 🥹
S
Y
E
:((