إنتقال للمحتوى

  • تسجيل الدخول عبر الفيس بوك تسجيل الدخول عبر تويتر Log In with LinkedIn Log In with Google      تسجيل دخول    
  • إنشاء حساب

صورة
- - - - -

محتاجه مساعده ضروريه


لا توجد ردود على هذا الموضوع

#1 شبيهة البدر

شبيهة البدر

    عضو

  • الأعضــاء
  • 2 مشاركة

تاريخ المشاركة 10 December 2007 - 08:46 AM

السلام عليكم...اخواني اعضاء هذا المنتدى الرائع اضع بين ايديكم هذا الاسايمنت وانا مستقبلي بين ايديكم لانه اذا لم احل هذا لاسايمنت سوف لن اجاز في دبلوم الاوراكل وارجو منكم المساعده لاني لم اعرف حل لهذه المعضله ولن انسى لكم هذا الصنيع ..
اختكم:شبيهة البدر....
(ملاحظه اخر يوم للتسليم هو يوم الاربعاء)


1.1[size="4"] Objective:
The key objective of the assignment is to understand and construct PL/SQL blocks. It uses SELECT statement in PL/SQL block to interact with the Oracle Server. It also uses the creation and use of cursors and :

1.2: Basic Assignment Task#2
1.2.1 Deliverables:
You are expected to perform the following tasks and submit a report containing appropriate commands/statements in PL/SQL:


1.2.1.1 Write a PL/SQL block to print information about a given country in the HR schema.
a) Declare a PL/SQL record based on the structure of COUNTRIES table.
:) Use DEFINE command to provide the country ID. Pass the value to PL/SQL block through a substitution variable.
c) Use DBMS_OUTPUT.PUT_LINE to print selected information about the country.


1.2.1.2
a) Create a table topsals with the following structure:
Field No. Field Name Field Type
1. salary NUMBER(8,2)
:) Create a PL/SQL procedure block using cursor that determines the top employees with respect to salaries. Accept a number n from the user where n represents the top n earners from the EMPLOYEES table. For example, to view the top 3 earners, enter 3. (Hint: Use DEFINE command to provide the value for n. Pass the value to the PL/SQL block through a substitution variable.
c) In a loop use the substitution parameter created in 1.2.1.2 (:blink: above and gather the salaries of the top n people form the EMPLOYEES table. There should be no duplication in the salaries. If two employees earn the same salary, the salary should be picked only once.
d) Store the salaries in topsals table.
e) Test the block for a variety of special cases, such as n=0 or where n is greater than the number of employees in the EMPLOYEES table. Empty topsals table after each test.


1.2.1.3 Write a PL/SQL block to select the name of the employee with a given salary value. Create a table MESSAGES with the following structure:
Field No. Field Name Field Type
1. results varchar2(40)
a) Use the DEFINE command to provide the salary.
:( Pass the value to the PL/SQL block through a substitution variable. If the salary entered returns more than one row, handle the exception with an appropriate exception handler and insert into MESSAGES table the message “More than one employee with a salary of <salary>”
c) If the salary entered returns only one row, insert into MESSAGES table the employee’s name and salary amount.
d) Handle any other exception with an appropriate exception handler and insert it into the MESSAGES table with the message “Some other error occurred”
e) Test the block for a variety of test cases. Display the rows from the MESSAGES table to check whether the PL/SQL block has executed successfully. [/size
]