Chapter 10C – Managing Databases with MySQL 5.7
Page 10C-116
N. Use the GetLastNameCommaSeparated user-defined function you created in step K to
populate the EmployeeLastName column.
P. Create a new table named PAYROLL_CATEGORY, as shown in Figure 10C-112. Use
the column characteristics shown in Figure 10C-112, where PayrollCategoryID is a
surrogate key starting at 1 and incrementing by 1.
CREATE TABLE PAYROLL_CATEGORY (
PayrollCategoryID INT NOT NULL auto_increment,
CategoryDescription VarChar(45) NOT NULL,
PayRate Numeric(8,2) NOT NULL,
CONSTRAINT PC_PK PRIMARY KEY (PayrollCategoryID));
R. Alter the PAYROLL_TEMP table to include an EmployeeID column (Integer data,allow
nulls). By using and comparing the PAYROLL_TEMP.EmployeeLastName and
PAYROLL_TEMP.EmployeeFirstName columns with the EMPLOYEE.LastName and
EMPLOYEE.FirstName columns, populate this column. Hint: Assume for this question
that no two employees have the same first and last names.