Help On SQL Trigger - Sajha Mobile
SAJHA MOBILE
Help On SQL Trigger
Posts 4 · Viewed 3572 · Go to Last Post
thedoors
· Snapshot
Like · Likedby · 0

HI all, I need some help in the a trigger. Below is this rule.

*No rental is allowed if a customer's unpaid balance fine exceeds $15.

there are 8 tables in total

Staff=>Branch=>Video=>Rental

Rental_Description=>Category=>Video=>Rental

Customer=>Rental_detail=>Rental

I really need some help I tried my best to run the trigger but always failing. Please guys help me out ASAP.

meek__misfit
· Snapshot
Like · Liked by · 0

Be precise. Give me table names, attibutes with its datatypes and which flavor of SQL you are using. And the god damn database you are building the trigger on.

Last edited: 28-Apr-08 10:18 PM
thedoors
· Snapshot
Like · Liked by · 0

Hi meek_misfit, thanks a lot for ur willingness to help.

Business rules

  1. A customer can rent up to maximum five videos at any one time (allow no more than five checked out videos at any time)
  2. Late return penalty is $2 each day late. The fine should be automatically calculated and added to the balance.(this balance here means the fine balance, we do need to worry about customer total balance)
  3. No rental is allowed if a customer's unpaid balance fine exceeds $15

I need three triggers to satisfy the above business rules. thanks a lot once again.

 

Branch_ID

Branch_Address

Branch_Telephone

Branch

 

No Partial Dependencies

          No Transitive Dependencies:

 

Staff

Staff_ID

Branch_ID

LName

FName

Address

Salary

Position

 

No Partial Dependencies

Transitive Dependencies: Salary is Dependent on Position

Staff_ID

Salary

                                                                                                                                                                   

Staff_ID

Branch_ID

LName

FName

Telephone

Address

Position

 

 

 

Video_ID

Catalog_ID

Branch_ID

Rental_No

Status

Cost

Title

Actor

Director

Video

 

Transitive Dependencies: Status, Title, Actor & Director is dependent on Rental_No.

Rental_No

Status

Title

Actor

Director

 

Video_ID

Catalog_ID

Branch_ID

Cost

 

 

Category

Catalogue_ID

Genre

 

 

 

             Rental Description                

Rental_Code

Description

Rental_Fee

 

No Partial Dependencies

Transitive dependency

Description

Rental_Fee

 

 

 

Rental Detail

RD_No

Rental_No

Video_ID

Due_Date

Return_Date

 

No Partial Dependency

 

B.C.N.F Dependency

 

Due_Date

Return_Date

Rd_No

 

 

Rental

 

Rental_No

Rental_Date

Customer_ID

 

 

 

Customer

Customer_ID

LName

FName

Address

Telephone

Date_Of_Reg

Balance_Due

Branch_Id

 

Transitive Dependencies: LName, FName, Address & Telephone are dependent on Customer_ID

Customer_ID

LName

FName

Address

Telephone

 

Customer_ID

Date_Of_Reg

Balance_Due

Branch_Id

 

 

 

 

 

thedoors
· Snapshot
Like · Liked by · 0
By the way I am using Oracle 10g. thanks
Please log in to reply to this post

You can also log in using your Facebook
View in Desktop
What people are reading
You might like these other discussions...
· Posts 3 · Viewed 206
· Posts 1 · Viewed 57
· Posts 19 · Viewed 3113 · Likes 1
· Posts 1 · Viewed 86
· Posts 1 · Viewed 73
· Posts 1 · Viewed 119
· Posts 1 · Viewed 130
· Posts 4 · Viewed 1131
· Posts 1 · Viewed 249
· Posts 1 · Viewed 158



Your Banner Here
Travel Partners
Travel House Nepal