05.05.2016, 02:24
Heya there, I can't really understand the way foreign keys works in SAMP MySQL
If I have a parent table called users, and two child tables called toys and weapons
And I foreign them on the Auto Increase Primary column named ID (which exists in all of them)
If I insert data to the users table (ID Password and Name for example)
1. Would that automatically add a row with the given ID to the child tables ?
2. If I wipe one row from the users table, would that wipe the rows from the child tables aswell ?
Note: I put it to RESTRICT on both update and delete
If I have a parent table called users, and two child tables called toys and weapons
And I foreign them on the Auto Increase Primary column named ID (which exists in all of them)
If I insert data to the users table (ID Password and Name for example)
1. Would that automatically add a row with the given ID to the child tables ?
2. If I wipe one row from the users table, would that wipe the rows from the child tables aswell ?
Note: I put it to RESTRICT on both update and delete