Jan 09, 2022 05:39 PM
Hi,
I’m having an issue with linking two tables together. I have a ‘Companies’ table and an ‘Employees’ table. In the employees table I have a column named ‘Job Title’ in addition to the column linked to the companies table. My issue is that sometimes a person is connected to two companies. One can be an executive in a one company and a board member in another. So, how do you state or clarify the two job titles in the database schema. You can easily have two companies in the “companies” column but the Job title will be wrong as it might not specify the company where he/she hold that job title (Imaging the companies column having two companies and the job title saying ‘Executive’ or ‘executive, board member’ to make it more ambiguous!)
I thought of having a column in the companies table named “board members” and link it to employees table and then another column named executive and link it to employees table too. But I think it’s a bit limiting in that you can have a column for every title since different companies might have different structures/hierarchies. Any other solutions?
Jan 09, 2022 06:13 PM
Your best solution would be to create a base with a many-to-many relationship structure.
Here is Airtable’s support article on that:
Jan 10, 2022 06:59 PM
Thank you for your answer, Scott. And I’d like to take this opportunity to thank for your contributions in this community. Whenever I face an issue I come here knowing that someone must have had it, only to find you helping. Thanks!
To our issue at hand :grinning_face_with_sweat: ، many-to-many relationships here helps us connecting companies to employees but it doesn’t help when it comes to job titles which is the main issue. One person might be connecting to two companies in two different ways and that’s why I’m struggling with; Telling Airtable that person A is a ‘Founder’ in Company X and a ‘Board Member’ in company Y.
The two approaches I’m thinking of are:
I’m still trying to wrap my head + experimenting with the second approach to see if it’s the way to go.
Curious what you think though…
Jan 10, 2022 11:54 PM
The second approach is probably exactly what Scott was suggesting.
Jan 11, 2022 04:30 AM
That is very kind of you to say! :hugs: Thank you so much! :smiling_face_with_three_hearts:
Kamille is 100% correct. :100:
Your 2nd approach is called a many-to-many relationship, and it’s what I was suggesting.