Question

Step 1: Design and create the tables You must create additional tables to hold Project and...

Step 1: Design and create the tables You must create additional tables to hold Project and Activity Data. A project represents the construction of a facility with a limited scope of work and financial funding. A Project can be composed of many activities which indicate the different phases in the construction cycle. Example Project Name: Bobba Fett’s Bounty Chase Ride An activity represents the work that must be done to complete the project. Example Activity Name: For Example activity name could be “Phase 1 Design of Bounty Chase ride” Or name could be “Final construction of Bounty Chase ride” Etc… You must normalize the project table to come up with a new set of tables. You will then write the create script for these tables. Project (projectId, projectName, firmFedID, firmName, firmAddress, fundedbudget, projectStartDate, projectStatus , projectTypeCode, projectTypeDesc, projectedEndDate, projectManager, (activityId, activityName, costToDate, activityStatus, startDate,endDate) ) To normalize the tables, you must use the following function dependencies: ProjectId,ActivityId -> projectName, firmFedID, firmName, firmAddress, fundedbudget, startDate, projectStatus , projectTypeCode, projectTypeDesc, projectedEndDate, projectManager, activityName, costToDate, activityStatus, startDate, endDate. projectId -> projectName, firmFedID, fundedbudget, startDate, projectStatus , projectTypeCode, projectedEndDate, projectManager. projectTypeCode -> projectTypeDesc firmFedID -> firmName, firmAddress When creating the tables, use the following column names and data types (important) for columns: o projectId (char(4)) : A 4 character unique identifier (numbers and letters). o projectName (varchar(50)) : The name of the construction project. o firmFedID (char(9)) : A 9 character Federal ID (Example: 123456789) o firmName (varchar(50)): The name of the construction firm. o firmAddress (varchar(50)) : The address of the construction firm. o fundedbudget (decimal(16,2)): The money amount allocated to this project o projectStartDate (date): The date the project started. o projectstatus (varchar(25)): The status of the project (either active,inactive,cancelled,completed) o projectTypeCode (char(5)): The project type code are FAC, RIDE, RET, and FOOD. o projectTypeDesc (varchar(50)): The project type descriptions for a project are: Facility, Ride, Retail and Restaurant o projectedEndDate (date) The date the project is scheduled to end. o projectManager (char(8)) The employee number of the employee who is managing this project o activityId (char(4)): A 4 character unique identifier for the activity. o activityName (varchar(50)): The name of the activity. o costToDate (decimal(16,2)): The cost of the activity to date. o activityStatus (varchar(25)) : The status of the activity (either active, inactive, cancelled, completed) o startDate (date): The date the activity began. o endDate (date): The date the activity ended. You will write the script to create the tables which resulted from your normalization. Each table should have a primary key defined. You should have more than one table after you normalize.

NOTE IMPORTANT You should end up with at least: - a table will hold the main project data and will have projectId and projectName, along with other related fields. Please name this table, ProjectMain. - a table will hold the main activity data and will have activityId and activityName, along with other related fields. Please name this table, ActivityMain

Step 2: Create Stored Procedures to populate the tables You will create the SQL Scripts to create procedures to insert/ update data. The following definitions specify the parameters that can be passed in. The underlined parameters are required. Make sure that your procedure inserts records if the required parameters do not exist, but they update records if the required parameters do exist. For example: If SP_AddUpdateProject: passes in projectID “AA01” and it DOESN’T exist in the project table(s), it will insert the values passed in. If SP_AddUpdateProject: passes in projectID “AA01” and it DOES exist in the project table(s), it will UPDATE the values passed in for the AA01 record. Procedures Needed: - SP_AddUpdateProject: Adds/Updates a project with all the field information. o Parameters: projectId, projectName, firmFedID, fundedbudget, projectStartDate, projectStatus, projectTypeCode, projectedEndDate and projectManager - SP_DeleteProject: Deletes a project by the project Id. o Parameters: projectId - SP_AddUpdateActity: Adds/Updates activity with all the field information. o Parameters: activityId, activityName, projectId, costToDate, activityStatus, startDate, endDate - SP_DeleteActivity: Deletes an activity by the activity Id and projectId. o Parameters: projectId, activityId

Step 3: Create Stored Procedure to Process Project Delays You will create the SQL Script to create procedures to insert/ update data and process a project delay - SP_ProcessProjectDelay: Given a project Id, this procedure finds if any max end date of any activity within the project is after the project’s projected end date. If this happens, the procedure will calculate how many days it is late (use DATEDIFF) and fines the project $100 for each day late it is late. In addition, the project table’s “projectedenddate” will be updated with the new end date and the “fundedbudget” will be updated with the original funded budget plus the fines per day late. o Parameters: projectId.

Example: The Falcon Coaster has a ProjectId “AA01” has a projected end date of 6/30/2017. It has 2 activities: ActivityId: AA90 ActivityName: Build Coaster EndDate: 6/01/2017 ActivityId: AA91 ActivityName: Inspect Coster EndDate: 7/30/2017 Since Activity AA91 ends 30 days after the projected end date of the project, the project will have an additional $3,000 (30 X $100) added to the fundedbudget column’s original value. Also, the project’s new projected end date will be “7/30/17”

0 0
Add a comment Improve this question Transcribed image text
Answer #1

`Hey,

Note: Brother in case of any queries, just comment in box I would be very happy to assist all your queries

Normalized Tables

1.

Project(projectId ,projectName, firmFedID, fundedbudget, projectStartDate, projectStatus , projectTypeCode, projectedEndDate, projectManager)

2.

Firm(firmFedID, firmName, firmAddress)

3.

ProjectActivity(projectId,activityId , activityName, costToDate, activityStatus, startDate, endDate)

4.

ProjectType(projectTypeCode, projectTypeDesc)

underlined are primary keys and italicised are foreign keys.

sql tables

create table Project

(

projectId char(4) NOT NULL ,

projectName varchar(50) NOT NULL,

firmFedID char(9) NOT NULL ,

fundedbudget decimal(16,2) NOT NULL ,

projectStartDate date NOT NULL ,

projectStatus varchar(25) ,

projectTypeCode char(5) NOT NULL,

projectedEndDate date NOT NULL,

projectManager char(8) NOT NULL,

PRIMARY KEY (projectId),
FOREIGN KEY (firmFedID ) REFERENCES Firm (firmFedID ),

FOREIGN KEY (projectTypeCode ) REFERENCES ProjectType(projectTypeCode)

);

Create table Firm

(

firmFedID char(9) NOT NULL,

firmName varchar(50) NOT NULL,

firmAddress varchar(50) NOT NULL,

PRIMARY KEY (firmFedID)

);

Create table ProjectActivity

(

projectId char(4) NOT NULL,

activityId char(4) NOT NULL ,

activityName varchar(50) NOT NULL,

costToDate decimal(16,2) NOT NULL,

activityStatus varchar(25),

startDate date NOT NULL,

endDate date NOT NULL,

PRIMARY KEY (projectId,activityId),
FOREIGN KEY (projectId ) REFERENCES Project (projectId )

);

Create table ProjectType

(

projectTypeCode char(5) NOT NULL ,

projectTypeDesc varchar(50),

PRIMARY KEY(projectTypeCode)

);

Kindly revert for any queries

Thanks.

Add a comment
Know the answer?
Add Answer to:
Step 1: Design and create the tables You must create additional tables to hold Project and...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • You will create the following 4 triggers: - trgEmployee: Will be placed on the Employee table...

    You will create the following 4 triggers: - trgEmployee: Will be placed on the Employee table and listens for Inserts, Deletes, and Updates - trgJob: Will be placed on the Job table and listens for Inserts, Deletes, and Updates - trgProject: Will be placed on the Project table that contains the projectId and projectName. - trgActivity: Will be placed on the Activity table that contains the activityId and activityName. Again, each trigger will write to its respective audit table: trgProject...

  • Step 1: Create table audits via triggers The system must log any insertion, deletion, or updates...

    Step 1: Create table audits via triggers The system must log any insertion, deletion, or updates to the following tables: • Employee table (project 1) create table Employee ( empNumber char(8) not null, firstName varchar(25) null, lastName varchar(25) null, ssn char(9) null, address varchar(50) null, state char(2) null, zip char(5) null, jobCode char(4) null, dateOfBirth date null, certification bit null, salary money null, constraint PK_EMP PRIMARY KEY(empNumber), constraint EMP_STATECHECK CHECK(state in ('CA','FL')) ) GO • Job table (project 1) create...

  • - - Requirements Building upon your project 1 and project 2, the park will be a Star Wars themed ...

    - - Requirements Building upon your project 1 and project 2, the park will be a Star Wars themed park. You must design additional parts of the database and create the following SQL Script. Step 1: Create table audits via triggers The system must log any insertion, deletion, or updates to the following tables Employee table (project 1) Job table (project 1) ProjectMain table (Project 2) ActivityMain table (Project 2) . . For each one of the table above, you...

  • these are all tables please see the tables and questions are mentioned below please see that...

    these are all tables please see the tables and questions are mentioned below please see that all and I need answers asap please write proper answer it's an easy task and don't take much time please do it fast thanks in advance EMPLOYEE Remark Column Name EmployeeNumberINT Primary Key Yes No CHAR (25 CHAR (35 CHAR 25 NUMERIC INT CHAR (12 CHAR Name in the DEPARTMENT table Position No Number in the EMPLOYEE table Su OfficePhone EmailAddress No No No...

  • Write SQL Queries Given the following tables (7pts) Retrieve the names of employees and their project...

    Write SQL Queries Given the following tables (7pts) Retrieve the names of employees and their project name. If the employee never worked on a project, show the names only the name, not the project name. (7pts) Retrieve the names of employees who have worked on the same project at a different location. (7pts) Retrieve the names of employees who have worked on more than two different projects. (7pts) Retrieve the names of employees who manage more than two employees. CREATE...

  • Create a MySQL database according to design below: 10p salaries emp_no INT salary INT from_date DATE ◇ to-date DATE dept_emp ?emp_no INT ?dept_no CHAR(4) from-date DATE ◇ to-date DATE dept. no CHAR(4...

    Create a MySQL database according to design below: 10p salaries emp_no INT salary INT from_date DATE ◇ to-date DATE dept_emp ?emp_no INT ?dept_no CHAR(4) from-date DATE ◇ to-date DATE dept. no CHAR(4) dept name VARCHAR(40) emp_no INT birth-date DATE o first_name ARCHAR(14) ola丈-name VARCHAR( 16) | o gender ENUMM,F) o hire_date DATE ? dept no CHAR(4) emp_no INT ofrom_ date DATE to_date DATE titles emp_no INT tile VARCHAR(50) ?from_date DATE o to date DATE Add at least 5 r Explain...

  • For this set of Review Questions, we will create and use a database for the Wedgewood...

    For this set of Review Questions, we will create and use a database for the Wedgewood Pacific Corporation (WPC) that is similar to the Microsoft Access database we created and used in Chapters 1 and 2. Founded in 1957 in Seattle, Washington, WPC has grown into an internationally recognized organization. The company is located in two buildings. One building houses the Administration, Accounting, Finance, and Human Resources departments, and the second houses the Production, Marketing, and Information Systems departments. The...

  • SQL problem solving help; First 3 tables are finnished; Need help understanding on how to do...

    SQL problem solving help; First 3 tables are finnished; Need help understanding on how to do steps after. First 3 tables are after the first 2 images for reference if needed. //1// CREATE TABLE kr_customer ( Name VARCHAR(40) NOT NULL PRIMARY KEY, City VARCHAR(20), Status CHAR(1) ); //2// CREATE TABLE kr_salesperson ( Name VARCHAR(40) NOT NULL PRIMARY KEY, Age INT, Salary DECIMAL(8, 2) ); //3// CREATE TABLE kr_order ( Order_Number number(3) NOT NULL PRIMARY KEY, Customer_Name VARCHAR(40), Salesperson_Name VARCHAR(40), Amount...

  • Using SQL, carry out the various DML and DDL functions on the tables mentioned below: 1....

    Using SQL, carry out the various DML and DDL functions on the tables mentioned below: 1. Insert the data given above in both employee, department and project tables. 2. Display all the employees’ information. 3. Display Employee name along with his SSN and Supervisor SSN. 4. Display the employee names whose bdate is ’29-MAR-1959’. 5. Display salary of the employees without duplications. 6. Display the MgrSSN, MgrStartDate of the manager of ‘Finance’ department. 7. Modify the department number of an...

  • 1. Create the following tables and establish relationships. All fields are Varchar except parts price and date. Invoice Invoice_ID Customer_ID Part_Number Date...

    1. Create the following tables and establish relationships. All fields are Varchar except parts price and date. Invoice Invoice_ID Customer_ID Part_Number Date Customer Customer_ID Customer_Name Customer_Address Customer_Telephone Parts Part_Number Part_Description Parts_Price Supplier_ID Supplier Supplier_ID Supplier_Name Supplier_Address Sales_Rep 10 points 2. Populate data (you make it up) use at least one insert into query for each table the rest you can enter in grid view. 10 points (queries) 3. Update one of the supplier’s address. 4. Add a field named supplier...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT