Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

PLEASE DO ALL IN ONE SQL SCRIPT Create two tables as follows. tblEmployee ( EmployeeID , Fname, Lname, DeptID) tblDepartment ( DeptID , Dname, Dlocation)

PLEASE DO ALL IN ONE SQL SCRIPT

  1. Create two tables as follows.

tblEmployee (EmployeeID, Fname, Lname, DeptID)

tblDepartment (DeptID, Dname, Dlocation)

Note that EmployeeID and DeptID are primary keys, and the tables are connected through DeptID. [20 points]

  1. Create three stored procedures as follows.

spInsertEmployee procedure will insert all fields in tblEmployee by passing the four fields as input parameters.

spInsertDepartment procedure will insert all fields in tblDepartment by passing the three fields as input parameters.

spGetbyDlocation procedure will show the Fname, by passing only the value of Seattle, for Dlocation as input parameter (that is, it will show the first names of all employees located in Seattle).

  1. Insert the following data through spInsertEmployee. [20 points]

S10000, John, Smith, 10

D10000, Jerry, Smith, 20

F100, Sam, Diaz, 30

G200, Pete, Johnson, 40

F300, Pretty, Girl, 10

A444, Sweet, Friend, 10

G5555, Nice, Day, 40

  1. Insert the following data through spInsertDepartment. [20 points]

10, Production, Seattle

20, Sales, Boston

30, Research, Seattle

40, Accounting, Boston

  1. Show that the following data insertion through spInsertEmployee is invalid (because there is no DeptID with value of 50 in tblDepartment). [10 points]

A10111, Serena, Williams, 50

  1. Show that the procedure spGetbyDlocation outputs the following. [25 points]

John Sam Pretty Sweet

When you show your result to your teacher, please provide your self-assessment score

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_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

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

Get Started

Recommended Textbook for

Introductory Relational Database Design For Business With Microsoft Access

Authors: Jonathan Eckstein, Bonnie R. Schultz

1st Edition

1119329418, 978-1119329411

More Books

Students also viewed these Databases questions

Question

Define GSS and list its benefits.

Answered: 1 week ago

Question

Name the 3 Rs of re-engineering?

Answered: 1 week ago