Computer Science, asked by sainag5959, 2 months ago

Consider the schema with below tables
L
Table Name
Columns
people
company_id, id, name
companies
id, location_id, name
locations
id, name
For the location with the most companies, list the names of the people and the
companies they work for.
The output should consist of: User_Name Company Name Location​

Attachments:

Answers

Answered by shaurya56466
0

Answer:

what do you want in this sorry

Answered by rajeshkashyap60
0

Answer:

select p.name, c.name,l.name from people p join  

companies c on p.company_id = c.id

join locations l on c.location_id = l.id

where l.id in (

select distinct location_id from  

(select c.location_id,count(distinct id)  from companies c group by c.location_id order by  count(distinct c.id) desc limit 1) sql_sikh_lo_didi);

Explanation:

Read SQL

Similar questions