Describe concepts of database-orientated programming

Assignment Help PL-SQL Programming
Reference no: EM13346894

Describe Concepts of database-orientated programming language, PL/SQL, as well as of data analysis techniques for decision-making. Write PL/SQL procedures and functions to populate and query that database and design interesting and useful data analysis queries over that database.

1 Create the Telecom Database

Your first task is to create a database, using Oracle 11g SQL, to store data on customers and phone calls made by customers of a Telecom, according to the following requirements.

The company holds data about their customers, whose attributes include:
_ telephone area code and number;
_ first name;
_ last name;
_ date-of-birth.

Each phone call made by a telecom's customer is characterised by:

_ customer that makes the phone call. There must be a foreign key constraint that relates the customer information in this table to that in the customer table above.
_ area code and telephone number of the receiver of the phone call;
_ start date and time;
_ end date and time;
_ charge per minute in pounds and pence.

The following shows the categorisation of a phone call receiver according to their area code's prefix:

_ 01 or 02: local/national number. Ex.: 01612 338866.
_ 075, 077, 078, 079: mobile phone number. Ex.: 07747 556647.
_ 0800: free number. Ex.: 08002 223344.
_ 0845, 0870: special service. Ex.: 08451 423456.
_ 08442 to 08449: 5p special service. Ex.: 08444 404404.
_ 08712 to 08719: 10p special service. Ex.: 08713 457893.
_ 090, 091, 098: premium rate special service. Ex.: 09119 229595.

You must implement database constraints to ensure that no phone calls with receivers that do not fall into the categories above are inserted into the database.

It is required that a table is maintained for premium rate special services (i.e., those 09 numbers above) to which a customer may make phone calls. Each premium rate special service is described by the following features:

_ area code (prefixed by either 090, 091 or 098) and telephone number;
_ name;
_ cost per minute (pound and pence).

Implement a PL/SQL Function to Obtain Call Cost

You must implement a PL/SQL function that returns the cost per minute of a phone call according to the following rules based on the prefix of the receiver's area code (please note that the element in bold should be the parameter of the function):

_ local and national numbers: 1p;
_ mobile phone numbers: 10p;
_ free numbers: 0p;
_ special services: 2p;
_ 5p special services: 5p;
_ 10p special services: 10p;
_ premium rate special service: cost according to table as described in section 2.1.

Implement Additional PL/SQL Functions

You must also implement PL/SQL functions that compute and return the following:

1. age of a customer, based on date-of-birth and current date;

2. duration of a phone call rounded up to the nearest minute;

3. the total cost of phone calls of a particular customer for a range of dates;

4. the total cost of phone calls of a particular customer this month (from the first date of the current month up to the current date).

Please note that the elements in bold should be the parameters of the functions, and that phone call costs should be expressed in pounds and pence.

Devise and Apply Data Analysis Queries on the Telecom Data

Your third task is to write SQL expressions for the following data analysis queries on the Telecom database you created:

1. Aggregate the calls by the telephone number they were made from, presenting the total number of phone calls, total number of minutes, and the total charge.

2. Based on the above, show the top 5 callers with respect to the total number of minutes.

3. Show the total number of calls made to normal telephone numbers (callsNonPremimum), the total number of calls made to premium numbers (callsPremium) and their difference (callsNonPremium- callsPremium), per month.

Reference no: EM13346894

Questions Cloud

1 when you purchase a stock you expect to receive dividends : 1 when you purchase a stock you expect to receive dividends plus capital gains. not all stocks pay dividends
Analysis design and development of a small software system : analysis design and development of a small software system. produce an executable software solution to the
Allelectronics caries 1000 products p1 p1000 consider : allelectronics caries 1000 products p1 . p1000. consider customers ada bob and cathy such that ada and bob purchase
Theory of interest- non-annual interest rates and : theory of interest- non-annual interest rates and annuitiesfind the annual effective rate of interest equivalent to a
Describe concepts of database-orientated programming : describe concepts of database-orientated programming language plsql as well as of data analysis techniques for
Scanning and parsingimplement the lexical and syntactic : scanning and parsingimplement the lexical and syntactic analysis of minifun programming language. the scanner splits up
Question 1which of the following statements is true for a : question 1which of the following statements is true for a trapdoor function f?answer a.the function f can be computed
1 object oriented programming class hierarchies : 1. object oriented programming class hierarchies inheritance and virtual functions in this part of the assignment you
Describe and evaluate this type of internal audit what : describe and evaluate this type of internal audit. what types of organisation would it be most useful for?required1

Reviews

Write a Review

PL-SQL Programming Questions & Answers

  Create a database model

Create a database model and Submit the table creation statements for the Database Model.

  Write pl-sql procedures and functions

Write PL/SQL procedures and functions to populate and query that database

  Sql questions

Write a query to display using the employees table the EMPLOYEE_ID, FIRST_NAME, LAST_NAME and HIRE_DATE of every employee who was hired after to 1 January, 1995.

  Run the lab_03_01.sql script

Run the lab_03_01.sql script in the attached file to create the SAL_HISTORY table. Display the structure of the SAL_HISTORY table.

  Write sql queries

Write a query to display the last name, department number, and salary of any employee whose department number and salary both match the department number and salary of any employee who earns a commission.

  Explaining sql insert statement to insert new row in cds

Write down a SQL insert statement to insert new row in "CDS" table.

  Write down name of actors in ascending order

Write down actors (or actress, your choice, but not both) who have won at least two (2) Academy Awards for best actor/actress. Provide the actor name, movie title & year. Order the result by actor name."

  What is an sql injection attack

What is an SQL injection attack? Explain how it works, and what precautions must be taken to prevent SQL injection attacks.What are two advantages of encrypting data stored in the database?

  Determine resonant frequency in series rlc resonant circuit

Given the series RLC resonant circuit in the figure, operating at variable frequency, determine: The resonant frequency ω o ,  The circuit’s quality factor Q , The cut-off frequencies, f 1  & f 2  and the bandwidth BW

  Query that uses cube operator to return lineitemsum

Write summary query which uses CUBE operator to return LineItemSum (which is the sum of InvoiceLineItemAmount) group by Account(an alias for AccountDesciption).

  Query to show customers were missing for existing orders

As DBA, your manager called a meeting and asked why there are so many orders for customers that don't exist in the customer table. Write query which would shows which customers were missing for existing orders. Use a join or a subquery.

  Sql query into a relational algebra statement

Turn this SQL query into a relational algebra statement? SELECT Request.reqfor, Ordering.invamt, Ordering.invnbr, Ordering.invdat

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