Complete and print the following SQL transactions. Log your statements and resul
ID: 3708081 • Letter: C
Question
Complete and print the following SQL transactions. Log your statements and results by spooling your file (with echo on from Oracle if available).
List the agent type, agent type description, and count of agents for each agent type. Sort by count. Use the following column headings: AgentType, Desc, Count. Hint: use a GROUP BY clause.
ResDetail Customer CustlD CustFName CustLName CustPhone CustType LoyaltylD Reservation ResID CheckinDate CheckOutDate CustID AgentID ReslD Room CustType CustType CustTypeDesc RoomNum RateType RateAmt RoomType Agent AgentlD AgentFName AgentLName AgentType RateType RateType RateTypeDesc RoomType RoomType RoomTypeDesc AgentType AgentType AgentTypeDescExplanation / Answer
Answer:
select at.AgentType,at.AgentTypeDesc as "Desc",count(a.AgentID) as "Count"
from AgentType at
join Agent a on a.AgentType= at.AgentType
group by at.AgentType
order by count(at.AgentID);
/*This query will liist down the values of Agent Type,Description,Count in each Agent Type*/
Output:
AgentType Desc Count Facility Facilities Management 32 Network Network Team 12Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.