can any one answer this query,thank you in advance
Table 1 has 2 columns: EmployeeId, T shirtsize(values can
be 1,2,3)
Table 2 has 2 columns: EmployeeId, Region
Write SQL to Find the region which has the largest number
of people with Tshirt size=3
Answer Posted / lakram5455
SELECT a.Region FROM
(SELECT TOP(1) a.TSize, COUNT(a.EId) AS TotalCount, b.Region
FROM emp a INNER JOIN Region b ON b.EId = a.EId WHERE TSize
= 3 GROUP BY a.TSize, b.Region ORDER BY TotalCount DESC) a
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
You have a table with close to 100 million records recently, a huge amount of this data was updated now, various queries against this table have slowed down considerably what is the quickest option to remedy the situation?
1.what are diff types of joins , and explain diff between cross join and full outer join 2.diff types of views 3. Diff types of index 4. What is diff b/w stores procedure and function procedure 5.diff between double and int in SQL 6.diff between char and varchar in SQL. 7.Oracle or SQL whice you will preferred and why.
What are sub reports and how to create them?
How do I setup a local sql server database?
How to copy data from one table to another table?
Explain temporary table vs table variable by using cursor alternative?
What is an identity column in insert statements?
what stored procedure can you use to display the current processes? : Sql server administration
How do I uninstall sql server 2014?
How to get a list of columns using the "sys.columns" view in ms sql server?
how to take backup bcp out for a column in table in sql server?
How to update values in a table with update statements in ms sql server?
How do you delete a data source?
You schedule a job to run every minute what will happen if the first job runs more than 1 min? Will the second instance of the job start?
Where are full-text indexes stored?