'Database model for multiple user types

I am working on a project that is very similar to Fiverr (https://www.fiverr.com/). Users who are Service Providers can post jobs, and users who are Service Seekers can hire those providers to complete that job (e.g. Web Development), and it's important to note that users can be both Providers and Seekers if applicable.

I'm wondering what an efficient way to model the user data would be for this situation. I am thinking of having a Users table, as well as a ServiceProviders table, and use the user_id as a foreign key in the ServiceProviders table, allowing me to store additional data on about the Provider that normal users don't have. Then, I would only create an entry in the ServiceProviders table if the user chooses to "Become a Service Provider".

Do I seem to be on the right track here?

Also, for the Jobs/Gigs table, would it be better to use the user_id or the service_provider_id as the foreign key? I'm not sure as the ServiceProviders table already has the user_id as the foreign key.

I'd appreciate any and all feedback on this!

Much appreciated.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source