Question: Task 1 ( 1 0 pts ) : Executing all SQL scripts in hw 4 db . sql to create four tables and
Task pts: Executing all SQL scripts in hwdbsql to create four tables and have the corresponding data inserted. What to submit:
Four screenshots of executing the following SQL scripts. You need to execute them one by one, and the results of each execution should be the content of the table as an example shown below. Make sure all rows of each table are displayed in your screenshots.
SELECT FROM JOB;
SELECT FROM EMPLOYEE;
SELECT FROM PROJECT;
SELECT FROM ASSIGNMENT;
Example Screenshot:
Task to Task What to submit:
Your SQL statements for each task. Please make sure that we can copy and paste your SQL statements. Do not submit the screenshots of your SQL statements.
The screenshots of your execution of SQL statements are not required for these tasks, however, you can still add them to help explain your SQL statements better if you prefer.
Before working on Task please run the statement below to disable the safe update mode by executing the SQL statement below in your SQL client.
SET SQLSAFEUPDATES ;
Task pts: Write the SQL code to change the job code to for the person whose employee number EMPNUM is
Task pts: Write the SQL code to delete the row for William Smithfield, who was hired on June
Task pts: Write the SQL code that will add the attributes EMPPCT and PROJNUM to the EMPLOYEE table. The EMPPCT is the bonus percentage to be paid to each employee. The new attribute characteristics are
Task pts: Using the EMPLOYEE table, write a single SQL statement to change the EMPPCT value to for all employees.
Task pts: Write the SQL code that will change the PROJNUM to for employees who were hired after January and whose job code is greater than
Task pts: Write the SQL code that will delete the column of "JOBLASTUPDATE" from the JOB table.
Task pts: Write the SQL code that will add a constraint to the PROJBALANCE of the PROJECT table, which will make sure the value of PROJBALANCE is not negative.
Task pts: Write the SQL code that creates a new table named DEPENDENT, which is used to store the dependent information of employees. The DEPENDENT has the following information,
DEPNUM
DEPLNAME
DEPFNAME
RELATIONSHIP
DOB
EMPNUM
The DEPNUM should be an autoincrement field and used as the primary key of the table. EMPNUM is used as the foreign key of the table that links to the EMPLOYEE table. The value of EMPNUM in the DEPENDENT will be set to NULL if the corresponding employee is removed from the EMPLOYEE table.
Task pts: Write the SQL code to insert the following two dependents into the DEPENDENT table you created in Task
Dependent Dependent
Last name: Jordan
First name: Tom
RELATIONSHIP: child
DOB:
EMPNUM:
Last name: Jordan
First name: Alex
RELATIONSHIP: spouse
DOB:
EMPNUM:
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
