Last active
June 28, 2023 05:59
-
-
Save mjapanwala/75a12ddef9f241e469a7aedfdd4c3285 to your computer and use it in GitHub Desktop.
One - Many Relationship
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
In a one to many relationship these things are key. | |
Suppose you have two tables, one users and the other is orders. In the users table you can have columns such as | |
PRIMARY_KEY UNIQUE AUTO_INCREMENT number, VARCHAR(255) email. | |
The orders table you have the column order_date date, PRIMARY_KEY AUTO_INCREMENT UNIQUE, price FLOAT, FOREIGN_KEY users.PRIMARY_KEY | |
This would be a parent - child relationship, the parent is the users and the child is the orders. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment