Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Below tables represent part of the schema for a company database. The company has different branches in different cities. The city attribute shows the city

image text in transcribed

Below tables represent part of the schema for a company database. The company has different branches in different cities. The city attribute shows the city that a branch is located in several branches can be located in the same city CREATE TABLE branch (Id INT PRIMARY KEY City VARCHAR(255) NOT NULL): CREATE TABLE employee (Id INT PRIMARY KEY, Fname VARCHAR(255) NOT NULL Lname VARCHAR(255) NOT NULL Birth date DATE NOT NULL Salary DOUBLE NOT NULL Branch id INT NOT NULL FOREIGN (branch_id) REFERENCES branch(id)) engine = innodb Write a query that returns the maximum salary for each city. So you should return two columns, 'city' and 'salary'. The salary should be the highest employee salary among all branches in the city. There should be one row per city

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

Fundamentals Of Database System

Authors: Elmasri Ramez And Navathe Shamkant

7th Edition

978-9332582705

More Books

Students also viewed these Databases questions

Question

What external methods of recruitment are available?

Answered: 1 week ago