4 employees Data Type Length NULL Constraints Capable Attribute Employee ID (PK) Numeric Character 15 5,0 N Unique identifier First name N Middle Initial Character 1 Y Last Name Character 15 N Hire Date Date 10 N • If unknown, use current date

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question
Based on sql database
4 employees
Data Type Length NULL
|Сарable|
Attribute
Constraints
Employee ID (PK) Numeric
5,0
N
• Unique identifier
First name
Character
15
N
Middle Initial
Character
1
Y
Last Name
Character
15
N
• If unknown, use current date
• Must be greater than birth date
Hire Date
Date
10
N
Store Location
Numeric
2,0
• Must be a valid location
Work Department Numeric
4,0
Y
• If unknown, use '1000'
• Must be a valid department
• If unknown, use 'T'
• Must be "T', 'J', 'C', or 'M'
Job Class
Character
1
Y
Coach ID
Numeric
5,0
Y
• Must be a valid employee
• Must be less than 92000.00
• Must be greater than commission
Salary
Numeric
9,2
N
Bonus
Numeric
7,2
Y
• Must have commission or bonus
Commission
Numeric
7,2
Y
• Must have commission or bonus
1. Create the 4 tables and include the constraints
2. Constraint Testing – Test each constraint by listing each
constraint and providing a test to validate that each
constraint is working:
Include an INSERT statement to "force" a
а.
constraint
For example, modify the
employee_id so that it is the same as the
employee_id in the previous row. This will force a
primary key error when the INSERT statement is
error.
run
b. Run the INSERT statement and verify that the error
occurred
Take a screen shot of the error and insert into the
с.
constraint testing document
d. Move to the next constraint and perform a constraint
test
Transcribed Image Text:4 employees Data Type Length NULL |Сарable| Attribute Constraints Employee ID (PK) Numeric 5,0 N • Unique identifier First name Character 15 N Middle Initial Character 1 Y Last Name Character 15 N • If unknown, use current date • Must be greater than birth date Hire Date Date 10 N Store Location Numeric 2,0 • Must be a valid location Work Department Numeric 4,0 Y • If unknown, use '1000' • Must be a valid department • If unknown, use 'T' • Must be "T', 'J', 'C', or 'M' Job Class Character 1 Y Coach ID Numeric 5,0 Y • Must be a valid employee • Must be less than 92000.00 • Must be greater than commission Salary Numeric 9,2 N Bonus Numeric 7,2 Y • Must have commission or bonus Commission Numeric 7,2 Y • Must have commission or bonus 1. Create the 4 tables and include the constraints 2. Constraint Testing – Test each constraint by listing each constraint and providing a test to validate that each constraint is working: Include an INSERT statement to "force" a а. constraint For example, modify the employee_id so that it is the same as the employee_id in the previous row. This will force a primary key error when the INSERT statement is error. run b. Run the INSERT statement and verify that the error occurred Take a screen shot of the error and insert into the с. constraint testing document d. Move to the next constraint and perform a constraint test
1 locations
Attribute
Data Type Length NULL Capable Constraints
Location ID (PK) Numeric
Character| 20
2,0
N
City
N
Store Manager
Numeric
5,0
Must be a valid employee
Y
locations data:
location_id city
store_manager
11
Sarnia
null
London null
Toronto null
22
33
2 locations_departments
Attribute
Data Type Length NULL Capable Constraints
Numeric 2,0
department_id (PK) | Numeric
department_manager Numeric
location ID (PK)
N
Must be a valid location
4,0
N
Must be a valid department
5,0
Y
Must be a valid employee
3 departments
Attribute
Data Type Length NULL Capable
Department ID (PK) Numeric
Department name
4,0
N
Character 50
N
departments data:
department_id department_name
1001
IT
1002
Administration
Men's Clothing
Women's Clothing
1003
1004
1005
Kids
1006
Тoys
Transcribed Image Text:1 locations Attribute Data Type Length NULL Capable Constraints Location ID (PK) Numeric Character| 20 2,0 N City N Store Manager Numeric 5,0 Must be a valid employee Y locations data: location_id city store_manager 11 Sarnia null London null Toronto null 22 33 2 locations_departments Attribute Data Type Length NULL Capable Constraints Numeric 2,0 department_id (PK) | Numeric department_manager Numeric location ID (PK) N Must be a valid location 4,0 N Must be a valid department 5,0 Y Must be a valid employee 3 departments Attribute Data Type Length NULL Capable Department ID (PK) Numeric Department name 4,0 N Character 50 N departments data: department_id department_name 1001 IT 1002 Administration Men's Clothing Women's Clothing 1003 1004 1005 Kids 1006 Тoys
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Database Environment
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education