0% found this document useful (0 votes)
30 views

PLSQL Practical Questions

Uploaded by

vivek reddy
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
30 views

PLSQL Practical Questions

Uploaded by

vivek reddy
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

PLSQL Practical Test Paper

Candidate Name : G VIVEKANANDA REDDY


Table of Contents
Section 2: PLSQL Practical Questions..........................................................................................................2
Section 3: SQL Practical Questions.............................................................................................................3

1
All Sections are mandatory. Please ensure that all your answers are clearly written. Any scripts or files
related to your work shall be saved properly and available in your main working folder.

Section 2: PLSQL Practical Questions


Read the following scenario and attend to the assignment requirements.

BCM Ltd is a financial institution recently set up. While the company provides financial services and
advices, it makes use of an off-the-shelf information system to help operate its daily activities. The
system data is hosted on an Oracle database.

However, as the owner is still managing the company's internal expenses and invoices manually, he is
looking forward to move to a simple information system as a way of having a better view on his
Purchase Orders and payments to make a better follow up and to be able to undertake decisions that
are more accurate.

All information were kept in an excel sheet but have already been loaded in the existing Oracle database
in its raw format in table "XXBCM_ORDER_MGT". The first column in the table contains both the order
reference and order lines. The table contains the list of expenses managed by the owner in terms of
Purchase Orders raised as well as the respective Invoices received from his suppliers. A tracking of
payments effected per invoice is also maintained in the transactions.

You are requested to work on the analysis part based on the existing database data loaded and come up
with appropriate solutions.

Your assignment consists of the following tasks:

1. Analyze the data and propose briefly how you would normalize the information. Outline two
reasons why this must be done. [5 marks]
2. Further to your analysis, design an Entity Relationship Diagram (ERD) based on following tables:
XXBCM_ORDER_MASTER
XXBCM_ORDER_DETAIL
XXBCM_SUPPLIER
XXBCM_INVOICE
showing clearly the relationships with comments where applicable.[8 marks]
3. Based on your ERD, provide proper Create Table scripts with necessary columns, data types and
constraints. Create your tables in the database with appropriate naming convention. [8 marks]
4. Develop a PLSQL procedure to trigger a migration process that will extract information from table
"XXBCM_ORDER_MGT" and load them in tables that you created with proper data format. You are
expected to create a database package with appropriate functions or procedures. All the database
objects that you need to create shall be available on your working database environment and
properly compiled. [35 marks]
5. Outline in bullet points how you would ensure that all data have been processed and how you
would handle exceptions and errors. [4 marks]

2
Section 3: SQL Practical Questions
This section consists of SQL statements which you are expected to derive to return expected results
from the records in tables you created in section 2.

1. The owner wishes to have a report displaying a summary of Orders with their corresponding list of
distinct invoices and their total amount to be able to reconcile his orders and payments. The report
shall contain the details as per table below ordered by latest Order Date on top. [8 marks]

Column Name Specifications


Order Reference Exclude prefix PO and return only numeric value, e.g. PO001 shall
return value 1.
Order Period Period based on Order Date. Example of expected format “JAN-17”.
Supplier Name First character in each word to uppercase and the rest to
lowercase.
Order Total Amount Format “99,999,990.00”.
Order Status As per record.
Invoice Reference As per record.
Invoice Total Amount Format “99,999,990.00”.
Action Return the following value based on the invoice statuses.
If all invoice statuses are Paid, display “OK”.
If any of the invoice statuses is Pending, display “To follow up”.
If any of the invoice Statuses is Blank, display “To verify”.

2. Return details for the THIRD (3rd) highest Order Total Amount from the list. Only one record is
expected with the following information. [8 marks]

Column Name Specifications


Order Reference Exclude prefix PO and return only numeric value, e.g. PO001 shall
return value 1.
Order Date Example of expected format “January 01, 2017”.
Supplier Name In upper case.
Order Total Amount Format “99,999,990.00”.
Order Status As per record.
Invoice References For that specific Order, list all invoice references delimited by
comma. For example., “INV_PO999.1, INV_PO999.2, INV_PO999.3”

3. List all suppliers with their respective number of orders and total amount ordered from them
between the period of 01 January 2017 and 31 August 2017. Output details as per below. [4 marks]

Column Name Specifications


Supplier Name As per record.
Supplier Contact Name As per record.
Supplier Contact No. 1 First contact number formatted as “999-9999” or “5999-9999”.
Supplier Contact No. 2 Second contact number formatted as “999-9999” or “5999-9999”.
Total Orders Total number of orders.
Order Total Amount Format “99,999,990.00”.

You might also like