MAP

GENERAL PL/SQL BLOCKS


1)   WAP to input two numbers and find out what is the output of all arithmetic operations. (Addition, Subtraction, Multiplication, Division etc.)

            DECLARE
                        a number(5);
                        b number(5);
            BEGIN
                        a:=&a;
                        b:=&b;
                        dbms_output.put_line('Addition : '|| (a+b));
                        dbms_output.put_line('Substration : '|| (a-b));
                        dbms_output.put_line('Multiplication : '|| (a*b));
                         dbms_output.put_line('Division : '|| (a/b));
            END;
            /
2)   WAP to input rollno and three subject marks. Find out total, percentage, result and grade for the student from the entered data.
3)   WAP to print first 10 odd numbers using for loop.
        DECLARE
               no number(5);
        BEGIN
            for x in 1..10
        loop
            if mod(x,2) !=0 then
                     dbms_output.put_line(x);
            end if;
        end loop;
       end;
4)   WAP to print prime numbers upto 10 using while loop.
5)   WAP to input three nos and find out maximum and minimum from it.
6)   WAP to input empno from keybord. Check whether inputed empno exist in emp table or not. If not give error message otherwise display name and salary of that employee.
7)   WAP to insert record in Customer table.
Customer(cust_id,cust_name,address,city);

0 comments:

Post a Comment

Twitter Delicious Facebook Digg Stumbleupon Favorites More