Question: Down below is the data scheme we are using, it has five tables.Primary keys attributes are underlined and foreign keys are noted in the superscript.

 Down below is the data scheme we are using, it has

five tables.Primary keys attributes are underlined and foreign keys are noted in

the superscript. Customer = {customerID, firstName, lastName, income, birthDate} Account = {accNumber,

Down below is the data scheme we are using, it has five tables.Primary keys attributes are underlined and foreign keys are noted in the superscript. Customer = {customerID, firstName, lastName, income, birthDate} Account = {accNumber, type, balance, branch NumberFK-Branch Owns = {customerIDFK-Customer, accNumberFK-Account} Transaction = {trans Number, accNumberFK-Account, amount} Employee = {ssn, firstName, lastName, salary, branchNumberFK-Branch Branch = {branchNumber, branchName, managerSSNFK-Employee, budget} Notes. The customerID attribute (Customer) is a unique number that represents a customer, it is not a cus- tomer's SSN The accNumber attribute (Account) represents the account number The balance (Account) attribute represents the total amount in an account The type (Account) attribute represents the type an account: checking, saving, or business The transNumber attribute (Transactions) represents a transaction number, combined with account number it uniquely identify a transaction The branchNumber attribute (Branch) uniquely identifies a branch The manager SSN attribute (Branch) represents the SSN of the branch manager Questions. Write SQL queries to return data specified in questions 1 to 10 (each is worth 5pts), which has to satisfy the following requirements: The answer to each question should be a single SQL query. You must order each query as described in the question, order is always ascending unless specified otherwise Every column in the result should be named. So if the query ask you to return something like income times 10, make sure you include an AS statement to name the column. While your question will not be assessed on their efficiency, marks may be deducted if unnecessary tables are included in the query (e.g., including both Owns and Customer when you only require the customerID of customers who own accounts). 10. Write multiple SQL queries to achieve the following goal: remove the customer (or the customers) who has the lowest total balance of all his/her accounts) among all customers. Besides, you should also clear their association to any accounts. Finally, if an account is no longer associate with any customers, it should be removed as well. In this question, you can assume that all the foreign key constraints specified in the database have ON DELETE CASCADE referential actions

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!