Implement stored procedure and function

Assignment Help Computer Engineering
Reference no: EM131452664

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

Reference no: EM131452664

Questions Cloud

Concept of a contribution margin is pretty straightforward : The overall concept of a contribution margin is pretty straightforward- it is how much each unit contributes to covering fixed costs and eventually, profit.
Discuss which leadership style to which you are most aligned : Identify one theory that appeals to you the most from the leadership theories discussed in your team and in the text.
About the judgmental forecasting : Which of the following is true of judgmental forecasting?
What is the price per share of the company stock : You have looked at the current financial statements for Reigle Homes, Co. What is the price per share of the company's stock?
Implement stored procedure and function : CSCI835 Database systems - Create a view CUSTOMERACCOUNTS that contains customer BSB#, customer#, name, account#, type and balance. Display the results
What is the inflation premium : Whats the real interest rate? Alternatively, assume that the real interest rate is 1 percent and the nominal interest rate is 6 percent.
Experienced unprecedented volatility- wild ups and downs : Lately, the stock market has experienced unprecedented volatility- wild ups and downs.
Develop theory and application of capital budget analysis : During week 6 we develop the theory and application of capital budget analysis. most likely to contribute to capital project analysis failure
Draw the diagram of trl olo and lvl : Using the notation scheme for defining manipulator configurations, draw diagrams.

Reviews

len1452664

4/6/2017 4:43:20 AM

Task 3 Submit a file a2task3.txt that contains the execution results of a script file a2task3.sql. Remember to put SQL*Plus command SET ECHO ON and SET SERVEROUTPUT ON in the front of the script file. A report that contains no listing of executed SQL statements scores no marks and report that contains errors also scores no marks! This Assignment is to be submitted on Moodle. Submit the files through Moodle in the following way: (1) Connect to the Moodle site for the subject. (2) Navigate to a folder ASSIGNMENT SUBMISSIONS (3) Click at Assignment 2, Submit your solutions here link. (4) Click at Add submission button, (5) In File submissions, click Add … button. (6) Click Choose File. (7) Navigate to a location where files a2task1.txt, a2task2.txt and a2task3.txt have been saved. (8) Select a file and click Open button, then click at Upload this file button.

len1452664

4/6/2017 4:42:55 AM

Preparation of this assignment requires implementation of the conceptual modeling tasks and implementation of the SQL statements included in home works 1, 2, 3, 4, 5, 6 and 7.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. Task 1 Submit a file a2task1.txt that contains execution results of a script file a2task1.sql. Remember to put SQL*Plus command SET ECHO ON in the front of the script file. A report that contains no listing of executed SQL statements scores no marks and report that contains errors also scores no marks! Task 2 Submit a file a2task2.txt that contains the execution results of a script file a2task2.sql. Remember to put SQL*Plus command SET ECHO ON in the front of the script file. You may need to set suitable line size and page size. A report that contains no listing of executed SQL statements scores no marks and report that contains errors also scores no marks!

Write a Review

Computer Engineering Questions & Answers

  Mathematics in computing

Binary search tree, and postorder and preorder traversal Determine the shortest path in Graph

  Ict governance

ICT is defined as the term of Information and communication technologies, it is diverse set of technical tools and resources used by the government agencies to communicate and produce, circulate, store, and manage all information.

  Implementation of memory management

Assignment covers the following eight topics and explore the implementation of memory management, processes and threads.

  Realize business and organizational data storage

Realize business and organizational data storage and fast access times are much more important than they have ever been. Compare and contrast magnetic tapes, magnetic disks, optical discs

  What is the protocol overhead

What are the advantages of using a compiled language over an interpreted one? Under what circumstances would you select to use an interpreted language?

  Implementation of memory management

Paper describes about memory management. How memory is used in executing programs and its critical support for applications.

  Define open and closed loop control systems

Define open and closed loop cotrol systems.Explain difference between time varying and time invariant control system wth suitable example.

  Prepare a proposal to deploy windows server

Prepare a proposal to deploy Windows Server onto an existing network based on the provided scenario.

  Security policy document project

Analyze security requirements and develop a security policy

  Write a procedure that produces independent stack objects

Write a procedure (make-stack) that produces independent stack objects, using a message-passing style, e.g.

  Define a suitable functional unit

Define a suitable functional unit for a comparative study between two different types of paint.

  Calculate yield to maturity and bond prices

Calculate yield to maturity (YTM) and bond prices

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd