Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

we have the following SQL statements that creates 3 tables which we are asked to modify: create table employee ( employee_id number(7), employee_fname varchar2(255) ,employee_lname

we have the following SQL statements that creates 3 tables which we are asked to modify:

create table employee ( employee_id number(7), employee_fname varchar2(255) ,employee_lname varchar2(255))

alter table employee modify employee_fname not null

alter table employee add constraint full_name unique(employee_fname,employee_lname)

alter table employee add constraint pk_employee primary key (employee_id)

create table department (department_id number(7) ,department_name varchar2(50), manager_id number(7), constraint fk_employee foreign key (manager_id) references employee (employee_id) )

alter table department add constraint pk_department primary key (department_id)

create table manager (manager_id number(7), department_id number(7), office_no number(3) , constraint fk_employee_m foreign key (manager_id) references employee (employee_id), constraint fk_department foreign key (department_id) references department (department_id))

alter table employee add address varchar2(255)

alter table manager rename to dep_manager

alter table employee add constraint id_constraint check(employee_id>5)

alter table dep_manager add constraint pk_manID_depID primary key (manager_id,department_id)

create sequence sq start with 4 minvalue 2 maxvalue 20 increment by 3

please write these modifications in SQL language,

image text in transcribed

A- Use the same tables you have created in HW\#1, do the following modifications: 1- Create a sequence to generate the values of the employee_id column. Note: The sequence name is Seqemp and the starts value is 2200 and increment by 2 . 2- Change the employee first and last name column size to varchar2(50). 3- Change the column name office_no in dep_manager table to office_location and the data type to varchar2(20). 4- Add the columns dep_no number(7),salary number(7), and hire_date date 5- Drop check constraint on emp_id in question (G) in HW\#1. 6- Drop foreign key constraint on department table manager_id that references to employee_id in employee table

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions