You are on page 1of 3

DBMS CE-AI(SEM-III) 22012531026

Practical-6
AIM: Study the concepts of different operators, aggregate functions and various joins.

1) Display commission values of without any repetition from Salesman Table.

Query and Output:

2) Write pl/sql code to add 50% salary of ‘Riya’ and 70% salary of ‘Rima’ to salary of ‘Rekha’.
Query and Output:

NAKULVISAVADIA 3AI-3 Page 1 of 3


DBMS CE-AI(SEM-III) 22012531026

3)Write pl/sql code that will accept emp_no and debit amount from user. If balance is below 500/-
whenever you debit the amount then give error message that "Balance below 500/-" otherwise
update the table. Use following table.
Query and Output:

4)Write pl/sql code to change the salary to 6000 if the salary of employee no 1001 is less than 6000.
The salary change is to be recorded in the old_salary table with date on which salary changed. Use
table employee_details & create new table: old_salary (emp_no, previous_salary, change_date).

Query and Output:

NAKULVISAVADIA 3AI-3 Page 2 of 3


DBMS CE-AI(SEM-III) 22012531026

5)Write pl/sql code to find sum of first N natural numbers. Take value of N from user. Write code
using: a) exit loop (basic loop) b) while loop.

Query and Output:

6)Write pl/sql code to find Factorial of a number using: a) label and goto statement b) for loop

Query and Output:

NAKULVISAVADIA 3AI-3 Page 3 of 3

You might also like