Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Above is part 1 Below is part 2 Part1 Instructions: In a Relational Database, using Procedural Language extensions to Sql or PL/Sql adds the procedural

image text in transcribed

Above is part 1

Below is part 2

image text in transcribed

image text in transcribed

Part1 Instructions: In a Relational Database, using Procedural Language extensions to Sql or "PL/Sql" adds the procedural language constructs to the Sql language in order to cover its programming limitations. It will also improve the programming techniques in applications which run on databases using just Sql queries. It was designed to work only with Oracle DBMS and not working with any other DBs. To start programming with PL/Sql, open a CLI on your system and login to your Oracle database. Then try the following code, which prints a welcome message on the display: SQL> set serveroutput on SQL> begin 2 dbms_output.put_line('Welcome to Oracle PL-Sql') 3 end; 4/ Welcome to Oracle PL-Sql PL/SQL procedure successfully completed. SQL> Part2 Instructions: In a Relational Database, "OBJECT" is a data structure to store or to refer to data. The most common object that is used in a database is "Table". -An Object Type is the concept for defining an object, like a Table or Index. -An Object Instance can be created based on an object type, like st table that can be created as an instance of the object type Table. To start programming with OBJECT, continue with the CLI you opened above on your system. Then try the following code, which creates an OBJECT, a user-defined type which is a "St_Rec", and then creates a Table named st table based on the St_Rec. A message will be printed on display with each successful command: SQL > Create TYPE St Rec AS OBJECT 2 (St_Name VARCHAR(10), 3 St Id Number(7), 4 St_Email VARCHAR(50)); 51 Iype created. SQL > Create TABLE st table of St_Rec; Table created. SQL Add the followings to the tables created in Assignment-1only by using PL/Sql: [8 Marks] 1- Create a new type named "depart type" with this schema: Name, Faculty, Building, Phone 2- Create a new table named "Professor" with this schema: Name, Emp_id, Email, depart_type First make a type of this schema and then create the table based on that type. Note that deprt type is itself a type. 3- Insert values in the "Professor" table at least for 5 records. 4. Display the whole "Professor" table on the screen. 5- Add a new attribute to the "Professor" table named "Income" and insert proper input values. 6- Write a for-loop to calculate and display the tax ( 30% of Income) for all Professors. 7. Write a procedure to find and display all the professors' incomes which are less than $40,000. 8. Write a procedure to find and display the average of all the professors' incomes. Note - It is recommended to add screen-shots to the code for submission. Part1 Instructions: In a Relational Database, using Procedural Language extensions to Sql or "PL/Sql" adds the procedural language constructs to the Sql language in order to cover its programming limitations. It will also improve the programming techniques in applications which run on databases using just Sql queries. It was designed to work only with Oracle DBMS and not working with any other DBs. To start programming with PL/Sql, open a CLI on your system and login to your Oracle database. Then try the following code, which prints a welcome message on the display: SQL> set serveroutput on SQL> begin 2 dbms_output.put_line('Welcome to Oracle PL-Sql') 3 end; 4/ Welcome to Oracle PL-Sql PL/SQL procedure successfully completed. SQL> Part2 Instructions: In a Relational Database, "OBJECT" is a data structure to store or to refer to data. The most common object that is used in a database is "Table". -An Object Type is the concept for defining an object, like a Table or Index. -An Object Instance can be created based on an object type, like st table that can be created as an instance of the object type Table. To start programming with OBJECT, continue with the CLI you opened above on your system. Then try the following code, which creates an OBJECT, a user-defined type which is a "St_Rec", and then creates a Table named st table based on the St_Rec. A message will be printed on display with each successful command: SQL > Create TYPE St Rec AS OBJECT 2 (St_Name VARCHAR(10), 3 St Id Number(7), 4 St_Email VARCHAR(50)); 51 Iype created. SQL > Create TABLE st table of St_Rec; Table created. SQL Add the followings to the tables created in Assignment-1only by using PL/Sql: [8 Marks] 1- Create a new type named "depart type" with this schema: Name, Faculty, Building, Phone 2- Create a new table named "Professor" with this schema: Name, Emp_id, Email, depart_type First make a type of this schema and then create the table based on that type. Note that deprt type is itself a type. 3- Insert values in the "Professor" table at least for 5 records. 4. Display the whole "Professor" table on the screen. 5- Add a new attribute to the "Professor" table named "Income" and insert proper input values. 6- Write a for-loop to calculate and display the tax ( 30% of Income) for all Professors. 7. Write a procedure to find and display all the professors' incomes which are less than $40,000. 8. Write a procedure to find and display the average of all the professors' incomes. Note - It is recommended to add screen-shots to the code for submission

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Nested Relations And Complex Objects In Databases Lncs 361

Authors: Serge Abiteboul ,Patrick C. Fischer ,Hans-Jorg Schek

1st Edition

3540511717, 978-3540511717

More Books

Students also viewed these Databases questions

Question

What can you do this week to increase your charisma?

Answered: 1 week ago