5th Se 15 Algorithms
5th Se 15 Algorithms
AIM:
1. Create a table for Department with the following attributes.
Dept_No number(2)PK
Dept_Name varchar2(20) not null
2. Create a table for Student with the followingattributes.
Regno varchar2(10)PK
Name varchar2(15) not null
DOB Date
Class varchar2(10)
Dept_No number(2) FK
College_Name varchar2(20) Default ‘Government Arts College’
City varchar2(15)
3. Create a table for Attendance with the following attributes.
Regno varchar2(7) FK
Attendance_Percentage number(3)
4. Display the physical table structure of Department, Student,Attendance.
5. Write a query to add an column Age number(2) to the table Student with
a constraints of accepting Age>=17 &<=22.
6. Write a query to rename the column name Regno to Rollno from the table
of Student.
7. Write a query to remove the column name Class from Student.
8. Write a query to truncate the table Attendance.
ALGORITHM:
1) Start---All Programs-----Select Oracle Database 10g Express
Edition-------Go to Database Homepage.
2) Enter Username and Password as system.
3) Select SQL to type the SQL statements required.
4) Create tables Department, Student and Attendance as stated.
5) View all the tables using describe commands.
6) Apply DDL commands ( Alter,Rename,Drop,Truncate) to the existing
tables and view to the results
2. SQL QUERIES USING DML COMMANDS
AIM:
ALGORITHM:
ALGORITHM:
ALGORITHM :
ALGORITHM:
AIM:
ALGORITHM:
1. Start---All Programs-----Select Oracle Database 10g Express Edition------Go
to Database Homepage.
2. Enter Username and Password as system.
3. Select SQL to type the SQL statements required.
4. Create tables Employee, Employee1, Employee2, as stated.
5. Insert into the values of Employee, Employee1, Employee2 according to the
Field has given.
6. Implement the Arithmetic, Logical and Comparison Operators on Employee
table and view the results.
7. Apply the Set and Like operators on Employee1 and Employee2 tables and
view the results.
8. Implement Inner, Left Outer, Right Outer and Full Outer Join Operators on
Employee, Employee1 and Employee2 tables and view the results.
1. Write a query to return the records that matches your SELECT query on
Employee table.
2. Write a query to use a comparison operator in a Group by and HAVING
clause in Employee table.
3. Write a query to return more than one row to the outer statement using IN
clause on Employee1 and Employee2 table.
4. Write a query to compare inner query with multiple columns values of the
outer query on Employee1 and Employee2 table.
ALGORITHM:
AIM:
AIM:
Write a PL/SQL program to declare variables and display the appropriate
value of variable using %ROWTYPE attribute
ALGORITHM:
AIM:
ALGORITHM:
AIM:
ALGORITHM:
ALGORITHM:
AIM:
ALGORITHM:
AIM:
ALGORITHM:
3. Create table Procedure to and Create a new table and it's fields using
4.Select Data and store to new table using where Condition from the
Employee table.
AIM:
Write a PL/SQL program using functions.
ALGORITHM: