Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed
image text in transcribed
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

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Oracle Solaris 11.2 System Administration (oracle Press)

Authors: Harry Foxwell

1st Edition

007184421X, 9780071844215

More Books

Students also viewed these Databases questions