Create a trigger on WORKS_ON, if a new tuple with Hours=NULL is inserted, set the Hours to 0. 6. Create a table with attributes SSN, dependent_name and ChangeTimeStamp, whenever a new tuple is inserted into DEPENDENT table, record the operation using a trigger. 7. Create a trigger on CLIENT, whenever a tuple is deleted, delete all the tuples in PROJECT table and WORKS_ON table with the same Pno as the deleted tuple from CLIENT. 8. Create a trigger on EMPLOYEE, whenever a new employee is inserted, if the employee has salary higher than his/her supervisor, set the employee's salary to NULL.

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

5. Create a trigger on WORKS_ON, if a new tuple with Hours=NULL is inserted, set the Hours to 0.

6. Create a table with attributes SSN, dependent_name and ChangeTimeStamp, whenever a new tuple is inserted into DEPENDENT table, record the operation using a trigger.

7. Create a trigger on CLIENT, whenever a tuple is deleted, delete all the tuples in PROJECT table and WORKS_ON table with the same Pno as the deleted tuple from CLIENT.

8. Create a trigger on EMPLOYEE, whenever a new employee is inserted, if the employee has salary higher than his/her supervisor, set the employee's salary to NULL.

# Client Data Table

The following table displays a list of clients along with their associated project numbers.

| **Client Name (CName)** | **Project Number (Pno)** |
|-------------------------|--------------------------|
| Snap                    | 1                        |
| QTC                     | 2                        |
| LinkedIn                | 3                        |
| JPL                     | 10                       |
| Google                  | 20                       |
| JPL                     | 30                       |

### Explanation

This table is organized into two columns:
- **CName**: Represents the name of the client.
- **Pno**: Represents the project number associated with the client.

Note that some clients may appear more than once with different project numbers, indicating multiple projects assigned to them. For example, "JPL" is listed twice with different project numbers, 10 and 30.
Transcribed Image Text:# Client Data Table The following table displays a list of clients along with their associated project numbers. | **Client Name (CName)** | **Project Number (Pno)** | |-------------------------|--------------------------| | Snap | 1 | | QTC | 2 | | LinkedIn | 3 | | JPL | 10 | | Google | 20 | | JPL | 30 | ### Explanation This table is organized into two columns: - **CName**: Represents the name of the client. - **Pno**: Represents the project number associated with the client. Note that some clients may appear more than once with different project numbers, indicating multiple projects assigned to them. For example, "JPL" is listed twice with different project numbers, 10 and 30.
## Employee Database System Overview

### EMPLOYEE Table
This table contains personal and professional details about each employee.

- **Columns:**
  - **Fname (First Name)**
  - **Minit (Middle Initial)**
  - **Lname (Last Name)**
  - **Ssn (Social Security Number)**
  - **Bdate (Birth Date)**
  - **Address**
  - **Sex**
  - **Salary**
  - **Super_ssn (Supervisor's SSN)**
  - **Dno (Department Number)**

### DEPARTMENT Table
This table holds information about different departments.

- **Columns:**
  - **Dname (Department Name)**
  - **Dnumber (Department Number)**
  - **Mgr_ssn (Manager's SSN)**
  - **Mgr_start_date (Manager Start Date)**

### DEPT_LOCATIONS Table
This table lists department locations.

- **Columns:**
  - **Dnumber (Department Number)**
  - **Location**

### PROJECT Table
This table outlines the projects undertaken by the company.

- **Columns:**
  - **Pname (Project Name)**
  - **Pnumber (Project Number)**
  - **Plocation (Project Location)**
  - **Dnum (Department Number)**

### WORKS_ON Table
This table details the project assignments of employees.

- **Columns:**
  - **Essn (Employee SSN)**
  - **Pno (Project Number)**
  - **Hours (Number of Hours Worked on Project)**

### DEPENDENT Table
This table provides information about employees' dependents.

- **Columns:**
  - **Essn (Employee SSN)**
  - **Dependent_name**
  - **Sex**
  - **Bdate (Birth Date)**
  - **Relationship**

#### Data Highlights:
- **Employee Details:** Lists individuals such as John B. Smith, Franklin T. Wong, etc., with attributes like address, salary, and department number.
- **Department Management:** Departments are managed by individuals, identified by their SSN and management start date.
- **Locations:** Enumerates locations associated with department numbers.
- **Project Allocations:** Includes projects like ProductX located in Bellaire, managed by specified departments.
- **Work Assignments:** Details hours worked by employees on specific projects.
- **Dependent Information:** Contains personal details of employees' depend
Transcribed Image Text:## Employee Database System Overview ### EMPLOYEE Table This table contains personal and professional details about each employee. - **Columns:** - **Fname (First Name)** - **Minit (Middle Initial)** - **Lname (Last Name)** - **Ssn (Social Security Number)** - **Bdate (Birth Date)** - **Address** - **Sex** - **Salary** - **Super_ssn (Supervisor's SSN)** - **Dno (Department Number)** ### DEPARTMENT Table This table holds information about different departments. - **Columns:** - **Dname (Department Name)** - **Dnumber (Department Number)** - **Mgr_ssn (Manager's SSN)** - **Mgr_start_date (Manager Start Date)** ### DEPT_LOCATIONS Table This table lists department locations. - **Columns:** - **Dnumber (Department Number)** - **Location** ### PROJECT Table This table outlines the projects undertaken by the company. - **Columns:** - **Pname (Project Name)** - **Pnumber (Project Number)** - **Plocation (Project Location)** - **Dnum (Department Number)** ### WORKS_ON Table This table details the project assignments of employees. - **Columns:** - **Essn (Employee SSN)** - **Pno (Project Number)** - **Hours (Number of Hours Worked on Project)** ### DEPENDENT Table This table provides information about employees' dependents. - **Columns:** - **Essn (Employee SSN)** - **Dependent_name** - **Sex** - **Bdate (Birth Date)** - **Relationship** #### Data Highlights: - **Employee Details:** Lists individuals such as John B. Smith, Franklin T. Wong, etc., with attributes like address, salary, and department number. - **Department Management:** Departments are managed by individuals, identified by their SSN and management start date. - **Locations:** Enumerates locations associated with department numbers. - **Project Allocations:** Includes projects like ProductX located in Bellaire, managed by specified departments. - **Work Assignments:** Details hours worked by employees on specific projects. - **Dependent Information:** Contains personal details of employees' depend
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 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
  • SEE MORE 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