I’m building a website where I will have users logging into the site from multiple sources, including Facebook and Google+ and I want to be able to keep some basic info on each user in my data base, so that I can track the creation of things like comments and posts. How do I efficiently do this in a SQL database. Do I create a new table for each type of user?
Share
The usual approach is:
USERtable with the common dataFACEBOOK_USERtable (which has it’s own PK and aUSERFK) with the Facebook specific dataGOOGLE_USERtable…When loading a user, you can join all those tables or you can create a view that contains the join or, if you have many special types, you can load the user and then read the others individually (maybe keep a
IS_x_USERin theUSERtable to speed this up).