Say you have many tables with the names as Company1, Company2 etc. till Company 1000. Structure as given below:
Company 1 product cost($) A C1A B C1B C C1C
There are 1000 such tables . All cpmapnies sell 3 products A , B,C . How will you compare your company say Company 520 with all the other 1000 companies.
All these tables are under database
How to join all these tables in SQL simultaneously?
I very well know about joins, but I know that at one time we can only join two tables. Is there a way to join multiple tables together in SQL
product cost($)_Company1 cost($)_Company2 cost($)_Company3 A C1A C2A C3A B C1B C2B C3B C C1C C2C C3C and so on for all 1000 companies
Note in combined expected output, _Company name is appended to cost column names to identify the company corresponding to cost
I was asked this in interview, how you will do it at one go, and I didnt know the answer. Can anyone please help. Structures of tables as in names of columns in all tables is same
cost($) being the column names