MySQL: PRIMARY KEYS are easy

preview_player
Показать описание
#MySQL #tutorial #course

00:00:00 introduction
00:00:46 PRIMARY KEY with a new table
00:01:34 PRIMARY KEY with an existing table
00:02:11 examples
00:04:56 conclusion

– 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);
Рекомендации по теме
Комментарии
Автор

– 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);

BroCodez
Автор

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

RGGBMGO
Автор

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

themachina
Автор

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

luistroyparaiso
Автор

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??

kusumaparimi
Автор

Thank you for this video big bro.

Pls what is the difference between the primary key and the unique constraint?

princeakinolaoluwagbemigag
Автор

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

crackrokmccaib
Автор

make subtitles for portuguese br please😳😳😳

emanuelitalo
Автор

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

farhangmdc