Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored 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