23itc04 DBMS Laboratory
23itc04 DBMS Laboratory
Program Outcomes
PO1 : Engineering Knowledge: Apply knowledge of mathematics, natural science,
computing, engineering fundamentals and an engineering specialization as specified
in WK1 to WK4 respectively to develop to the solution of complex engineering
problems.
PO2 : Problem Analysis: Identify, formulate, review research literature and analyse
complex engineering problems reaching substantiated conclusions with
consideration for sustainable development. (WK1 to WK4).
PO3 : Design/Development of solutions: Design creative solutions for complex
engineering problems and design/develop systems/components/processes to meet
identified needs with consideration for the public health and safety, whole-life cost,
net zero carbon, culture, society and environment as required. (WK5).
PO4 : Conduct investigations of complex problems: Conduct investigations of complex
engineering problems using research-based knowledge including design of
experiments, modelling, analysis & interpretation of data to provide valid
conclusions. (WK8).
PO5 : Engineering Tool Usage: Create, select and apply appropriate techniques, resources
and modern engineering & IT tools, including prediction and modelling recognizing
their limitations to solve complex engineering problems. (WK2 and WK6).
PO6 : The Engineer and The World: Analyze and evaluate societal and environmental
aspects while solving complex engineering problems for its impact on sustainability
with reference to economy, health, safety, legal framework, culture and environment.
(WK1, WK5, and WK7).
PO7 : Ethics: Apply ethical principles and commit to professional ethics, human values,
diversity and inclusion; adhere to national & international laws. (WK9).
PO8 : Individual and Collaborative Team Work: Function effectively as an individual,
and as a member or leader in diverse/multi-disciplinary teams.
PO9 : Communication: Communicate effectively and inclusively within the engineering
community and society at large, such as being able to comprehend and write
effective reports and design documentation, make effective presentations
considering cultural, language, and learning differences.
PO10 : Project Management and Finance: Apply knowledge and understanding of
engineering management principles and economic decision-making and apply these
to one’s own work, as a member and leader in a team, and to manage projects and in
multidisciplinary environments.
PO11 : Life-long Learning: Recognize the need for, and have the preparation and ability for i)
independent and life-long learning ii) adaptability to new and emerging technologies and iii)
critical thinking in the broadest context of technological change. (WK8).
LIST OF EXPERIMENTS
7 Implementation of Functions
8 Implementation of Triggers
INDEX
Page
[Link] Date Name of the Experiments Marks Signature
No
1 Implementation of Data Definition Language
commands in RDBMS
Implementation of Data manipulation Language
2 and Data control Language commands in
RDBMS
3 Apply Integrity constraints and Domain
constraints for a Database
4 Creation of views, Nested Queries and Join
Queries
5 Study of PL/SQL blocks
6 High level programming language
extensions(Control structures and Procedures)
7 Implementation of Functions
8 Implementation of Triggers
9
AIM:
OBJECTIVES
THEORY
Here, int, varchar(50), and text specify types of data that could be stored in the respective
columns.
CREATE TABLE IF NOT EXISTS
If we try to create a table that already exists, we get an error message ‘Error: table already
exist’.
To fix this issue, we can add the optional IF NOT EXISTS command while creating a table.
Example:
This SQL command creates the new table named CustomersBackup, duplicating the structure of the
Customers table.
Note: When we delete a database, all tables and records within a database are also deleted.
RESULT:
Ex. No : 2
IMPLEMENTATION OF DML AND DCL COMMANDS IN RDBMS
Date :
AIM:
To execute the Data Manipulation Language (DML) commands and DCL statements in RDBMS.
OBJECTIVES
THEORY
DML commands are the most frequently used SQL commands and is used to query and
manipulate the existing database objects. Some of the commands are
INSERT
This is used to add one or more rows to a table. The values are separated by commas and
the data types char and date are enclosed in apostrophes. The values must be entered in the
same order as theyare defined.
SELECT
It is used to retrieve information from the [Link] is generally referred to as querying the
table. We can either display all columns in a table or only specify column from the table.
UPDATE
It is used to alter the column values in a table. A single column may be updated or more
than one column could be updated.
DELETE
After inserting row in a table we can also delete them if required. The delete command
consists of a from clause followed by an optional where clause
.
PROCEDURE
INSERT COMMAND
(a)Inserting a single row into a table:
Syntax:
insert into <table name> values (<expression1>,<expression2>)
Example:
SQL>INSERT INTO EMPLOYEE VALUES(101,'MANU','LECTURER',15000);
23ITC04 / DATABASE MANAGEMENT SYSTEMS LABORATORY– MEC, RASIPURAM
11
SELECT COMMAND
(a).View all rows and all columns
Syntax:
Select * from tablename;
Example:
Select * from Employee;
(a)Selected Columns And All Rows Syntax: Select<column1>,<column2>from tablename;
(b)Selected Columns And selected Rows
Syntax:
SELECT<column1>, <column2> FROM <tablename> WHERE <condition> ;
Example:
Select empno, ename from Employee where job=’LECTURER’;
DELETE COMMAND
(a) removal of specific rows
Syntax:
Delete from <table name> where <condition>;
Example:
delete from Employee where empno=101;
(b) Removal of all rows
Syntax:
Delete from <table name>;
Example:
OBJECTIVES
To understand DCL commands
THEORY:
Data Control Language (DCL) consists of various commands which are related to data sharing
and security of data in database.
They are GRANT REVOKE
Granting Privileges:
Objects that are created by a user are owned and controlled by that user. If user wishes to access
any of the objects belonging to another user, the owner of the object will have to give permissions
for such access. This is called Granting of Privileges.
Granting privileges using the GRANT statements:
The GRANT statements provide various types of access to database objects such as tables, views.
Syntax:
GRANT {object privileges} ON object name
TO username; Object Privileges: each object privilege that is granted authorizes the grantee to
perform some operation on the object. The user can grant all the privileges or grant only
specific object privileges. The list of object privileges is as follows:
• ALTER: allows the grantee to change the table definitions with the ALTER table command.
• DELETE: allows the grantee to remove the records from the table with the DELETE
command.
• INDEX: allows the grantee to create an index on the table with the CREATE INDEX
command.
• INSERT: allows the grantee to add records to the table with the INSERT command.
• SELECT: allows the grantee to query the table with SELECT command.
• UPDATE: allows the grantee to modify the records in the table with the UPDATE
command.
Privileges once given can be denied to a user using the REVOKE command. The object
owner can revoke privileges granted to another user. A user of an object who is not owner,
but has been granted the GRANT privilege, has the power to REVOKE the privileges from
the grantee.
Syntax:
FROM username;
The REVOKE command is used to revoke object privileges that the user previously granted
to the Revoke.
The REVOKE command cannot be used to revoke the privileges granted through operating
system.
RESULT:
The DML commands are executed successfully and Familiarized DCL statements.
AIM:
To implement Domain Constraints and Integrity Constraints .
THEORY:
Constraints are the Rules which are enforced on the data being stored in a table Types of Data
Constraints
1. Integrity Constraint
Integrity Constraints are the protocols that a table's data columns must follow. It is divided into two
different types
The Primary Key Constraint
The Foreign Key Constraint
PROCEDURES
Syntax:
CREATE TABLE tablename
(Columnname1 DATATYPE CONSTRAINT <constraintname1> PRIMARY KEY, Columnname2
DATATYPE, columnname3 DATATYPE, ..... );
Example :
CREATE TABLE Employee (
EmployeeID INT CONSTRAINT PK_sample PRIMARY KEY, FirstName VARCHAR(50),
23ITC04 / DATABASE MANAGEMENT SYSTEMS LABORATORY– MEC, RASIPURAM
16
Syntax:
CREATE TABLE tablename
(Columnname1 DATATYPE, columnname2 DATATYPE, columnname3 DATATYPE, PRIMARY KEY
(columnname1, columnname2));
Example:
CREATE TABLE example_table ( employee_id INT, department_id INT,employee_nameVARCHAR(50),
PRIMARY KEY (employee_id, department_id)
);
Syntax:
CREATE TABLE tablename (
Columnname1 DATATYPE REFERENCES referenced_table(columnname) ON DELETE CASCADE,
columnname2 DATATYPE, columnname3 DATATYPE
);
Example :
CREATE TABLE products ( product_id INT PRIMARY KEY, product_name VARCHAR(50), price
DECIMAL(10, 2)
);
CREATE TABLE orders ( order_id INT PRIMARY KEY, product_id INT,
quantity INT, order_date DATE,
FOREIGN KEY (product_id) REFERENCES products(product_id) ON DELETE CASCADE
);
The table in which FOREIGN KEY is defined is called FOREIGN TABLE or DETAIL TABLE.
The table in which PRIMARY KEY is defined and referenced by FOREIGN KEY is called PRIMARY
TABLE or MASTER TABLE.
ON DELETE CASCADE is set then DELETE operation in master table will trigger the DELETE
operation for corresponding records in the detail table.
A CONSTRAINT can be given User Defined Name, the syntax is: CONSTRAINT < constraint
name><constraint definition>
Example code :
CREATE TABLE tablename2 ( columnname2 INT PRIMARY KEY, data_column VARCHAR(50)
);
CREATE TABLE tablename ( Columnname1 INT, columnname2 INT, columnname3 VARCHAR(50),
23ITC04 / DATABASE MANAGEMENT SYSTEMS LABORATORY– MEC, RASIPURAM
17
Note: The NOT NULL constraint can only be applied at column level.
DEFAULT Constraint
CREATE TABLE tablename (
Columnname1 DATATYPE DEFAULT (logical expression), columnname2 DATATYPE,
columnname3 DATATYPE,
);
Example :
CREATE TABLE estable ( id INT DEFAULT 1,
name VARCHAR(50) DEFAULT 'John Doe',
salary DECIMAL(10, 2)
);
RESULT:
Thus, Domain Constraints and Integrity Constraints were executed successfully.
Ex. No : 4
VIEWS, NESTED QUERIES AND JOIN QUERIES
Date :
AIM :
To implement views, nested queries and join queries.
THEORY:
SQL View
A view in SQL is a logical subset of data from one or more tables. View is used to restrict data
access.
Syntax of displaying a view is similar to fetching data from table using Select statement.
Syntax:
SELECT * from view_name;
Types of View
There are two types of view,
Simple View
Complex View
Example :
Example :
Insert into sam (empno,ename) values(110,'mec');
DELETE STATEMENT SYNTAX:
SQL> DELETE <VIEW_NMAE>WHERE <COLUMN NMAE> =’VALUE’;
Example :
UPDATE STATEMENT:
A view can be updated under certain conditions:
The SELECT clause may not contain the keyword
DISTINCT. The SELECT clause may not contain summary
functions.
The SELECT clause may not contain set functions.
The SELECT clause may not contain set operators.
The SELECT clause may not contain an ORDER BY
clause. The FROM clause may not contain multiple
tables. The WHERE clause may not contain subqueries.
The query may not contain GROUP BY or
HAVING. Calculated columns may not be
updated.
All NOT NULL columns from the base table must be included in the view in
order for the INSERT queryto function.
DROP A VIEW:
Obviously, where you have a view, you need a wayto drop the view if it is no longer needed.
SYNTAX:
SQL> DROP VIEW <VIEW_NAME>
Example :
SOLUTION:
CREATE A VIEW WITH SELECTED FIELDS:
CREATE TABLE Employee (EmpNO number(10),Ename Varchar(15),Job char(10),Deptno number(10));
INSERT INTO EMPLOYEE VALUES(101,'MANU','LECTURER',15000);
CREATE or REPLACE view sample AS SELECT empno,Ename FROM Employee; select * from sample;
UPDATE STATEMENT:
CREATE or REPLACE force view sam AS SELECT empNO,Ename FROM Employee; UPDATE sam set
empno = 105 WHERE ename = 'MANU';
select * from sam; select * from employee;
NESTED QUERIES
A nested query is a query that appears inside another query, and it helps retrieve data from multiple tables or
apply conditions based on the results of another query.
Q1: Display all employee names and salary whose salary is greater than minimum salary of the company and
job title starts with A.
1. Use select from clause.
2. Use like operator to match job and in select clause to get the result. Ans: SQL>
CREATE TABLE employees ( employee_id INT PRIMARY KEY, employee_name VARCHAR(255), salary
DECIMAL(10, 2),
job_title VARCHAR(100)
);
Q2: Issue a query to find all the employees who work in the same job as John Doe:
SQL>
SELECT * FROM employees
WHERE job_title = (SELECT job_title FROM employees WHERE employee_name = 'John Doe');
23ITC04 / DATABASE MANAGEMENT SYSTEMS LABORATORY– MEC, RASIPURAM
21
JOIN QUERIES:
A JOIN clause is used to combine rows from two or more tables, based on a related column between
them.
SYNTAX:
SELECT table1.column1,table1.column2,table2.column1,....
FROM table1
INNER JOIN table2
ON table1.matching_column = table2.matching_column;
Example:
Result:
Thus views, nested queries and join queries were implemented Successfully.
Ex. No : 5
STUDY OF PL/SQL BLOCK
Date :
AIM :
To study PL/SQL Block.
THEORY:
PLSQL stands for "Procedural Language extensions to SQL", and can be used in Oracle
databases. PLSQL is closely integrated into the SQL language, yet it adds programming
constructs that are not native to SQL.
Advantages of PL/SQL
1. PL/SQL supports not only SQL data manipulation but also provides facilities of
conditional checking, branching and looping.
2. PL/SQL sends an entire block of statements to the Oracle engine at one time.
3. PL/SQL permits dealing with errors and displaying user friendly messages when the
error occurs.
4. Via PL/SQL all sorts of calculations can be done quickly without the use of
Oracle Engine
5. Applications written in PL/SQL are portable to any computer hardware and
operating system where Oracle is operational.
The different sections of PL/SQL block are as follows:
DECLARE SECTION
Declarations of memory variables, constants, cursors etc in PL/SQL
BEGIN
SQL executable statements PL/SQL
executable statements
EXCEPTION
SQL or PL/SQL code to handle errors that may arise during the execution of the code
blockStudyof PL/SQL block
23ITC04 / DATABASE MANAGEMENT SYSTEMS LABORATORY– MEC, RASIPURAM
23
In addition to SQL commands, PL/SQL can also process data using flow of statements.
The flow of control statements are classified into the following categories.
• Conditional control -Branching
• Iterative control - looping
• Sequential control
BRANCHING in PL/SQL:
Sequence of statements can be executed on satisfying certain
condition . If statements are being used and different forms of if are:
[Link]
IF
[Link]
3. ELSE IF
SELECTION IN PL/SQL(Sequential Controls)
SIMPLE CASE
Syntax:
CASE SELECTOR
WHEN Expr1 THEN statement1; WHEN Expr2 THEN statement2; ELSE
Statement n;
END CASE;
EXAMPLE :
DECLARE
day_of_week VARCHAR2(10) := 'Monday'; statement VARCHAR2(50);
BEGIN
CASE day_of_week WHEN 'Monday' THEN
statement := 'It''s the start of the week.';
WHEN 'Wednesday' THEN
statement := 'Halfway through the week!';
WHEN 'Friday' THEN
statement := 'TGIF! It''s Friday!'; ELSE
statement := 'It''s a regular day.'; END CASE;
DBMS_OUTPUT.PUT_LINE(statement); END;
ITERATIONS IN PL/SQL
Sequence of statements can be executed any number of times using loop construct. It is broadly
classified into:
• Simple Loop
• For Loop
• While Loop
SIMPLE LOOP
Syntax:
LOOP
statement1;
EXIT [ WHEN Condition]; END LOOP;
EXAMPLE :
DECLARE
counter NUMBER := 1; BEGIN
LOOP
DBMS_OUTPUT.PUT_LINE('Iteration ' || counter); counter := counter + 1;
EXIT WHEN counter > 5; END LOOP;
END;
WHILE LOOP
Syntax
WHILE condition LOOP statement1;
statement2; END LOOP; EXAMPLE :
DECLARE
counter NUMBER := 1; BEGIN
WHILE counter <= 5 LOOP DBMS_OUTPUT.PUT_LINE('Iteration ' || counter); counter :=
counter + 1;
END LOOP; END;
FOR LOOP
Syntax:
FOR counter IN [REVERSE] LowerBound..UpperBound LOOP
statement1; statement2; END LOOP; EXAMPLE :
DECLARE
loop_counter NUMBER; BEGIN
FOR loop_counter IN 1..5 LOOP
DBMS_OUTPUT.PUT_LINE('Number: ' || loop_counter); END LOOP;
END;
Result:
AIM:
To Implement Procedures
THEORY:
Procedure is a subprogram used to perform a specific action. A subprogram is a named
block of PL/SQL. There are two types of subprograms in PL/SQL namely Procedures and
Functions. Every subprogram will have a declarative part, an executable part or body, and an
exception handling part, which is optional. Declarative part contains variable declarations.
Body of a subprogram contains executable statements of SQL and PL/SQL. Statements to
handle exceptions are written in exception part.
Procedure specification begins with CREATE and ends with procedure name or parameters
list. Procedures that do not take parameters are written without a parenthesis. The body of the
procedure starts after the keyword IS or AS and ends with keyword END.
Syntax for Procedure:
CREATE [OR REPLACE] PROCEDURE procedure_name [(parameter_name [IN | OUT | IN
OUT] type [, ...])] {IS | AS} BEGIN
procedure_body EXCEPTION
Exception handling END procedure_name;
Procedure is created using CREATE PROCEDURE statement.
OR REPLACE specifies the procedure is to replace an existing procedure if present. One can
use this option to modify an existing procedure.
A procedure may be passed multiple parameters. IN | OUT | IN OUT specifies the mode of the
parameter. Type specifies the datatype of the parameter.
IN - The parameter can be referenced by the procedure or function. The value of the parameter
cannot be overwritten by the procedure or function.
23ITC04 / DATABASE MANAGEMENT SYSTEMS LABORATORY– MEC, RASIPURAM
26
OUT - The parameter cannot be referenced by the procedure or function, but the value of the
parameter can be overwritten by the procedure or function.
IN OUT - The parameter can be referenced by the procedure or function and the value of the
parameter can be overwritten by the procedure or function.
Procedure body contains the SQL and PL/SQL statements to perform the procedure's task.
Exception Section:
The Exception section of a PL/SQL Block starts with the reserved keyword EXCPTION. This
section is optional. Any errors in the program can be handled in this section, so that the
PL/SQL Blocks terminates gracefully. If the PL/SQL Block contains exceptions that cannot be
handled, the Block terminates abruptly with errors.
Advantages:
When client executes a procedure or a function, the processing is done in the server. Server is
likely to me more powerful than the clients which in turn mean that stored procedures should
run faster. This reduces network traffic.
As the procedures/functions are stored in the Oracle database there is no need to transfer the
code from the clients to the database server or to transfer intermediate results from the server to
the clients. This results in much less network traffic and again improves scalability
The subprograms are compiled and stored in the Oracle database as stored programs and can be
invoked whenever required. As they are stored in compiled form when called, they only need
to be executed. Hence they save time needed for compilation. They allow breaking the
program into manageable modules. They provide reusability and maintainability for the code.
Disadvantages:
There is an overhead involved in embedding or calling PL/SQL procedures from SQL in
Oracle due to the context switching that the Oracle database has to perform. This may be
significant in terms of performance but usually this overhead is outweighed by performance
advantages of using PL/SQL.
More memory may be required on the Oracle database server when using Oracle PL/SQL
packages as the whole package is loaded into memory as soon as any object in the package is
accessed
PROCEDURE TO INSERT NUMBER
SQL> create table emp1(id number(3),First_name varchar2(20)); Table created.
SQL> insert into emp1 values(101,'Nithya'); 1 row created.
SQL> insert into emp1 values(102,'Maya'); 1 row created.
SQL> select * from emp1;
ID FIRST_NAME
------------------------
101 Nithya
102 Maya
Result:
High level programming language extensions such as Control structures and Procedures were implemented
Successfully.
Ex. No : 7
IMPLEMENTATION OF FUNCTIONS
Date :
AIM :
To Implement Function
THEORY :
A function is a named PL/SQL Block which is similar to a procedure. The major difference between a
procedure and a function is, a function must always return a value, but a procedure may or may not return a
value.
Syntax for Function:
CREATE OR REPLACE FUNCTION function_name ( parameter1 datatype1,
parameter2 datatype2,
-- add more parameters as needed
) RETURN return_datatype IS
-- Declaration section variable1 datatype1; variable2 datatype2;
-- add more variables as needed
BEGIN
-- Execution section
-- Your logic here
-- Set values to variables, perform calculations, etc.
-- Return statement RETURN return_variable;
EXCEPTION
-- Exception section
RETURN default_value; END function_name;
Return Type: The header section defines the return type of the function. The return datatype can be any of
the oracle datatype like varchar, number etc.
The execution and exception section both should return a value which is of the datatype defined in the
header section.
Result
Thus the functions were implemented successfully.
Ex. No : 8
IMPLEMENTATION OF TRIGGERES
Date :
Aim :
To implement of triggers
RESULT:
Thus the triggers were implemented successfully.
Ex. No : 9
DESIGN AND IMPLEMENTATION OF BANKING SYSTEM
Date :
AIM:
To design and implement banking System
STEPS:
1. Create the DB for banking system source request the using SQL
[Link] ODBC connection
3. Click add button and select oracle in ORA home 90 click finished
[Link] will appear give the data source name as oracle and give the user id as scott
5. Now click the test connection a window will appear with server and user name give user as scott and
password tiger Click ok.
[Link] Basic Application:-
Create Standard exe project in to and design ms from in request format.
To add ADODC Project Select Component and check ms ADO data control click ok.
Now the Control is added in the tool book.
Create Standard exe project in to.
[Link] CONTEOL FOR ACCOUNT FROM:- Click customs and property window and window will
appear and select ODBC data source name as oracle and click apply as the some window
CREATE A TABLE IN ORACLE
SQL>create table account(cname varchar(20),accno number(10),balance number);
Table Created
SQL> insert into account values('&cname',&accno,&balance);
Enter value for cname: Mathi
Enter value for accno: 1234 Enter value for balance: 10000
old 1: insert into account values('&cname',&accno,&balance)
new 1: insert into emp values('Mathi',1234,10000) 1 row created.
SOURCE CODE FOR FORM1
23ITC04 / DATABASE MANAGEMENT SYSTEMS LABORATORY– MEC, RASIPURAM
30
TRANSACTION_Click()
[Link] End Sub
SOURCE CODE FOR FORM 2
Private Sub CLEAR_Click() [Link] = ""
[Link] = "" [Link] = "" End Sub
Private Sub DELETE_Click()
[Link] MsgBox "record deleted" [Link] If
[Link] = True Then [Link]
End If End Sub
Private Sub EXIT_Click() Unload Me
End Sub
Private Sub HOME_Click() [Link] End Sub
Private Sub
OUTPUT:
Result:
Thus the banking system was designed and implemented successfully.
AIM:
To design and implement Student Information System.
STEPS:
1. Create a database for library which request the using SQL
4. Click add button and select oracle in ORA home 90, click finish
5. A window will appear given the data source home as oracle and select TNS source name as lion and give
the used id as SWTT
7. The above procedure must be follow except the table , A select the table as library
8. Write appropriate Program in form each from created in VB from each from created in VB form project.
i. ADMINISTRATOR Table
This table holds the profile information of the application super users otherwise known as system
administrators. They have control of the software meaning that they can perform additional tasks that other
23ITC04 / DATABASE MANAGEMENT SYSTEMS LABORATORY– MEC, RASIPURAM
32
users cannot ordinarily perform. Every software of this nature has such users and this one is no exception.
The table contains the following columns; ADMIN_ID, TITLE, FRIST_NAME, LAST_NAME, and
DEPARMENT_ID.
The column ADMIN_ID is the primary key column (primary key disallows duplicate values and nulls in a
column) every table should have a primary key column, as this acts like table indexing.
ii. ALL_COURSE Table
This table keeps the courses offered by students in different departments in the school. The table contains
the following columns; COURSE_ID, COURSE_TITLE, and COURSE_CODE. The COURSE_ID is the
primary key column.
iii. APP_USER_A Table
This table contains application login details for application administrators. The table columns are;
USRNAME, PASSWD and ADMIN_ID. The column ADMIN_ID is the primary key
column.
iv. APP_USER_L Table
This table contains application login details for application lecturers. The table columns are; USRNAME,
PASSWD and LECTURER_ID. The column LECTURER_ID is the primary key column.
v. APP_USER_S Table
This table holds information about the schools departments. The table contains the following columns;
DEPARTMENT_ID and DEPARTMENT_NAME. The column DEPARTMENT_ID is the primary key
column.
vii. GRADES Table
This is more like the main table in the database as all other tables relate to this table directly or in some
other way. This table holds students examination records. The table contains the following columns;
GRADES_ID, SESSION1, REG_NUMBER, DEPARTMENT_ID, LEVEL1,
MATRIG_NO,FRIST_NAME,LAST_NAME,COURSE_CODE,GRADE,CREDIT_UNIT,
SCORE, LECTURER_ID and GRADE_POINT. The column GRADES_ID is the primary key column.
viii. LECTURERS Table
This table holds the profile information of the application lecturers. The table contains the following
columns; LECTURER_ID, TITLE, FRIST_NAME, LAST_NAME, and DEPARMENT_ID. The column
LECTUTER_ID is the primary key column.
ix. REG_TABLE Table
This table contains student‟s registration details i.e. if a student is registered for the semester this table is
used to store that information. The table contains the following columns; REG_ID, REG_NUMBER,
MATRIG_NO, FRIST_NAME,LAST_NAME,
LEVEL1, DEPARTMENT_ID and SESSION1. The column REG_ID is the primary key column.
x. STUDENTS Table
This table holds the profile information of the application students. The table contains the following
columns; MATRIG_NO, TITLE, FRIST_NAME, LAST_NAME, and
RESULT:
Thus the student information system was designed and implemented successfully.
AIM:
To Design the database and implement Pay Roll Processing
STEPS:
Create a database for payroll processing which request the using SQL
Establish ODBC connection
In the administrator tools open data source ODBC
Click add button and select oracle in ORA home 90, click finish
A window will appear given the data source home as oracle and select TNS source name as lion and give
the used id as SWTT
ADODC CONTROL FOR SALARY FORM:-
The above procedure must be follow except the table , A select the table as salary
Write appropriate Program in form each from created in VB from each from created in VB form project.
Table created.
TRIGGER to calculate DA,HRA,PF,MC SQL>
create or replace trigger employ 2 after insert on salary
3 declare
4 cursor cur is select eno,basic from salary;
5 begin
6 for cur1 in cur loop
7 update salary set
8 hra=basic*0.1,da=basic*0.07,pf=basic*0.05,mc=basic*0.03 where hra=0; 9 end loop;
10 end;
11 / Trigger created.
OUTPUT:
RESULT:
Thus payroll system was designed and implemented successfully.