Create a new table containing these four columns: Emp#, Lastname, Firstname, and
ID: 3591212 • Letter: C
Question
Create a new table containing these four columns: Emp#, Lastname, Firstname, and
Job_class. The table name should be EMPLOYEES. The Job_class column should be able
to store character strings up to a maximum length of four, but the column values shouldn’t
be padded if the value has less than four characters. The Emp# column contains a numeric
ID and should allow a five-digit number. Use column sizes you consider suitable for the
Firstname and Lastname columns.
Add two columns to the EMPLOYEES table. One column, named EmpDate, contains the
date of employment for each employee, and its default value should be the system date.
The second column, named EndDate, contains employees’ date of termination.
Modify the Job_class column of the EMPLOYEES table so that it allows storing a maximum
width of two characters.
4. Delete the EndDate column from the EMPLOYEES table.
5. Rename the EMPLOYEES table as JL_EMPS.
Explanation / Answer
create table EMPLOYEES (Emp Int(5),Lastname varchar2(10),Firstname varchar2(10),Job_class varchar2(4));
Alter table EMPLOYEES ADD EmpDate date default sysdate;
Alter table EMPLOYEES ADD EndDate date;
Alter table EMPLOYEES ALTER COLUMN Job_class varchar2(2);
Alter table EMPLOYEES DROP COLUMN EndDate;
ALTER TABLE EMPLOYEES RENAME TO JL_EMPS;
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.