Question: Required Reading: Chapter 8 , 1 1 , 1 4 Write SQL statements for the following steps on the Sample database ( textbook example database

Required Reading: Chapter 8,11,14
Write SQL statements for the following steps on the Sample database (textbook example database-the
version which doesnt declare any constraints):
a. Create a stored procedure called insertRecord that takes three parameters as input- start value,
increment amount, and no of records. it inserts no of records rows in the employee table. The value
of the emp_no column should start with the start value, and for the rest of the rows emp_no will be
increment by the increment amount. All values of the columns emp_lname, emp_fname, and
dept_no should be set to 'Jane', 'Smith', and 'd1', respectively.
b. Create a view that comprises the first and last names of all employees who entered their projects in
the second half of the year 2017.
c. Create a view (with the WITH CHECK OPTION clause) that comprises the first and last names of all
employees whose employee number is less than 10,000. After that, use the view to insert data for a
new employee named Kohn with the employee number 22123, who works for the dement d3.
d. With the help of triggers, define the referential integrity for the primary key of the project table, the
project_no column, which is the foreign key of the works_on table.
100 points(4*25points

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!