data base system
Database
2
Posts
2
Posters
0
Views
1
Watching
-
how i make the entity relation of "car selling and car purchase " plz help me about this question
-
how i make the entity relation of "car selling and car purchase " plz help me about this question
You draw an arrow from one entity to the other. Done. Did you mean in code? What database-system? Here's one in SQL92;
CREATE TABLE Car
(
cId INTEGER,
Description CHARACTER VARYING(50),
PRIMARY KEY (cId)
)CREATE TABLE CarPurchase
(
pId INTEGER,
boughtCar INTEGER,
PRIMARY KEY (pId),
FOREIGN KEY (boughtCar) REFERENCES Car
)This syntax should work on most systems.
Bastard Programmer from Hell :suss: