Question: Given the following E-R diagram, map it to a relational schema. First draw a relational schema (box diagram with foreign keys shown). Then write

Given the following E-R diagram, map it to a relational schema. First draw a relational schema (box diagram with foreign keys shown). Then write the SQL Data Definition Language statements necessary to create the relational schema. NOTE: {{ }} denotes multi-valued attribute driverid Driver driverName {{drvierPhone)) Drives BusRoute routeld routeName totalLength Date Driven On busid bus numberOfSeats Bus Stop Composed Of stopNum ++ city fare Drives BusRoute routeld routeName totalLength a) Relational Schema: Date Driven On BusStop Composed Of stopNum H city fare b) Data Definition Language (DDL) from the schema: StudentAccount studentID balance studentID is the primary key of the StudentAccount table. Write an SQL stored procedure called update Balance that takes as input: . a student ID, as an integer a transaction code ('W' for withdrawal or 'D' for deposit) amount to be put against the account. The procedure should update the balance for the specified student and account based on the transaction type- deposits increase and withdrawals decrease an account balance. If there is an invalid transaction code the procedure should generate an exception with a custom error code of 45001 and a message of "Invalid Transaction Code".
Step by Step Solution
There are 3 Steps involved in it
ANSWER a Relational Schema To create a relational schema the following steps should be followed Step ... View full answer
Get step-by-step solutions from verified subject matter experts
