Database application assessment

Assignment Help PL-SQL Programming
Reference no: EM132668704

BIT358 Advance Database - Melbourne Polytechnic

Database Application Assessment

Part A - PL/SQL

1. Write a procedure that is passed a teacher's ID and returns the Name, Office Location and Specialisms. Also write an interactive anonymous block with the procedure call. The anonymous block must print all the teacher's information. Test the program and print out your results to show that the program is working correctly.

2. Write a function which will determine whether a teacher exists. If the teacher table does not contain that teacher ID, return a FALSE value, otherwise return a TRUE value as Boolean. Print the appropriate message in the interactive calling program (anonymous block) based on the result. Test the program and print out your results through anonymous block.

3. Write a procedure that takes a teacher's ID and dates details and outputs the information given in the following report (in text format on command prompt). Write an interactive anonymous block with the procedure call. Test the program (show that the program is working correctly).

4. Create a database trigger entitled TIMETABLE_SECURITY_TIME_CHECK_1234 (where 1234 is your student id). This trigger should fire before any UPDATE or INSERT statement occurs on the TIMETABLED_SLOT table. This trigger will check the date and time attributes and if the day is a

Saturday or a Sunday or if the time is outside the school business hours i.e. between 8am and 3pm a message "Out of school hours - this transaction has not completed by 1234" (where 1234 is your student id) should be displayed. Test this trigger.
Hint: Create a user defined exception to handle incorrect date/time entries.

5. Alter table Teacher and add an additional attribute to the Teacher table to store details of the teacher's salary and run the following update commands.

Create a PL/SQL block to increase the salary of all teachers' following an annual pay rise. The increase is 15% for those teachers whose salary is less than $50,000 and 10% for those who earn $50,000 or more. You may use a Cursor FOR loop in this problem. Test and show evidence of all features of your answer.

Hints: Ensure your table contains sufficient and suitable data to demonstrate that this block works correctly. You will need to use the SELECT ... FOR UPDATE command . Also you will need to use the WHERE CURRENT OF clause

6. Write a procedure that takes a date and outputs details of the sessions running on that day.The details include the name of teacher teaching, Room no, Subject being taught and session number as shown below in the following report format:

Timetable for date: 04/04/2020
Session 1: TeacherName RoomNo SubjectTitle Session 2: TeacherName RoomNo SubjectTitle Session 3: TeacherName RoomNo SubjectTitle Session 4: Free
Session 5: Null
Session 6: Free
Write an interactive anonymous block with the procedure call. Test your program works correctly.

Instructions for Part B

• For question 1 - 5, Use Oracle or SAS Studio to run the SQL Queries
• You may put all the query commands for Part B into ONE notepad file. However you must place appropriate labels (comments) in this file e,g. Part B Q2

1. Using TOP-N list 2 teachers those teachers who are paid the most.

2. Display all teachers along with the sessions they are scheduled to teach for a particular day. Your query should also display those teachers who have NOT been allocated any sessions that day. You are to use one query only for this problem.

3. Which teachers has more specialisms than the teacher with name ‘Tom Wright'? List the teacher details and the total number of specialisms they have.

4. For each Session display the details of that session in date order with the date shown in the format ‘4 April 2020'.

5. There have been many data entry operator errors where data has been entered with Caps Lock on sometimes, other times with Caps Lock off and other times where the Caps Lock has been used intermittently. With this in mind display the details of all teachers who are able to teach ‘Maths'

Hint: You will need to use an SQL function for this.

Attachment:- Database Application.rar

Reference no: EM132668704

Questions Cloud

Discuss seven practices for effective reframing : Summarize the article and explain the main issues discussed in the article. Discuss the seven practices for effective reframing of the problems.
What type of account is the employee advances account : What type of account is the Employee Advances account? How can you review a payroll journal entry? Use the Previous and Next buttons in the Payroll Entry form
How recently the article was published : In this paper, you will pick a topic you are interested in, and find an academic article from your field, published in the last five years.
Identify types of third-party plans in canada : Identify types of third-party plans in Canada, how does one apply for them? What are the benefits of having third-party insurance?
Database application assessment : Database Application Assessment - Write a procedure that is passed a teacher's ID and returns the Name, Office Location and Specialisms
Identify the type of meeting being organised : Identify the type of meeting being organised and what is its purpose?
Common anti-patterns during program increment planning : What are two common anti-patterns during program increment (PI) planning?
What is the employer premium amount for employment insurance : Find What happens when the employee year-to-date amounts for statutory deductions reach the legislated annual amount limit?
Write a four-page paper regarding the trend : Write a four-page paper regarding the trend. Describe how the trend is a threat to personal and/or corporate security. Describe how the thread can be mitigated.

Reviews

len2668704

10/19/2020 2:25:16 AM

Please note and read the questions carefully, PL/SQL is required to answer the questions not SQL. You are required to write programming code by creating procedure, function or trigger in PL/SQL (It is a Database programming language) and then show the evidence by calling the procedure, function or trigger in PL/SQL anonymous block. Please redo the solutions . Also, for each question, followings must be included in the word document 1. The PL/SQL code as a text 2. The screen shot of PL/SQL in oracle UI 3. The result/output of the PL/SQL in oracle UI 4. Each screen shot should contain your id or name (as logged in user)

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