IS480 Advanced Database Management Assignment Problem

Assignment Help Database Management System
Reference no: EM132385496

IS480 - Advanced Database Management

Fall 2019 Term - Session 01 (#1791) - Individual Assignment

California State University, Long Beach - USA

Notes: For each procedure, turn in the following:

  • Turn spool on, then run the procedure with several values. Turn spool off.
  • Turn in a copy of the code
  • Turn in a copy/results of the spool file (showing the output).

Briefly answer the following:

1. Your local supermarket is having a "buy 3 get 1 free" promotion. That is, for every three units you buy, you get the fourth for free. Write a procedure with one input parameter indicating the number of units in your cart. Output is the number of units you need to pay for.

Hint: For every 4 units in your cart, you pay for 3. If you have items in your cart that do not form a group of 4, you pay for each item (e.g. 1, 2, or 3 units).

2. Your local supermarket is having a "buy x get 1 free" promotion. Write a procedure with two input parameters: "buy x" (e.g. p_x) - The "x" in the promotion and the number of items in your cart (p_noitems). Output is the number of units you need to pay for.

3. Your local supermarket is having a "buy x get y free" promotion. Write a procedure with two input parameters: "buy x" (e.g. p_x) - the "x" in the promotion, "get y" (e.g. p_y) - the "y" in the promotion, and the number of items in your cart (p_noitems). Output is the number of units you need to pay for.

4. Write a procedure to split a string at the first occurrence of a character. The procedure will accept two input parameters: a string and a character. Declare two variables v_before and v_after. Assign v_before the portion of the string before given character, and v_after the portion of the string after given character (including the character). Assume the user enters a valid single character for the split. Display v_before and v_after.

5. Write a procedure that will remove the first occurrence of a character in a string. Input two parameters: string and character. Output the string without the character.

6. Enhance the above to remove multiple characters (contiguous).

7. Write a procedure to replace the first occurrence of a character in a string with a new character. Input three parameters: string, original character, and replacement character. Output the new string with the character replaced.

Note: Do not use the Oracle Replace function.

8. Enhance the above to replace multiple characters (contiguous).

9. Review the following program

BEGIN

IF ConditionA THEN

actionA1;

actionA2;

ELSE

action X;

IF ConditionB THEN

actionB1;

ELSE

actionB2;

END IF;

actionY;

END IF;

END;

/

a. If condition A is true and condition B is true, which action(s) would be executed?

b. If condition A is not true and condition B is true, which action(s) would be executed?

c. If condition A is not true and condition B is not true, which action(s) would be executed?

10. Review the following code

x := 5;

IF x >= 5 THEN

x := x * 2;

ELSIF x >= 10 THEN

x := x * 3;

ELSE

x := x * 4;

END IF;

a. What is the value of x at the end of the program?

11. Review the following code

x := 5;

IF x >= 5 THEN

x := x * 2;

IF x >= 10 THEN

x := x * 3;

END IF;

ELSE

x := x * 4;

END IF;

a. What is the value of x at the end of the program?

12. Review the following code

x := 5;

IF x >= 5 THEN

x := x * 2;

IF x > 10 THEN

x := x * 3;

END IF;

ELSE

x := x * 4;

END IF;

a. What is the value of x at the end of the program?

13. Review the following code

x := 5;

IF x > 5 THEN

x := x * 2;

IF x > 2 THEN

x := x * 3;

END IF;

ELSE

x := x * 4;

END IF;

a. What is the value of x at the end of the program?

14. Create a procedure to determine a student's status: StudentStatus(p_UnitsCompleted). The input is the number of units completed. Output is student status based on the following:

0 <= units <= 30 → Freshmen

30 < units <= 60 → Sophomore

60 < units <= 90 → Junior

90 < units → Senior

If a negative number is entered, output an invalid entry message.

15. Create a procedure to calculate change with the fewest number of coins. The input is a purchase price of a dollar or less. Assume that you are paid with a dollar bill. Output the amount of change due. Display the change using the fewest number of pennies, nickels, dimes, and quarters.

16. What is the output of the following program?

j := 0;

FOR i IN 1..10 LOOP

IF i >= 3 THEN

EXIT;

DBMS_OUTPUT.PUT_LINE(j);

END IF;

j := i;

END LOOP;

17. What is the output of the following program?

j := 0;

FOR i IN 1..10 LOOP

IF i >= 3 THEN

DBMS_OUTPUT.PUT_LINE(j);

EXIT;

END IF;

j := i;

END LOOP;

18. What is the output of the following program?

j := 0;

FOR i IN 1..10 LOOP

IF i >= 3 THEN

DBMS_OUTPUT.PUT_LINE(j);

EXIT;

END IF;

j := i + j;

END LOOP;

19. Write a procedure to produce a multiplication table to a given base: PrintTable(p_base). Input is a base number and output is the multiplication table for the base times the integers from 1 to 10. See example in attached file.

20. Write a procedure to print the entire multiplication table per the below (100 rows).

Note: DO NOT turn in the output of this program, code only.

1 x 1 = 1

1 x 2 = 2

1 x 3 = 3

1 x 4 = 4

1 x 5 = 5

1 x 6 = 6

1 x 7 = 7

1 x 8 = 8

1 x 9 = 9

1 x 10 = 10

2 x 1 = 2

2 x 2 = 4

2 x 3 = 6

...

...

10 x 8 = 80

10 x 9 = 90

10 x 10 = 100

21. Enhance the RemoveChar procedure created earlier. Create a RemoveCharAll procedure that will remove all occurrences of a character in a string. Input two parameters: string and character. Output the string with the character removed.

22. Enhance the ReplaceChar procedure created earlier. Create a ReplaceCharAll procedure that will replace all occurrences of a character in a string with a new character. Input three parameters: string, original character, and replacement character. Output the new string with the character replaced.

Note: Do not use the Oracle Replace function.

Attachment:- Advanced Database Management Assignment File.rar

Reference no: EM132385496

Questions Cloud

Develop a working framework to guide an hr function : Develop a working framework to guide an HR function to better align itself with the strategic business units of an organization. Further, use the same framework
How might you use self-disclosure as a strategy : Respond to at least two colleagues who suggested a different strategy and suggest different approaches to working with Helen
MITS5501 Software Engineering Methodology Assignment : MITS5501 Software Engineering Methodology Assignment Help and Solution - Victorian Institute of Technology, Australia. Case Study - City Glaziers
EE344 Lab Assignment- External Internal Interrupt Experiment : EE344 Lab Assignment - External Internal Interrupt Experiment. Write an interrupt service routine for EXTI13 to perform the operations
IS480 Advanced Database Management Assignment Problem : IS480 - Advanced Database Management Assignment, Homework Help - California State University, USA - Write a procedure to split a string
Discuss the logistics and materials handling : Visited Red Cross National Office in Perth - Discuss the logistics and materials handling, supply chain management, and inventory management
Review the literature on your chosen theories : Narrative theory in social work Review the literature on your chosen theories. Clearly name and provide an overview for each of the two theories chosen
Design criteria for strength and serviceability : ENS3245 Steel Design Project Assessment Help - Edith Cowan University, Australia - Design criteria for strength and serviceability referring AS/NZS 1170.0 Tab
Assessment - Portfolio Quality Management in Practice : Assessment 2: Portfolio: Quality Management in Practice. Compare and contrast the roles played by that Quality Assurance and Quality Control

Reviews

len2385496

10/11/2019 10:30:45 PM

I’m having understanding Pl Sql using Sql Developer completely with it. I appreciate the help. I have provided the tutorials for the assignment they helped me if you can provide or add explanations on how to do the procedures, parameters, loops, and declarations step by step that would be great because. I also have a midterm next week so the explanations would help greatly.

Write a Review

Database Management System Questions & Answers

  Write a statement of work to present to wild wood management

Wild Wood Apartments owns 20 different apartment complexes in Washington, Oregon, California, and Idaho. Write a statement of work to present to the Wild Wood management

  Get unique department from employee table

clues 1: Get unique DEPARTMENT from employee table  clues 2: Select first 3 characters of FIRST_NAME from EMPLOYEE

  Compare two non-sequential file structure models

Compare the two non-sequential file structure models. What advantages does the first one have over the second and what advantages does the second have over the first?

  List the different types of locks used by dbms systems

List the different types of locks used by DBMS systems and explain how they differ from each other. Additionally, suggest the suitable scenario for each of them.

  Write a query to get productname and quantity

Write a query to get productName and Quantity - Write a query to get First name and last name from employees - Create a report showing employee orders

  Discuss the degree to which you believe your diagram reflect

Discuss the degree to which you believe your diagram reflects the database design. Create a database diagram with the entities and attributes that the scenario identified.

  Assume the data warehousing system is centralized

Assume the data warehousing system is centralized, and implemented in the environment of Microsoft SQL Server 2012. As we discussed in the introduction, each store has its own local database.

  Create a relational database model of the system

Using MS Access, or MS SQL Server Express, students will create a relational database model of the system.

  Create a pl-sql procedure to print out the reservation

Write a PL/SQL function that given a reservation ID, returns the name of guest who made that reservation. If there is no such reservation in the database, return null. Please call this function with input reservation ID 1, and print out the return..

  What are the cases where hsm is a better choice and why

What are the cases where HSM is a better choice? Why? What are the cases where SSM is a better choice? Why? Are there any similarities between HSM and SSM

  Analyse and comprehend a provided er diagram

You are required to use SQL statements to create the database, the tables and insert sufficient data to test the required reports - You will need to incorporate the above details in the updated ER diagram and database and then use that database to ..

  Explain the benefits and current trends of data warehousing

Explain the benefits and current trends of data warehousing and data mining. Outline the architecture, models and views used in the data warehouse.

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