Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

art I (Constraints) - Using the tables you created in lab #1: 1. Create a primary key on your department table, department id column. NOTE:

image text in transcribed
art I (Constraints) - Using the tables you created in lab \#1: 1. Create a primary key on your department table, department id column. NOTE: If you created your table in Microsoft and did not create your department id as "not null" you will have to run the following command before trying to create the primary key (do not copy / paste the command from this document): alter table department alter column department_id int NOT NULL Insert a new row into the department table with the same department id as an existing row (a duplicate). What happens? 2. Create a foreign key / referential integrity constraint between the department table (department id) and the employee table (department id). 3. Attempt to insert a new employee with an invalid department. What happens? 4. Attempt to update a current employee's department to an invalid one. What happens? 5. Attempt to delete a record from the department table. What happens? 6. Attempt to drop the department table, what happens? 7. Attempt to truncate the department table, what happens? 8. Create a check constraint on the salary field in the employee table that makes sure the salary >100.00 (show me the code). Verify that it works by attempting to insert an employee with a salary of 1000 9. Attempt to change (update) the salary of an existing employee to $11. What happens? art II - Using the Tables you created in Lab \#1, implement the following queries. For each ne, show the SQL command and the output. Each query must be implemented using 1SQL ommand (for \#2, you cannot use 2 queries to complete the request). 1. List all the employee in the state of NY 2. List all the part time employees with a salary of less than 500 3. List all of the employees with last names that start with the letter "A" though "R". art III - Load the Pubs sample tables

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

Recommended Textbook for

Case And Problem Materials In Management Accounting

Authors: Tony Brabazon And Tony ODea

2nd Edition

1412024315, 978-1412024310

More Books

Students also viewed these Accounting questions