Professional Documents
Culture Documents
Delvin Grant
Table of Contents:
Assumptions
SQL Code
SQL Reports
6-14
Relational Schema
15
Relational Diagram
16
17
Assumptions: I am assuming that the company is a consulting firm named Deloitte. I am assuming that all consultants no matter what their hire-date in the same class are paid the same.
Why I chose each report: 1. Calculating a contracts total cost. The total cost of each contract is a calculated value using the hourly rate and estimated hours to give the exact billed amount to the client. 2. Listing each Deloitte Client. Firms make print-outs of their current clients all the time to analyze how many clients they have, who their clients are, and where they live. 3. Report listing the clients based on region. This query gives you a list of clients based on their region so that the firm can assign a consultant to the right client, this query can also be used to analyze how many clients are in specific regions. 4. Report listing the consultants based on region. This query is useful for the firm to assign a consultant to the clients, it is used mostly by management. 5. Number of contracts per client. This query will give you a count of how many contracts each individual client has. This is useful to the firm because it can assess which of their clients give them the most business. 6. List all the contracts from the year 2001. Firms like to see which contracts they had signed in a specific year. With this query, the firm can see the contract number as well as the date that the contract was obtained. 7. List the consultants in accordance to their skills. Since many consultants can have multiple skills, this query will list the consultants along with their skills in order of the consultants last name. 8. List the contracts that have over 150 hours. A firm can run this query to see which contracts took significantly longer and even give discounts to clients that are spending more hours. 9. List the number of consultants in each class. This query will show which classes have multiple consultants that possess the skill. Sometimes the firm will use a consultant that usually does a certain task for other tasks because the consultant is proficient in multiple skills. 10. Count the number of contracts that one consultant is working on. This query would essentially tell the firm how many contracts a specific consultant is working on and this is useful because if there is too many contracts in a specific region, they can give contracts to other consultants in the region. 11. How much money did the firm generate in each year. This query would show the total amount of money that the firm received in a specific year. To derive this value I would need to sum up the total amounts of each contract for that specific year.
2. 3.
4.
5. 6. 7.
8.
9.
10
11
12
13
14
Relational Schema:
CLIENT(CLIENT_ID, CLIENT_FNAME, CLIENT_MINIT, CLIENT_LNAME, CLIENT_PHONE, CLIENT_ADDRESS, REGION_CODE) CONTRACT(CONTR_NUM, CONTR_DATE, CLIENT_ID) CONSULTANT(CONSULT_ID, CONSULT_FNAME, CONSULT_MINIT, CONSULT_LNAME, CONSULT_ PHONE, CONSULT_ ADDRESS, REGION_CODE,CONSULT_START_DATE) CLASS(CLASS_ID, CLASS_DESC, CLASS_CHG_HOUR) REGION(REGION_CODE, REGION_DESC) CONSULT_CLASS(CONSULT_CLASS_ID,CONSULT_ID,CLASS_ID) CONTR_CONSULT_CLASS(CONTR_CONSULT_CLASS_ID,CONTR_NUM,CONSULT_CLASS_ID, EST_CONSULT_HOURS)
15
Relational Diagram:
16
17