Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

2- List the agents with salaries greater than the average salary of all agents 3

ID: 3738333 • Letter: 2

Question

2- List the agents with salaries greater than the average salary of all agents 3- List the first and last names, the salary, the branch number, and branch address of all agents sorted in the descending order of the salary The following join query lists information of agents living and working in the same state agentNo, fName, 1Name, a.eity As acity, b.city As bcity, a.state TROM Agents a, Branches b WIERE a.branchNo b.branchNo AND a.state - b.statea 4- What is the SQL query that provides the number and the sum of salaries of agents living and working in the same state? 5- Using a join query, list the agentNo, first and last names, the city and the state of agents living and working in the same city. 6- Remove all agents with NULL phone1 values. 7- Using an outer join, list the branch number, the branch address, the branch city and the branch state of all branches and the agent number, the first and last names of any agents working in these branches, sorted by the branch state and the branch address. 8- Give a 10% salary increase to all agents living in the state New Jersey 9- Insert into the Branches table the new branch B012 located at 2854 Steinway St, Astoria, Queens, NY The following SQL query lists the counties where branches are located or agents are living: SELECT COUNTY FROM Branches UNION SELECT County FROM Agents: 10-Similarly type and execute the sQl query that lists the counties that have both branches and agents 11-Type and execute the SQL query that lists all counties where there is a branch but no agents. Note that instead of EXCEPT, Oracle is using the operator MINUS

Explanation / Answer

Remove all agents with NULL phone1 values:

DELETE FROM Agents WHERE phone1 IS NULL;

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote