Pl/sql assignment, PL-SQL Programming

Assignment Help:

1.

a. Write a trigger that fires when a part's price is updated. The trigger will write a record into a table called PriceUpdates. The record should contain the information of PNO, new price and old price of the part, and date when the change is made.

b. Test the above trigger by updating the price of the part 10506 from 19.99 to 24.99. List the tables parts and priceUpdates to verify the results are correct.

2. Delete Trigger: Write a trigger that fires when a command tries to delete some rows from employees. The trigger should reject the deletion and display the warning information "failed operation" to the user. (Tip: use the system function raise_application_error).

3. (extra credit)Delete trigger

a. Write a trigger that fires if all records about an order in odetails are deleted. The trigger should delete the corresponding order from the orders table and record the dropped order in a table, called deleted_orders

Hint: One of your tasks is to create the table deleted_orders, and you need to decide what attributes should be included in the table. Besides, you need to figure out how to identify if all parts of an order have been deleted from odetails.

b. Test the above trigger by deleting the parts with ONO=1020. Then list the tables orders, odetails, and deleted_orders to verify the results are correct.


Related Discussions:- Pl/sql assignment

Controlling autonomous transactions, Controlling Autonomous Transactions ...

Controlling Autonomous Transactions The first SQL statement in an autonomous routine starts a transaction. Whenever one transaction ends, the next SQL statement starts the oth

Semidifference and not - sql, Semidifference and NOT - SQL In this sec...

Semidifference and NOT - SQL In this section first describe the relational difference operator, named MINUS. Example here shows SQL's closest counterpart of that operator.

PROCEDURES AND FUNCTIONS QURIES, i NEED THE QURIES TO SOME OF THE PROBLEMS ...

i NEED THE QURIES TO SOME OF THE PROBLEMS USING plsql

%notfound - explicit cursor attributes, %NOTFOUND The %NOTFOUND is log...

%NOTFOUND The %NOTFOUND is logical, opposite of the %FOUND. The %NOTFOUND yields FALSE if the last fetch returned a row, or TRUE when the final fetch failed to return a row. I

Use of table expressions - expressing constraint conditions, Use of Table E...

Use of Table Expressions - Expressing Constraint Conditions With the exception of key constraints, the examples in the theory book all explicitly reference at least one relvar

Using trim - collection method, Using TRIM This process has two forms....

Using TRIM This process has two forms. The TRIM removes an element from the end of the collection. The TRIM(n) removes the n elements from the end of the collection. For e.g.

Example of foreign key constraint - sql, Example of Foreign Key Constraint ...

Example of Foreign Key Constraint Example: Alternative formulation for 6.3 as a foreign key constraint ALTER TABLE EXAM_MARK ADD CONSTRAINT Must_be_enrolled_to_take_exam

Delimiters, Delimiters A delimiter is a simple or compound symbol whi...

Delimiters A delimiter is a simple or compound symbol which has a special meaning to PL/SQL. For example, you use delimiters to symbolize an arithmetic operation like additio

Albeit simple method , Albeit simple method : These all the truth tabl...

Albeit simple method : These all the truth tables give us our first as albeit simple method for proving a theorem: where check whether it can be written in propositional logic

Sql is a database language, SQL Is a Database Language: The commands g...

SQL Is a Database Language: The commands given to a DBMS by an application are written in the database language of the DBMS. The term data sublanguage is sometimes used instea

Write Your Message!

Captcha
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