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.
SQL
SQL stands for Structured Query Language, is a form of communication that uses queries structured in a specific format to store, manage & retrieve data from a relational database.
Queries
A query is a type of computer programming language that is used to retrieve data from a database. Databases are useful in a variety of ways. They enable the retrieval of records or parts of records, as well as the performance of various calculations prior to displaying the results. A search query is one type of query that many people perform several times per day. A search query is executed every time you use a search engine to find something. When you press the Enter key, the keywords are sent to the search engine, where they are processed by an algorithm that retrieves related results from the search index. Your query's results are displayed on a search engine results page, or SER.
![### 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](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2F8cbd942a-4001-428f-8096-cb448132d9ba%2F6ef8b72e-c65a-4b8b-a3dc-d18b4b41c989%2Fhvnpl3n_processed.jpeg&w=3840&q=75)
![**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.](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2F8cbd942a-4001-428f-8096-cb448132d9ba%2F6ef8b72e-c65a-4b8b-a3dc-d18b4b41c989%2Fen816jc_processed.jpeg&w=3840&q=75)
![](/static/compass_v2/shared-icons/check-mark.png)
Trending now
This is a popular solution!
Step by step
Solved in 2 steps
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)
![Database System Concepts](https://www.bartleby.com/isbn_cover_images/9780078022159/9780078022159_smallCoverImage.jpg)
![Starting Out with Python (4th Edition)](https://www.bartleby.com/isbn_cover_images/9780134444321/9780134444321_smallCoverImage.gif)
![Digital Fundamentals (11th Edition)](https://www.bartleby.com/isbn_cover_images/9780132737968/9780132737968_smallCoverImage.gif)
![Database System Concepts](https://www.bartleby.com/isbn_cover_images/9780078022159/9780078022159_smallCoverImage.jpg)
![Starting Out with Python (4th Edition)](https://www.bartleby.com/isbn_cover_images/9780134444321/9780134444321_smallCoverImage.gif)
![Digital Fundamentals (11th Edition)](https://www.bartleby.com/isbn_cover_images/9780132737968/9780132737968_smallCoverImage.gif)
![C How to Program (8th Edition)](https://www.bartleby.com/isbn_cover_images/9780133976892/9780133976892_smallCoverImage.gif)
![Database Systems: Design, Implementation, & Manag…](https://www.bartleby.com/isbn_cover_images/9781337627900/9781337627900_smallCoverImage.gif)
![Programmable Logic Controllers](https://www.bartleby.com/isbn_cover_images/9780073373843/9780073373843_smallCoverImage.gif)