Похожие чаты

Hello is product_id here : DELETE FROM products WHERE product_id=1

should be defined as a PRIMARY KEY When creating the table in order for this query to be executed well ?

6 ответов

22 просмотра

It's totally optional, primary keys are defined in order to have one or more columns to uniquely identify a row in a table. CREATE TABLE article ( id PRIMARY KEY ); // <--- angry face? xD In the table article, the column id will uniquely identify an article entry (row). Behind the scenes, a primary key constrain will make the column(s) UNIQUE and NOT NULL

Edwing123
It's totally optional, primary keys are defined in...

All of this is optional, but the nice thing about it is: if you use these constraints, whenever you make a mistake (enter an article with an id value that already exists), the database server will throw an error

Read about it on Google, you'll find a lot of information regarding DELETE FROM 😶

It should work fine without it being defined as primary key, although ids are usually defined as such

𝘼𝙗𝙙𝙤-🧢 Автор вопроса
Edwing123
All of this is optional, but the nice thing about ...

thanks very much , thanks for all this clear explanation !!

Похожие вопросы

Обсуждают сегодня

Господа, а что сейчас вообще с рынком труда на делфи происходит? Какова ситуация?
Rꙮman Yankꙮvsky
29
А вообще, что может смущать в самой Julia - бы сказал, что нет единого стандартного подхода по многим моментам, поэтому многое выглядит как "хаки" и произвол. Короче говоря, с...
Viktor G.
2
@Benzenoid can you tell me the easiest, and safest way to bu.y HEX now?
Živa Žena
20
This is a question from my wife who make a fortune with memes 😂😂 About the Migration and Tokens: 1. How will the old tokens be migrated to the new $LGCYX network? What is th...
🍿 °anton°
2
30500 за редактор? )
Владимир
47
а через ESC-код ?
Alexey Kulakov
29
What is the Dex situation? Agora team started with the Pnetwork for their dex which helped them both with integration. It’s completed but as you can see from the Pnetwork ann...
Ben
1
Гайс, вопрос для разносторонее развитых: читаю стрим с юарта, нада выделять с него фреймы с определенной структурой, если ли чо готовое, или долбаться с ринг буффером? нада у...
Vitaly
9
Anyone knows where there are some instructions or discort about failed bridge transactions ?
Jochem
21
@lozuk how do I get my phex copies of my ehex from a atomic wallet, to move to my rabby?
Justfrontin 👀
11
Карта сайта