Posted: November 4th, 2015

Database Management Systems

Database Management Systems

Question 1: Normalization

1.1)    Consider a relation R with six attributes ABCDEF where AB is a composite primary key for R. Assume R has the following functional dependencies:
AB? CDEF
B? CDE
D? E

a)    In what normal form is relation R? Explain why?

b)    Is it possible to decompose R into a number of relations in order to achieve a higher normal form? Explain how.

1.2)

branchNo    branchAddress    telNo    mgrStaffNo    name
B001    8Jefferson Way,Portland,OR97201    503-555-3618    S1500    TomDaniels
B002    CityCenterPlaza,Seattle,WA98122    206-555-6756    S0010    MaryMartinez
B003    14–8thAvenue,New York,NY 10012    212-371-3000    S0145    ArtPeters
B004    16–14thAvenue,Seattle, WA98128    206-555-3131    S2250    SallyStern

Primary key: branchNo

a)    Why the above table is not in 3NF?
b)    Describe and illustrate the process of normalizing the data shown in this table to third normal form (3NF).
c) Identify the primary and foreign keys in your 3NF relations.

Question 2: Triggers and Stored Procedures

After the file completes,the tables shown above are created and populated with the shown data. Familiarize yourself with the database before starting to write your queries. Once you are familiar with the data, start working on the following questions.

Answer the following questions based on the above database:

1)    Create a view named “AC2778V” that includes the following “For each charter of aircraft 2778V, print the charter date, destination, and the corresponding customer last name, area code, and phone number”. Your answer should include both the SQL statement for view creating along with the contents of the view (you get the contents of the view by select * from AC2778V).

2)    Modify the MODEL table to add the following attribute and insert the values shown in the following table. (Note: use ALTER TABLE and UPDATE commands.)

Attribute name    Attribute Description    Attribute type    Attribute Values
MOD_WAIT_CHG    Waiting charge per hour for each model:    Numeric    $100 for C-90A
$50 for PA23-250
$75 for PA31-350

3)    Create a trigger named trg_char_hours that will automatically update the AIRCRAFT table when a new CHARTER row is added. Use the CHARTER table’s CHAR_HOURS_FLOWN to update the AIRCRAFT table’s AC_TTAF, AC_TTEL, and AC_TTER values.The meaning for the AIRCRAFT table columns are as follows: AC_TTAF: Total time on the air frame
AC_TTLR: Total time on the left engine (Also used to record single engine hours) AC_TTER: Total time on the right engine.

So in the trigger, you need to increase all of them with CHAR_HOUR_FLOWN

4)    Create a trigger named trg_cust_balancethat will automatically update the CUSTOMER table’s CUST_BALANCE when a new CHARTER row is added. Use the CHARTER table’s CHAR_TOT_CHG as the update source (Assume that all charter charges are charged to the customer balance.)

5)    Create a stored procedure to update model waiting charge per hour attribute that just created in question 2. The procedure takes the model number as a parameter.  The procedure increases the waiting charge for this model by 20%.

6)    Create a stored procedure that will take a CHARTER _TRIP number and update the corresponding customer balance by adding the charter total charge to the customer balance.

PLACE THIS ORDER OR A SIMILAR ORDER WITH US TODAY AND GET A GOOD DISCOUNT 🙂

Expert paper writers are just a few clicks away

Place an order in 3 easy steps. Takes less than 5 mins.

Calculate the price of your order

You will get a personal manager and a discount.
We'll send you the first draft for approval by at
Total price:
$0.00
Live Chat+1-631-333-0101EmailWhatsApp