(德文) Duda sobre las llavees foráneas de la fila con un dato nulo que nunica debió serlo (法语)

作者: moshpirit创建于 2024年2月26日更新于 2024年2月26日

Hello Brais, first of all, congratulations on your great work, I'm loving the video ❤️ My question is about a specific section of the video, specifically at 4:17:53. We are analyzing N:M relationships; and you show us the importance of declaring the attributes of the columns well with an example, in which we want to relate a user table to the programming languages they know how to program. First, you show us how the data is inserted ( INSERT INTO users_languages(users_id, languages_id) VALUES (1,1)), and then (4:22:13) you only include the first field ( INSERT INTO users_languages(users_id) VALUES (1)). Workbench screams "the following task will not be executed" because we have not specified that neither users_id nor languages_id are not null (4:23:55).

After that, you delete the row, try to update the table so that it does not accept non-null values, and then it screams because it has foreign keys. But right after that, it lets you change the table attributes (4:25:30) and I don't really understand why, what changed from one moment to the next? In the video, it seems that you don't change anything, you just review the tables. I don't know if it's visible on the Twitch live stream, but I'd like to know what to do in the hypothetical case that something similar happens to me.

内容来源: mouredev/hello-sql