Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

There are three relations in the following schema for the company: 1. EMPLOYEE (National_ID, Employee_Name, Salary, Service_Unit), 2. EMPLOYER (National_ID, Employer_Name, Salary, Service_Unit), 3. UNIT

There are three relations in the following schema for the company: 1. EMPLOYEE (National_ID, Employee_Name, Salary, Service_Unit), 2. EMPLOYER (National_ID, Employer_Name, Salary, Service_Unit), 3. UNIT (Service_Unit, Contact_Phone_Number). Primary key has been underlined. The data stored in the schema has been shown as follows:

image text in transcribed

Write SQL commands for the following instructions one-by-one (24%, 4 points each):

1. Please add a new record of employee with the National ID: P129799311, Name: Nohara Hiroshi, Service unit: Kasukabe Defence Force, Salary: $367,000.

2. We would like to raise the salary of Isaac Netero to $65,000.

3. Please list all the information of employee with the salary over $75,000 or between $30,000 and $40,000.

4. Please calculate the average salary and the total number of employees in the company.

5. If the company decides to raise the salary of the employers by 5%, please list the employers name and the new salary.

6. Please list all the employees' name and order with the salary.

National_ID A123456789 F223456779 D123987654 EMPLOYEE Employee_Name Salary Kamado Tanjirou 70,000 Nene Sakurada 42,000 Agatsuma Zenitsu 80,000 Conan Edogawa 35,000 Palm Siberia 90,000 Service_Unit Demon Slayer Corps Kasukabe Defence Force Demon Slayer Corps Detective Boys A124567927 P227891237 Hunter Association National_ID K171513759 H251134321 EMPLOYER Employer_Name Salary Isaac Netero 110,000 Tsuyuri Kanao 90,000 Yoshida Ayumi 60,000 Nohara Shinnosuke 58,000 Service_Unit Hunter Association Demon Slayer Corps Detective Boys Kasukabe Defence Force A231451987 F127123456 UNIT Contact Phone_Number 3356789 Service_Unit Kasukabe Defence Force Hunter Association Detective Boys Demon Slayer Corps 4466812 5134999 1155214

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

Main Memory Database Systems

Authors: Frans Faerber, Alfons Kemper, Per-Åke Alfons

1st Edition

1680833243, 978-1680833249

More Books

Students also viewed these Databases questions

Question

6. How do histories influence the process of identity formation?

Answered: 1 week ago