I have two tables that have foreign keys to each other's primary key. This DB is in French. I will translate the two tables that I want to you to understand.
- Atelier Cuisine ==> Kitchen
- Cuisinier == > Cooking chef
So in this picture we see that in the Kitchen
table we have a PK referenced by the FK from the Cooking chef
table; in the Cooking chef
table we have a PK referenced by the FK from the Kitchen
table. So I am confused. I don't understand this kind of relationship between these tables.
And I hope to check my query that I did to create these two tables if its correct
CREATE TABLE [ATELIER CUISINE] (
NumCuisine INT NOT NULL PRIMARY KEY,
TelCuisine VARCHAR(50) NOT NULL
)
CREATE TABLE CUISINIER (
NumCuisinier INT NOT NULL PRIMARY KEY,
NomCuis VARCHAR(50) NOT NULL,
DateEmb DATE NOT NULL,
NumCuisine INT NOT NULL CONSTRAINT FK_CUISINIER_NumCuisine FOREIGN KEY REFERENCES [ATELIER CUISINE](NumCuisine)
See the Image here:
Relationship model of the restaurant database
See the Image here:
Example records for some tables