2. Using the EMPLOYEE, JOB, and PROJECT tables in the Ch07_ConstructCo data- base, write the SQL code that will join the EMPLOYEE and PROJECT tables using EMP_NUM as the common attribute. Display the attributes shown in the results presented in Figure P7.2, sorted by project value.

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
100%
### Figure P7.1: The CH07 Construction Database

#### Relational Diagram

The relational diagram illustrates the design of the CH07 Construction Company database, showcasing the relationships between four key tables: JOB, EMPLOYEE, ASSIGNMENT, and PROJECT. 

- **JOB**: Contains job details, including descriptions and hourly charges.
- **EMPLOYEE**: Stores employee information such as names, job codes, and employment years.
- **ASSIGNMENT**: Links employees to their assigned projects along with specific job roles, dates, hours assigned, and charges.
- **PROJECT**: Details different projects, their values, and assigned employees.

### Table Details

#### Table Name: JOB

| JOB_CODE | JOB_DESCRIPTION      | JOB_CHG_HOUR | JOB_LAST_UPDATE |
|----------|----------------------|--------------|-----------------|
| 500      | Programmer           | 35.75        | 20-Nov-17       |
| 501      | Systems Analyst      | 96.75        | 20-Nov-17       |
| 502      | Database Designer    | 72.50        | 20-Nov-17       |
| 503      | Technical Engineer   | 54.00        | 20-Nov-17       |
| 504      | Mechanical Engineer  | 67.90        | 20-Nov-17       |
| 505      | Civil Engineer       | 84.25        | 20-Nov-17       |
| 506      | Clerical Support     | 25.90        | 20-Nov-17       |
| 507      | Analyst              | 48.95        | 20-Nov-17       |
| 508      | Applications Designer| 55.75        | 20-Nov-17       |
| 509      | Bio Technician       | 34.50        | 20-Nov-17       |
| 510      | General Support      | 18.36        | 20-Nov-17       |

#### Table Name: EMPLOYEE

| EMP_NUM | EMP_LNAME   | EMP_FNAME | EMP_INITIAL | EMP_HIREDATE | JOB_CODE | EMP_YEARS |
|---------|-------------|-----------|-------------|--------------|----------|-----------|
| 101     | News        | John      | G           | 08-Nov-04    | 500      | 17        |
| 102     | Senior      | David
Transcribed Image Text:### Figure P7.1: The CH07 Construction Database #### Relational Diagram The relational diagram illustrates the design of the CH07 Construction Company database, showcasing the relationships between four key tables: JOB, EMPLOYEE, ASSIGNMENT, and PROJECT. - **JOB**: Contains job details, including descriptions and hourly charges. - **EMPLOYEE**: Stores employee information such as names, job codes, and employment years. - **ASSIGNMENT**: Links employees to their assigned projects along with specific job roles, dates, hours assigned, and charges. - **PROJECT**: Details different projects, their values, and assigned employees. ### Table Details #### Table Name: JOB | JOB_CODE | JOB_DESCRIPTION | JOB_CHG_HOUR | JOB_LAST_UPDATE | |----------|----------------------|--------------|-----------------| | 500 | Programmer | 35.75 | 20-Nov-17 | | 501 | Systems Analyst | 96.75 | 20-Nov-17 | | 502 | Database Designer | 72.50 | 20-Nov-17 | | 503 | Technical Engineer | 54.00 | 20-Nov-17 | | 504 | Mechanical Engineer | 67.90 | 20-Nov-17 | | 505 | Civil Engineer | 84.25 | 20-Nov-17 | | 506 | Clerical Support | 25.90 | 20-Nov-17 | | 507 | Analyst | 48.95 | 20-Nov-17 | | 508 | Applications Designer| 55.75 | 20-Nov-17 | | 509 | Bio Technician | 34.50 | 20-Nov-17 | | 510 | General Support | 18.36 | 20-Nov-17 | #### Table Name: EMPLOYEE | EMP_NUM | EMP_LNAME | EMP_FNAME | EMP_INITIAL | EMP_HIREDATE | JOB_CODE | EMP_YEARS | |---------|-------------|-----------|-------------|--------------|----------|-----------| | 101 | News | John | G | 08-Nov-04 | 500 | 17 | | 102 | Senior | David
**Educational Text for Database Query Example**

**Figure P7.2: The Query Results for Problem 2**

This example demonstrates the results of a SQL query designed to join the EMPLOYEE and PROJECT tables using the common attribute EMP_NUM and to display selected attributes sorted by project value. Here is a breakdown of the table data:

1. **Columns**:
   - **PROJ_NAME**: Name of the project.
   - **PROJ_VALUE**: Total financial value assigned to the project.
   - **PROJ_BALANCE**: Remaining balance or funds available for the project.
   - **EMP_LNAME**: Last name of the employee involved with the project.
   - **EMP_FNAME**: First name of the employee.
   - **EMP_INITIAL**: Initial or middle name of the employee.
   - **JOB_CODE**: Code representing the employee's job function.
   - **JOB_DESCRIPTION**: Description of the job role of the employee.
   - **JOB_CHG_HOUR**: Charge per hour for the employee’s job role.

2. **Data Entries**:
   - For the project "Rolling Tide," the project value is 805,000.00 with a balance of 500,345.20. The employee associated is David Senior, a Systems Analyst with a job code of 501, charging 96.75 per hour.
   - The "Evergreen" project has a value of 1,435,500.00 and a balance of 1,002,350.00. The associated employee is June Arbouugh, a Programmer with a job code of 500, charging 35.75 per hour.
   - "Starflight" has a project value of 2,650,500.00 and a balance of 2,309,880.00, managed by Maria Alonzo, a Programmer with job code 500, with a rate of 35.75 per hour.
   - For "Amber Wave," the value is 3,500,650.00 with a balance of 2,110,346.00. Ralph Washington, a Systems Analyst, is the associated employee with a job code of 501, charging 96.75 per hour.

This structured table provides a clear view of how employee roles and project financials are interconnected within the ConstructCo database, allowing for efficient data analysis and resource management.
Transcribed Image Text:**Educational Text for Database Query Example** **Figure P7.2: The Query Results for Problem 2** This example demonstrates the results of a SQL query designed to join the EMPLOYEE and PROJECT tables using the common attribute EMP_NUM and to display selected attributes sorted by project value. Here is a breakdown of the table data: 1. **Columns**: - **PROJ_NAME**: Name of the project. - **PROJ_VALUE**: Total financial value assigned to the project. - **PROJ_BALANCE**: Remaining balance or funds available for the project. - **EMP_LNAME**: Last name of the employee involved with the project. - **EMP_FNAME**: First name of the employee. - **EMP_INITIAL**: Initial or middle name of the employee. - **JOB_CODE**: Code representing the employee's job function. - **JOB_DESCRIPTION**: Description of the job role of the employee. - **JOB_CHG_HOUR**: Charge per hour for the employee’s job role. 2. **Data Entries**: - For the project "Rolling Tide," the project value is 805,000.00 with a balance of 500,345.20. The employee associated is David Senior, a Systems Analyst with a job code of 501, charging 96.75 per hour. - The "Evergreen" project has a value of 1,435,500.00 and a balance of 1,002,350.00. The associated employee is June Arbouugh, a Programmer with a job code of 500, charging 35.75 per hour. - "Starflight" has a project value of 2,650,500.00 and a balance of 2,309,880.00, managed by Maria Alonzo, a Programmer with job code 500, with a rate of 35.75 per hour. - For "Amber Wave," the value is 3,500,650.00 with a balance of 2,110,346.00. Ralph Washington, a Systems Analyst, is the associated employee with a job code of 501, charging 96.75 per hour. This structured table provides a clear view of how employee roles and project financials are interconnected within the ConstructCo database, allowing for efficient data analysis and resource management.
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 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.
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