SQL Server 27 - How to Create FOREIGN KEY Constraints

preview_player
Показать описание


~~~~~~~~~~~~~~~ CONNECT ~~~~~~~~~~~~~~~

~~~~~~~~~~~~~~ SUPPORT ME ~~~~~~~~~~~~~~

🅑 Bitcoin - 3HnF1SWTzo1dCU7RwFLhgk7SYiVfV37Pbq
🅔 Eth - 0x350139af84b60d075a3a0379716040b63f6D3853
Рекомендации по теме
Комментарии
Автор

But SpeciesID is not a FOREIGN KEY in this example... (The FOREIGN KEY attribute is missing) ¿no?

Zetobis
Автор

I have been trying for days to figure out why I couldn't assign a foreign key to my table. Turns out I had to create the parent table first and then assign the key to the second table. After all the research, books, videos, tutorials. No one mentioned that there needs to be an order of creating tables. You solved my problem in just 2 minutes and I cant thank you enough!

mariosconstantinou
Автор

You're the best, man. SO many little things you throw out there that make it all much easier to understand. I would not be able to make it through my classes without your videos.

Shiyounin
Автор

Thanks, man!
I kept getting an error and I did not get why, but now I now that the attribute of the foreign key HAS TO BE UNIQUE!

Helped out a lot!

spacemeter
Автор

How do you create foreign key constraints by it self not next to the specific column name ? Not like the way you did it now

abebayehumengesha
Автор

Does the order of the tables created matter in a script? I want to reference other tables in the script that are only a few lines down, but I don't want to make an error.

carsonbrooks
Автор

WOW THANKYOU, literally no one else online explained it in a way I understood. I can hand in my assignment because of you.

Shylo-Mylo
Автор

Is it possible to add more than one foreign keys in one cell??

For table of movie and genre.
A Movie may have more than one genre in it. So can we add 2 or more genre in a column from Genre table?

antivenom
Автор

This is by far the best and simplest explanation I have ever seen.

jnmrgn
Автор

You Sir are Awesome!! I am new to SQL stuff. Your explanation are very clear. Thanks.

MTBikeBo
Автор

thanks for your explanation it is really helpful but i have a question. so what is the difference between running it with constraint ... foreign key... query? they do the same job.

emircankocatepe
Автор

Do you do personal tutoring? Please im need of assistance with my college material. :-/

vramgb
Автор

Your dog sneezing? that's him realizing you're not talking to him, he's not the center of the universe =O

AyarPortugal
Автор

SOMEONE HELP ME.... IT SAYS INVALID DATA TYPE
CREATE TABLE ORDERS
(
OR_ID NUMBER NOT NULL PRIMARY KEY,
C-ID NUMBER NOT NULL REFERENCE CUSTOMER(C_ID),
P_ID NUMBER NOT NULL REFERENCE PRODUCT(P_ID),
TRACK_NUM NUMBER NOT NULL,
ORDER_DATE DATE NOT NULL,
QUANTITY NUMBER NOT NULL,
SHIP_DATE DATE NOT NULL,
DELIVERY_DATE DATE NOT NULL,
PAY_TYPE VARCHAR2(4) NOT NULL
);

rifathossain
Автор

DROP TABLE IF EXISTS doesn't work

kylehawk
Автор

still benefit your playlist 2024, can you make one more latest for sql server playlist

anugupta
Автор

If there’s a ducking tech nerd downstairs trying to get information you’re risking your life just letting you know

ab_.
Автор

In the hierarchy of biological classification's eight major taxonomic ranks, species is literally as granular as you go. If you loaded up that table with several million animals like you said, every single species _would_ be unique by their binomial nomenclature.

I see what you're getting at, but the example's blatant gloss-over of high school biology lost me.

cwtrain