Create a view to show the total number of staff for each city with more than 1 staff. The output column header should be city, number_of_staff, sorted by the total number of staff from high to low.

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
icon
Concept explainers
Question

Create a view to show the total number of staff for each city with more than 1 staff. The output column header should be city, number_of_staff, sorted by the total number of staff from high to low.

Here is the transcription of the table:

| staffNo | fName  | lName | position  | sex | DOB        | salary  | branchNo | superno |
|---------|--------|-------|-----------|-----|------------|---------|----------|---------|
| ABC1    | New    | Engineer | Intern    | M   | 2000-01-01 | 9000.00 | B002     | SL21    |
| CC1     | Super  | User  | DBA       | M   | 1995-01-01 | 90000.00| B005     | SG14    |
| SA9     | Mary   | Howe  | Assistant | F   | 1970-02-19 | 9000.00 | B007     | SG5     |
| SG14    | David  | Ford  | Supervisor| M   | 1958-03-24 | 18000.00| B003     | SG5     |
| SG37    | Ann    | Beech | Assistant | F   | 1960-11-10 | 12000.00| B003     | SG5     |
| SG5     | Susan  | Brand | Manager   | F   | 1940-06-03 | 24000.00| B003     | SL21    |
| SL21    | John   | White | Manager   | M   | 1945-10-01 | 30000.00| B005     | NULL    |
| SL41    | Julie  | Lee   | Assistant | F   | 1965-06-13 | 9000.00 | B005     | SL21    |
| XY1     | New    | Tester| Assistant | M   | 1990-01-01 | 8000.00 | B002     | SL21    |

### Explanation:

- **staffNo**: Unique identifier for each staff member.
- **fName**: First name.
- **lName**: Last name.
- **position**: Job title.
- **sex**: Gender, either 'M' for male or 'F' for female.
- **DOB**: Date of Birth in the format YYYY-MM-DD.
- **salary**: Annual salary in dollars.
- **branchNo**: Branch number where the staff member is located.
- **
Transcribed Image Text:Here is the transcription of the table: | staffNo | fName | lName | position | sex | DOB | salary | branchNo | superno | |---------|--------|-------|-----------|-----|------------|---------|----------|---------| | ABC1 | New | Engineer | Intern | M | 2000-01-01 | 9000.00 | B002 | SL21 | | CC1 | Super | User | DBA | M | 1995-01-01 | 90000.00| B005 | SG14 | | SA9 | Mary | Howe | Assistant | F | 1970-02-19 | 9000.00 | B007 | SG5 | | SG14 | David | Ford | Supervisor| M | 1958-03-24 | 18000.00| B003 | SG5 | | SG37 | Ann | Beech | Assistant | F | 1960-11-10 | 12000.00| B003 | SG5 | | SG5 | Susan | Brand | Manager | F | 1940-06-03 | 24000.00| B003 | SL21 | | SL21 | John | White | Manager | M | 1945-10-01 | 30000.00| B005 | NULL | | SL41 | Julie | Lee | Assistant | F | 1965-06-13 | 9000.00 | B005 | SL21 | | XY1 | New | Tester| Assistant | M | 1990-01-01 | 8000.00 | B002 | SL21 | ### Explanation: - **staffNo**: Unique identifier for each staff member. - **fName**: First name. - **lName**: Last name. - **position**: Job title. - **sex**: Gender, either 'M' for male or 'F' for female. - **DOB**: Date of Birth in the format YYYY-MM-DD. - **salary**: Annual salary in dollars. - **branchNo**: Branch number where the staff member is located. - **
| Branch Number | Street Address       | City     | Postcode |
|---------------|----------------------|----------|----------|
| B002          | 56 Cover Drive       | London   | NW10 6EU |
| B003          | 163 Main Street      | Glasgow  | G11 9QX  |
| B004          | 32 Manse Road        | Bristol  | BS99 1NZ |
| B005          | 22 Deer Road         | London   | SW1 4EH  |
| B007          | 16 Argyll Street     | Aberdeen | AB2 3SU  |

This table presents a list of branch locations along with their specific street addresses, cities, and postcodes. Each row corresponds to a unique branch, identified by a distinctive branch number.
Transcribed Image Text:| Branch Number | Street Address | City | Postcode | |---------------|----------------------|----------|----------| | B002 | 56 Cover Drive | London | NW10 6EU | | B003 | 163 Main Street | Glasgow | G11 9QX | | B004 | 32 Manse Road | Bristol | BS99 1NZ | | B005 | 22 Deer Road | London | SW1 4EH | | B007 | 16 Argyll Street | Aberdeen | AB2 3SU | This table presents a list of branch locations along with their specific street addresses, cities, and postcodes. Each row corresponds to a unique branch, identified by a distinctive branch number.
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps

Blurred answer
Knowledge Booster
Query Syntax
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education