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
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
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](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2F20ffe5d9-6feb-4bf6-897c-ba1d009d5929%2Fb94c4a4e-e3d9-4709-9aca-09d18372bc39%2F61umdr_processed.jpeg&w=3840&q=75)
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](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2F20ffe5d9-6feb-4bf6-897c-ba1d009d5929%2Fb94c4a4e-e3d9-4709-9aca-09d18372bc39%2Fa2k74m2_processed.jpeg&w=3840&q=75)
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
![](/static/compass_v2/shared-icons/check-mark.png)
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution!
Trending now
This is a popular solution!
Step by step
Solved in 2 steps
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)
Knowledge Booster
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](https://www.bartleby.com/isbn_cover_images/9780078022159/9780078022159_smallCoverImage.jpg)
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)](https://www.bartleby.com/isbn_cover_images/9780134444321/9780134444321_smallCoverImage.gif)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
![Digital Fundamentals (11th Edition)](https://www.bartleby.com/isbn_cover_images/9780132737968/9780132737968_smallCoverImage.gif)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
![Database System Concepts](https://www.bartleby.com/isbn_cover_images/9780078022159/9780078022159_smallCoverImage.jpg)
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)](https://www.bartleby.com/isbn_cover_images/9780134444321/9780134444321_smallCoverImage.gif)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
![Digital Fundamentals (11th Edition)](https://www.bartleby.com/isbn_cover_images/9780132737968/9780132737968_smallCoverImage.gif)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
![C How to Program (8th Edition)](https://www.bartleby.com/isbn_cover_images/9780133976892/9780133976892_smallCoverImage.gif)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
![Database Systems: Design, Implementation, & Manag…](https://www.bartleby.com/isbn_cover_images/9781337627900/9781337627900_smallCoverImage.gif)
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
![Programmable Logic Controllers](https://www.bartleby.com/isbn_cover_images/9780073373843/9780073373843_smallCoverImage.gif)
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education