Above is my simple database design, just wanted to gain information about how things happen as I'm really new at database. Following are my questions:
as I update wall_id in walls table, does the wall_id in wall_categories table also get updated? as the wall_id in wall_categories table references to wall_id in walls table.
same with desktop_id in walls table since it is a foreign key referencing to desktop_id in desktop_wall table, so when I update desktop_id in walls table does the desktop_id in deskotp_wall also gets updated?
if it does not update by default, how can this be done?
Thanks a lot!
This feature is called cascading referential integrity. It's optional when you define a foreign key constraint. The syntax to enable it is described here (Micorosoft SQL but the syntax is standard and most DBMSs support it):
http://technet.microsoft.com/en-us/library/ms186973(v=sql.105).aspx