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;

Oracle 12c: SQL
3rd Edition
ISBN:9781305251038
Author:Joan Casteel
Publisher:Joan Casteel
Chapter3: Table Creation And Management
Section: Chapter Questions
Problem 2HOA: Create a new table containing these four columns: Emp#, Lastname, Firstname, and Job_class. The...
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
Oracle 12c: SQL
Oracle 12c: SQL
Computer Science
ISBN:
9781305251038
Author:
Joan Casteel
Publisher:
Cengage Learning
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781305627482
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781285196145
Author:
Steven, Steven Morris, Carlos Coronel, Carlos, Coronel, Carlos; Morris, Carlos Coronel and Steven Morris, Carlos Coronel; Steven Morris, Steven Morris; Carlos Coronel
Publisher:
Cengage Learning
Np Ms Office 365/Excel 2016 I Ntermed
Np Ms Office 365/Excel 2016 I Ntermed
Computer Science
ISBN:
9781337508841
Author:
Carey
Publisher:
Cengage
CMPTR
CMPTR
Computer Science
ISBN:
9781337681872
Author:
PINARD
Publisher:
Cengage