The Update EmployeeSalary sproc should take 2 input parameters, EmployeeID and Salary Create a Stored Procedure...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
The Update EmployeeSalary sproc should take 2 input parameters, EmployeeID and Salary Create a Stored Procedure that can be used to update an Employee's Salary. Make sure the stored procedure also adds a row to the Emp Salary History table to maintain salary history. For full credit, the stored procedure must use a transaction. Hints: a- The stored procedure will be named UpdateEmployeeSalary b- Add 2 parameters. Call the first one in EmployeelD with a data type of SMALLINT and the second one inSalary with a data type of DECIMAL(8,2). c- Type START TRANSACTION;, hit enter a few times, and type COMMIT; d- Inside the Transaction, write the command to UPDATE the Salary column in the Employee table equal to the value of the inSalary parameter. e- Next, write the command to INSERT the historical row into the Emp Salary History table. Set the SalaryChangeDate column equal to CURRENT_DATE(). f- Run the CREAT PROCEDURE command to create the stored procedure. g- Test the sproc by executing it and passing an EmployeeID & Salary of your choice. SECURITY TRAINING PK TrainingID SMALLINT Training Description VARCHAR(400) Training TimeLength TIME assigned to TRAINING COURSE PK,FK TrainingID PK,FK EmployeelD PK TrainingDate Certification VARCHAR(130) PK, FK | EmployeelD PK AccessLevel SMALLINT SMALLINT DATE SECURITY CLEARANCE SMALLINT VARCHAR(100) VARCHAR(400) ProtocolDescription BackgroundCheckPass CHAR(1) ExpirationDate DATE PK,FK EmployeelD PK SalaryChangeDate SalaryAmount EMP SALARY HISTORY SMALLINT DATE DECIMAL(8,2) PHONE CALL PK, FK EmployeelD SMALLINT PK, FK CustomerID SMALLINT PK CallDate PK assigned BeginTime EndTime CallSummary VARCHAR(400) takes PK EmployeelD SSN FirstName MiddleName LastName StreetAddress -generates. City State ZipCode Title Salary EMPLOYEE + answers DATE TIME TIME PK, FK EmployeelD PK has FirstName LastName BirthDate SSN SMALLINT INT DEPENDENT VARCHAR(30) VARCHAR(30) VARCHAR(30) VARCHAR(35) VARCHAR(30) CHAR(2) VARCHAR(10) VARCHAR(45) DECIMAL (8,2) SMALLINT DependentNumber SMALLINT VARCHAR(30) VARCHAR(30) DATE INT -places +H PK CustomerID FirstName MiddleName LastName PIN CUSTOMER City State SMALLINT VARCHAR(25) Hooks up VARCHAR(25) VARCHAR(25) StreetAddress VARCHAR(35) VARCHAR(25) CHAR(2) VARCHAR(10) INT ZipCode EmailOptin CHAR(1) creates CUST_BANK_ACCOUNT PK,FK AccountID PK, FK CustomerID SMALLINT SMALLINT AccountBalance DECIMAL (8,2) associated with +H BANK ACCOUNT PK AccountID SMALLINT DateOpened DATE AccountType VARCHAR(45) AccountStatus VARCHAR(25) CREDIT HISTORY -generates - PK, FK CustomerID PK CreditScoreDate CreditScore RiskLevel SMALLINT DATE SMALLINT VARCHAR(12) CUSTOMER_EMAIL PK,FK Customerid SMALLINT has K PK EmailAddress VARCHAR(254) PrimaryEmailFlag CHAR(1) STATUS_TYPE PK Status ID SMALLINT Status Type |VARCHAR(8) CUST_TRANSACTION applies to SMALLINT TRANSACTION_STATUS PK TransactionID SMALLINT PK,FK Status ID TransactionAmount DECIMAL (8,2) has PK,FK TransactionID SMALLINT Transaction Type VARCHAR(40) TransactionDate DATE SMALLINT FK AccountID The Update EmployeeSalary sproc should take 2 input parameters, EmployeeID and Salary Create a Stored Procedure that can be used to update an Employee's Salary. Make sure the stored procedure also adds a row to the Emp Salary History table to maintain salary history. For full credit, the stored procedure must use a transaction. Hints: a- The stored procedure will be named UpdateEmployeeSalary b- Add 2 parameters. Call the first one in EmployeelD with a data type of SMALLINT and the second one inSalary with a data type of DECIMAL(8,2). c- Type START TRANSACTION;, hit enter a few times, and type COMMIT; d- Inside the Transaction, write the command to UPDATE the Salary column in the Employee table equal to the value of the inSalary parameter. e- Next, write the command to INSERT the historical row into the Emp Salary History table. Set the SalaryChangeDate column equal to CURRENT_DATE(). f- Run the CREAT PROCEDURE command to create the stored procedure. g- Test the sproc by executing it and passing an EmployeeID & Salary of your choice. SECURITY TRAINING PK TrainingID SMALLINT Training Description VARCHAR(400) Training TimeLength TIME assigned to TRAINING COURSE PK,FK TrainingID PK,FK EmployeelD PK TrainingDate Certification VARCHAR(130) PK, FK | EmployeelD PK AccessLevel SMALLINT SMALLINT DATE SECURITY CLEARANCE SMALLINT VARCHAR(100) VARCHAR(400) ProtocolDescription BackgroundCheckPass CHAR(1) ExpirationDate DATE PK,FK EmployeelD PK SalaryChangeDate SalaryAmount EMP SALARY HISTORY SMALLINT DATE DECIMAL(8,2) PHONE CALL PK, FK EmployeelD SMALLINT PK, FK CustomerID SMALLINT PK CallDate PK assigned BeginTime EndTime CallSummary VARCHAR(400) takes PK EmployeelD SSN FirstName MiddleName LastName StreetAddress -generates. City State ZipCode Title Salary EMPLOYEE + answers DATE TIME TIME PK, FK EmployeelD PK has FirstName LastName BirthDate SSN SMALLINT INT DEPENDENT VARCHAR(30) VARCHAR(30) VARCHAR(30) VARCHAR(35) VARCHAR(30) CHAR(2) VARCHAR(10) VARCHAR(45) DECIMAL (8,2) SMALLINT DependentNumber SMALLINT VARCHAR(30) VARCHAR(30) DATE INT -places +H PK CustomerID FirstName MiddleName LastName PIN CUSTOMER City State SMALLINT VARCHAR(25) Hooks up VARCHAR(25) VARCHAR(25) StreetAddress VARCHAR(35) VARCHAR(25) CHAR(2) VARCHAR(10) INT ZipCode EmailOptin CHAR(1) creates CUST_BANK_ACCOUNT PK,FK AccountID PK, FK CustomerID SMALLINT SMALLINT AccountBalance DECIMAL (8,2) associated with +H BANK ACCOUNT PK AccountID SMALLINT DateOpened DATE AccountType VARCHAR(45) AccountStatus VARCHAR(25) CREDIT HISTORY -generates - PK, FK CustomerID PK CreditScoreDate CreditScore RiskLevel SMALLINT DATE SMALLINT VARCHAR(12) CUSTOMER_EMAIL PK,FK Customerid SMALLINT has K PK EmailAddress VARCHAR(254) PrimaryEmailFlag CHAR(1) STATUS_TYPE PK Status ID SMALLINT Status Type |VARCHAR(8) CUST_TRANSACTION applies to SMALLINT TRANSACTION_STATUS PK TransactionID SMALLINT PK,FK Status ID TransactionAmount DECIMAL (8,2) has PK,FK TransactionID SMALLINT Transaction Type VARCHAR(40) TransactionDate DATE SMALLINT FK AccountID
Expert Answer:
Related Book For
Posted Date:
Students also viewed these databases questions
-
Planning is one of the most important management functions in any business. A front office managers first step in planning should involve determine the departments goals. Planning also includes...
-
Design a Java class that represents a cache with a fixed size. It should support operations like add, retrieve, and remove, and it should evict the least recently used item when it reaches capacity.
-
On January 1, 2010, Phelps Company purchased an 85% interest in Sloane Company for $955,000 when the retained earnings of Sloane Company were $150,000. The difference between implied and book value...
-
A boat is cruising in a straight line at a constant speed of 2.6 m/s when it is shifted into neutral. After coasting 12 m the engine is engaged again, and the boat resumes cruising at the reduced...
-
Sinise Industries acquired two copyrights during 2020. One copyright related to a textbook that was developed internally at a cost of $9,900. This textbook is estimated to have a useful life of 3...
-
Show that for symmetric laminates the coupling stiffnesses, \(B_{i j}\), must all be equal to zero.
-
The trial balance of LaGrace Company includes the following balance sheet accounts. Identify the accounts that might require adjustment. For each account that requires adjustment, indicate (1) The...
-
On 8 February 19X8 PJ, a London trader, consigned 120 cases of goods to MB, an agent in New Zealand. The cost of the goods was 25 a case. PJ paid carriage to the port 147 and insurance 93. On 31...
-
GUI Assignment You will be creating a seating arrangement application using JavaFX. The project will comprise of two sections: the interface and the Java code. The application will feature a 3x3...
-
What is the foreign exchange market? What is an exchange rate and how is it determined in a free market system? Differentiate between the floating, managed floating, and fixed exchange rate systems.
-
Franklin, Inc. has two divisions, Seward and Charles. Following is the income statement for the previous year: Sales Variable Costs Seward Charles $600,000 $400,000 195,000 250,000 Contribution...
-
Lester and Stephen formed a partnership with capital contributions of P300,000 and P700,000, respectively. During its first year of operations, the partnership earned a profit of P200,000. Prepare a...
-
Using the balances of T-accounts , prepare a trial balance. 11/1 Bal. 11/10 11/12 11/29 11/30 Bal. 11/1 Bal. 11/27 11/50 Bal 11/1 Bal. 11/17 11/30 Bal. 3,640 1,860 3,810 750 4,710 3,120 970 2,230...
-
Table 1 shows the monthly sales of tires over the last 5 years. Graphically analyse the time series and explain how you could use the simple model to forecast monthly sales. Table 1: Monthly tires...
-
1. An investment dealer bought Php 12,500 from Caloy. She promised to pay the interest and the principal after 2 years and 4 months. How much would Caloy receive from baby if he charged interest at...
-
Discuss briefly the process of regeneration in vertebrates?
-
The domain of the variable in the expression x 3/x + 4 is________.
-
Since Uber officially launched online taxi reservation in San Francisco in October 2010, many ride-hailing companies have emerged in China, such as Didi Chuxing (hereafter Didi), Kuaidi, Yidao...
-
As a manager, is it ethical to threaten your suppliers? Your buyers?
-
Compare and contrast the five forces affecting the cruise industry, fashion industry, airline industry, and automobile industry (1) on a worldwide basis (2) in your country. Which industry holds more...
-
The chief goal of the private sector is effciency.Why? The primary focus of the public sector is equity. Why? It is quite possible to be highly effcient yet ineffective. It is also possible to be...
-
Why is healthcare reform such a contentious issue in the United States? Why have public and private efforts been unsuccessful in fully addressing the challenge of affordable health care? What role(s)...
-
Drawing on economic theory, what kinds of market failure underlie the worlds most pressing problems? Examine three examples: hunger, groundwater contamination, and literacy.
Study smarter with the SolutionInn App