Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Computer Engineering Expert

Assignment -

Objectives

The objective of this assignment is:

- to modify and to extend the structures of a sample relational database;
- to implement the modifications of database contents;
- to implement the simple and complex queries;
- to implement view for queries;
- to implement stored procedure and function.

Tasks

Download a2create.sql and a2drop.sql from the Moodle, execute the script file a2create.sql to create tables before task 1 implemented, and execute the script file a2drop.sql at the end of this assignment to save your space.

Task 1: Data definitions, modifications and manipulations

Implement SQL script in a file a2task1.sql that performs the following tasks. Add the tasks' number in the comment lines for each sub-task in the script file a2task1.sql. For example,
/* Task 1.1 */

1. The value of "phone#" in the table Bank must be unique.

2. Each manager of a bank should be an employee of that bank.

3. The value of "sex" must be either ‘M' or ‘F'.

4. Add a new column "total_staff_number" in the table Bank. Set the correct values for the new column. (Note: The correct values should be got from the corresponded table by using one SQL statement).

5. The value of account "type" must be one of "SAVING", "CREDIT", "HOME LOAN", "PERSONAL LOAN", "TERM DEPOSIT", "CHECK", "ISAVER" and "SHARE".

6. The value of "DOB" cannot be NULL.

7. The manager ‘00101' of the bank ‘082886' has been swapped with the manager ‘01010' of the bank ‘082237'. Update the correspondent records in the tables. (Note: The employees' number should keep the same as before. The constraints of tables have been changed by previous tasks.)
8. Implement a parameterised SQL script that prompts about full information describing a dependent and inserts a new row into the table Dependent.

Task 2: Data retrieval operations

By using the tables modified in Task 1, implement the following data retrieval operations using SELECT statement (one statement for each question) of SQL in a file a2task2.sql. Add the tasks' number in the comment lines for each sub-task in the script file a2task2.sql. For example,
/* Task 2.1 */

1. Find names of all banks and their total number of customers.

2. Find all customers' name, address and total amount of balances. Display 0 (zero) if a customer has no account balance.

3. Find all the employees' name, DOB and salary that have no dependent by using "NOT EXISTS".

4. Find all the banks' name and total amount of "HOME LOAN" for each of them.

5. Find all the managers' name and date of birth.

6. Find all the employees' number and name that directly supervised by the manager of the bank ‘NAB UoW'.

7. Find all the customers' number, name, date of birth and address who have the most debts (total amount of balance is the smallest).

8. Find all the customers' number, name and date of birth that have at least three accounts.

9. Find all the customers' number, name and address that their credit accounts are in debt. (Balance less than zero).

10. Find the average age of customers that have "Saving" account.

Task 3: Views, stored procedure and function

By using the tables modified in Task 1, implement the following data retrieval operations using VIEW of SQL in a file a2task3.sql. Add the tasks' number in the comment lines for each sub-task in the script file a2task3.sql. For example,
/* Task 3.1 */

1. Create a view CUSTOMERACCOUNTS that contains customer BSB#, customer#, name, account#, type and balance. Display the results from the view like following:

BSB#  CUSTOMER#NAME ACCOUNT#
 TYPE  BALANCE

012878 123456

Mike

32345678

HOME LOAN

-453234.52

 

 

22345678

CREDIT

-1534.52

 

 

12345678

SAVING

1234.52

012878 123458

Jean

11001234

SAVING

3213.54

 

 

21001234

CREDIT

-120.34

 

 

31001234

PERSONAL LOAN

-63121.23

012878 123460

Alex

30224321

HOME LOAN

-329131.76

 

 

20224321

CREDIT

-131.23

 

 

10224321

SAVING

131.23

 

 

40224321

TERM DEPOSIT

5500

082886 123456

Ben

12345678

SAVING

567.32

 

 

42345678

TERM DEPOSIT

12000

 

 

52345678

ISAVER

2312.11

 

 

32345678

PERSONAL LOAN

-32123.32

 

 

22345678

CHECK

567.32

082886 123457

Duke

13214567

SAVING

1234.56

 

 

23214567

SHARE

21234.56

 

 

43214567

TERM DEPOSIT

32000

082886 123472

Josef

24314567

SHARE

1323.45

 

 

14314567

SAVING

323.45

082886 123475

Harry

 

 

 

082886 123483

Will

 

 

 

2. You will allow SCOTT to read the information of Employee name, dependent name and relationship. Display the access privilege on the required information.

Attachment:- Assignment.rar

Computer Engineering, Engineering

  • Category:- Computer Engineering
  • Reference No.:- M92261404
  • Price:- $100

Guranteed 48 Hours Delivery, In Price:- $100

Have any Question?


Related Questions in Computer Engineering

Question after 1 year of launch ride sharing increased a

Question: After 1 year of launch, ride sharing increased a lot resulting in a lot of insertion requests to the database. Consider there is no room to further increase the size of server and changing database is not an op ...

Question suppose you are now acting as a consultant to an

Question : Suppose you are now acting as a consultant to an organization of your choice that has one or more specific compliance requirements. Considering this scenario, respond to the following: • Describe your selected ...

Question find an article on the www that discusses a recent

Question: Find an article on the WWW that discusses a recent (within the last 2 years) security breach or Cyberattack. Provide a link to the article and suggest 2 Best practices for a user Domain Policy that would mitiga ...

Assignmentnbspon information systems audit and

Assignment  on Information Systems audit and controls Assignment purpose: Elaborate on the different types of control that are applied in a hospital (Preventive, detective and corrective control). Evaluate the logical an ...

We have recovered a flash drive with a password-protected

We have recovered a flash drive with a password-protected archive. Help decrypt it. What is the password used to encrypt the archive? It's a zip file, how do I get the password, what kali linux commands I use?

The switch statementhere is the question in its entirety

The switch statement Here is the question in its entirety, but the actual problem is at the end. I just felt that I would give an overview of what I am asking. The program has to be in c++ (.cpp) and must compile as such ...

Research web server vulnerabilities by choosing a site and

Research web server vulnerabilities by choosing a site and determining what kind of platform it is running on. Do not scan the server, you can use a site such as Netcraft to determine what the website is running. See if ...

Why is it important to back up the dhcp database and

Why is it important to back up the DHCP database and Identify key files that make up the DHCP database?

Identify and evaluate at least three considerations that

Identify and evaluate at least three considerations that one must plan for when designing a database. Suggest at least two types of databases that would be useful for small businesses, two types for regional level organi ...

Problem a design a 64kb 8-way set associative cache that

Problem : A. Design a 64KB 8-way set associative cache that has 32 words per blocks and 4 bytes per word (MIPS type). Assume a 32 bit address. a) Calculate the following a How many bits are used for the byte offset? b) H ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As