Assume the EMPLOYEE table contains four attributes, ID, DEPT, SALARY and NAME, and has the following rows ID      DEPT     SALARY   NAME     100   SALES     40000       Smith     101     RD         38000       Terry     102     HR         60000       David     103   SALES    58000       Ellie     104      RD       70000       Judy  The DEPARTMENT table contains two attributes, DEPTNAME and PHONE, and has the following rows:   DEPTNAME    PHONE      RD               8596001234      SALES        8596005555    HR              8596009876   A.) The EMPLOYEE table needs to enforce the following integrity constraints: • The ID is the primary key.   • The DEPT column is a foreign key that references the DEPTNAME in the DEPARTMENT table, so that any value that appears in the DEPT column should also exist in the DEPARTMENT table.   • The value for the NAME column can never be null.   What should be the statement used to create the EMPLOYEE table, if 1) the table was created as a partitioned table such that employees in different departments would be placed into different partitions, assuming the company only has three departments, i.e., SALES, HR and RD? 2) the table was created as a partitioned table, assuming the partitioning is based on the salary ranges as follows? • 0~30,000 • 30,001~50,000 • 50,001~80,000 • Above 80,000 3) the table was created as a partitioned table with 4 partitions, hoping that the numbers of rows in all partitions are approximately the same?  B.) What is the statement to create a view EMP_V1, without check option, for employees whose salary falls into range 20,000~45,000? The view should have three columns: ID, NAME, and SALARY C.) After view EMP_V1 has been created successfully in b), what will be the query results for the following SQL statements? insert into emp_v1(id, name, salary)         values(‘289’, ‘GAVIN’, 85000); select * from emp_v1; select * from employee where salary > 45000;

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
icon
Concept explainers
Question

Assume the EMPLOYEE table contains four attributes, ID, DEPT, SALARY and NAME, and has the following rows

ID      DEPT     SALARY   NAME    
100   SALES     40000       Smith    
101     RD         38000       Terry    
102     HR         60000       David    
103   SALES    58000       Ellie    
104      RD       70000       Judy 

The DEPARTMENT table contains two attributes, DEPTNAME and PHONE, and has the following rows: 
 DEPTNAME    PHONE  
   RD               8596001234  
   SALES        8596005555
   HR              8596009876  

A.) The EMPLOYEE table needs to enforce the following integrity constraints:
• The ID is the primary key.  
• The DEPT column is a foreign key that references the DEPTNAME in the DEPARTMENT table, so that any value that appears in the DEPT column should also exist in the DEPARTMENT table.  
• The value for the NAME column can never be null.  

What should be the statement used to create the EMPLOYEE table, if
1) the table was created as a partitioned table such that employees in different departments would be placed into different partitions, assuming the company only has three departments, i.e., SALES, HR and RD?
2) the table was created as a partitioned table, assuming the partitioning is based on the salary ranges as follows?
• 0~30,000
• 30,001~50,000
• 50,001~80,000
• Above 80,000
3) the table was created as a partitioned table with 4 partitions, hoping that the numbers of rows in all partitions are approximately the same? 


B.) What is the statement to create a view EMP_V1, without check option, for employees whose salary falls into range 20,000~45,000? The view should have three columns: ID, NAME, and SALARY


C.) After view EMP_V1 has been created successfully in b), what will be the query results for the following SQL statements?
insert into emp_v1(id, name, salary)  
      values(‘289’, ‘GAVIN’, 85000);
select * from emp_v1;
select * from employee where salary > 45000; 

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps

Blurred answer
Knowledge Booster
Query Syntax
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.
Similar questions
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