Dbms
Dbms
in
Module 3
3.1 MORE COMPLEX SQL QUERIES:
NULL is used to represent a missing value, but that it usually has one of three
different interpretations:
Unknown value: A particular person has a date of birth but it is not known, so it is
represented by NULL in the database.
Unavailable or withheld value: A person has a home phone but does not want it to
be listed, so it is withheld and represented as NULL in the database.
Hence, SQL uses a three-valued logic with values TRUE, FALSE, and UNKNOWN
instead of the standard two-valued logic with values TRUE or FALSE.
Reshma D’Souza & Priyadarshini M, Dept. of CSE, CITech, Bangalore Source : diginotes.in
P a g e | 2 | DBMS Module 3 Source : diginotes.in
Reshma D’Souza & Priyadarshini M, Dept. of CSE, CITech, Bangalore Source : diginotes.in
P a g e | 3 | DBMS Module 3 Source : diginotes.in
Rather than using = or <> to compare an attribute value to NULL, SQL uses IS or IS
NOT key words. Query 18 illustrates this; its result is shown in Figure 8.4d
The first nested query selects the project numbers of projects that have a 'Smith'
involved as manager.
The second selects the project numbers of projects that have a 'Smith' involved as
worker.
In the outer query, we use the OR logical connective to retrieve a PROJECT tuple if
the PNUMBER value of that tuple is in the result of either nested query.
The = ANY (or = SOME) operator returns TRUE if the value v is equal to some value in
the set V and is hence equivalent to IN.
Reshma D’Souza & Priyadarshini M, Dept. of CSE, CITech, Bangalore Source : diginotes.in
P a g e | 4 | DBMS Module 3 Source : diginotes.in
Other operators that can be combined with ANY (or SOME) include >,>=, <, <=, and < >.
Reshma D’Souza & Priyadarshini M, Dept. of CSE, CITech, Bangalore Source : diginotes.in
P a g e | 5 | DBMS Module 3 Source : diginotes.in
The keyword ALL can also be combined with each of these operators. For example, the
comparison condition (v > ALL V) returns TRUE if the value v is greater than all the
values in the set (or multiset) V.
The following query returns the names of employees whose salary is greater
than the salary of all the employees in department 5:
We can understand a correlated query better by considering that the nested query is
evaluated once for each tuple (or combination of tuples) in the outer query.
In general, a query written with nested select-from-where blocks and using the = or IN
comparison operators can always be expressed as a single block query.
Reshma D’Souza & Priyadarshini M, Dept. of CSE, CITech, Bangalore Source : diginotes.in
P a g e | 6 | DBMS Module 3 Source : diginotes.in
Reshma D’Souza & Priyadarshini M, Dept. of CSE, CITech, Bangalore Source : diginotes.in
P a g e | 7 | DBMS Module 3 Source : diginotes.in
We can think of Q16B as follows: For each EMPLOYEE tuple, evaluate the nested
query, which retrieves all DEPENDENT tuples with the same social security number,
sex, and name as the EMPLOYEE tuple; if at least one tuple EXISTS in the result of the
nested query, then select that EMPLOYEE tuple.
EXISTS and NOT EXISTS are usually used in conjunction with a correlated nested query.
In general, EXISTS(Q) returns TRUE if there is at least one tuple in the result of the
nested query Q, and it returns FALSE otherwise.
On theother hand, NOT EXISTS(Q) returns TRUE if there are no tuples in the result of
nested queryQ, and it returns FALSE otherwise.
Reshma D’Souza & Priyadarshini M, Dept. of CSE, CITech, Bangalore Source : diginotes.in
P a g e | 8 | DBMS Module 3 Source : diginotes.in
Reshma D’Souza & Priyadarshini M, Dept. of CSE, CITech, Bangalore Source : diginotes.in
P a g e | 9 | DBMS Module 3 Source : diginotes.in
It is also possible to use an explicit set of values in the WHERE clause, rather than a
nested query. Such a set is enclosed in parentheses in SQL.
In SQL, it is possible to rename any attribute that appears in the result of a query by
adding the qualifier AS followed by the desired new name.
Hence, the AS construct can be used to alias both attribute and relation names, and it
can be used in both the SELECT and FROM clauses.
Q8A shows how query Q8 can be slightly changed to retrieve the last name of each
employee and his or her supervisor, while renaming the resulting attribute names as
EMPLOYEE_NAME and SUPERVISOR_NAME.
The new names will appear as column headers in the query result.
The concept of a joined table (or joined relation) was incorporated into SQL to permit
users to specify a table resulting from a join operation in the FROM clause of a query.
For example, consider query Ql, which retrieves the name and address of every
employee who works for the 'Research' department.
The FROM clause in Q1A contains a single joined table. The attributes of such a table
are all the attributes of the first table, EMPLOYEE, followed by all the attributes of the
Reshma D’Souza & Priyadarshini M, Dept. of CSE, CITech, Bangalore Source : diginotes.in
P a g e | 10 | DBMS Module 3 Source : diginotes.in
second table, DEPARTMENT.
The concept of a joined table also allows the user to specify different types of join,
such as NATURAL JOIN and various types of OUTER JOIN.
Reshma D’Souza & Priyadarshini M, Dept. of CSE, CITech, Bangalore Source : diginotes.in
P a g e | 11 | DBMS Module 3 Source : diginotes.in
If the names of the join attributes are not the same in the base relations, it is possible
to rename the attributes so that they match, and then to apply NATURAL JOIN. In this
case, the AS construct can be used to rename a relation and all its attributes in the
FROM clause.
It is also possible to nest join specifications; that is, one of the tables in a join may
itself be a joined table.
This is illustrated by Q2A, which is a different way of specifying query Q2, using the
concept of a joined table:
SQL has a number of built-in aggregate functions: COUNT, SUM, MAX, MIN, and AVG.
The COUNT function returns the number of tuples or values as specified in a query.
The functions SUM, MAX, MIN, and AVG are applied to a set or multiset of numeric
values and return, respectively, the sum, maximum value, minimum value, and
average (mean) of those values.
The functions MAX and MIN can also be used with attributes that have nonnumeric
domains if the domain values have a total ordering among one another.
Reshma D’Souza & Priyadarshini M, Dept. of CSE, CITech, Bangalore Source : diginotes.in
P a g e | 12 | DBMS Module 3 Source : diginotes.in
Reshma D’Souza & Priyadarshini M, Dept. of CSE, CITech, Bangalore Source : diginotes.in
P a g e | 13 | DBMS Module 3 Source : diginotes.in
Here the asterisk (*) refers to the rows (tuples), so COUNT (*) returns
the number of rows in the result of the query.
We may also use the COUNT function to count values in a column rather than tuples,
as in the following example.
In general, NULL values are discarded when aggregate functions are applied to a
particular column (attribute).
We can specify a correlated nested query with an aggregate function, and then use
the nested query in the WHERE clause of an outer query.
Retrieve the names of all employees who have two or more dependents
Reshma D’Souza & Priyadarshini M, Dept. of CSE, CITech, Bangalore Source : diginotes.in
P a g e | 14 | DBMS Module 3 Source : diginotes.in
For example, we may want to find the average salary of employees in each
department or the number of employees who work on each project.
In these cases we need to partition the relation into non overlapping subsets (or
groups) of tuples.
Each group (partition) will consist of the tuples that have the same value of some
attributes, called the grouping attributets.
The GROUP BY clause specifies the grouping attributes, which should also appear in
the SELECT clause.
In Q24, the EMPLOYEE tuples are partitioned into groups-each group having the
same value for the grouping attribute DNO. The COUNT and AVG functions are applied to
each such group of tuples. Figure 8.6a illustrates how grouping works on Q24.It also
shows the result of Q24.
If NULLs exist in the grouping attribute, then a separate group is created for all
tuples with a NULL value in the grouping attribute. For example, if the EMPLOYEE
table had
Sometimes we want to retrieve the values of these functions only for groups that
Reshma D’Souza & Priyadarshini M, Dept. of CSE, CITech, Bangalore Source : diginotes.in
P a g e | 15 | DBMS Module 3 Source : diginotes.in
satisfy certain conditions.
For example, suppose that we want to modify Query 25 so that only projects with
more than two employees appear in the result.
SQL provides a HAVING clause, which can appear in conjunction with a GROUP BY
clause, for this purpose.
Reshma D’Souza & Priyadarshini M, Dept. of CSE, CITech, Bangalore Source : diginotes.in
P a g e | 16 | DBMS Module 3 Source : diginotes.in
HAVING provides a condition on the group of tuples associated with each value of
the grouping attributes. Only the groups that satisfy the condition are retrieved in
the result ofthe query.
Figure 8.6b illustrates the use of HAVING and displays the result of Q26.
A query in SQL can consist of up to six clauses, but only the first two-SELECT and
FROM-are mandatory. The clauses are specified in the following order, with the
clauses between square brackets [ ... ] being optional:
Reshma D’Souza & Priyadarshini M, Dept. of CSE, CITech, Bangalore Source : diginotes.in
P a g e | 17 | DBMS Module 3 Source : diginotes.in
In general, there are numerous ways to specify the same query in SQL. This flexibility in
specifying queries has advantages and disadvantages.
The main advantage is that users can choose the technique with which they are
most comfortable when specifying a query. For example, many queries may be
specified with join conditions in the WHERE clause, or by using joined relations in
the FROM clause, or with some form of nested queries and the IN comparison
operator.
From the programmer's and the system's point of view regarding query
optimization, it is generally preferable to write a query with as little nesting and
implied ordering as possible.
The disadvantage of having numerous ways of specifying the same query is that
this may confuse the user, who may not know which technique to use to specify
particular types of queries.
Reshma D’Souza & Priyadarshini M, Dept. of CSE, CITech, Bangalore Source : diginotes.in
P a g e | 18 | DBMS Module 3 Source : diginotes.in
For example, to specify the constraint that "the salary of an employee must not be
greater than the salary of the manager of the department that the employee works
Reshma D’Souza & Priyadarshini M, Dept. of CSE, CITech, Bangalore Source : diginotes.in
P a g e | 19 | DBMS Module 3 Source : diginotes.in
Reshma D’Souza & Priyadarshini M, Dept. of CSE, CITech, Bangalore Source : diginotes.in
P a g e | 21 | DBMS Module 3 Source : diginotes.in
Reshma D’Souza & Priyadarshini M, Dept. of CSE, CITech, Bangalore Source : diginotes.in
P a g e | 22 | DBMS Module 3 Source : diginotes.in
If none of the view attributes results from applying Aggregate functions (arithmetic
operations), we do not have to specify attribute names for the view, since they
would be the same as the names of the attributes of the defining tables in the
default case.
The views in V1 and V2 create virtual tables whose schemas are illustrated in Figure
5.2 when applied to the COMPANY database schema of Figure 5.1.
Figure 5.2 Two views V1 and V2 specified on the database schema of Figure
5.1
We did not specify any new attribute names for the view WORKS_ON1;
in this case, WORKS_ON1 inherits the names of the view attributes from
the defining tables EMPLOYEE, PROJECT, and WORKS_ON.
We explicitly specifies new attribute names for the view DEPT_INFO,
using a one-to- one correspondence between the attributes specified in
the CREATE VIEW clause and those specified in the SELECT clause of the
query that defines the view.
We can now specify SQL queries on views V1 and V2 in the same way we specify
queries involving base tables.
Retrieve the last name and first name of all employees who work on
'ProjectX'
QV1: SELECT FNAME, LNAME
FROM WORKS_ON1
WHERE PNAME =
‘ProjectX’ ;
The same query would require the specification of two joins if specified on the base
Reshma D’Souza & Priyadarshini M, Dept. of CSE, CITech, Bangalore Source : diginotes.in
P a g e | 23 | DBMS Module 3 Source : diginotes.in
relations.
One of the main advantages of a view is to simplify the specification of certain
queries. Views are also used as a security and authorization mechanism.
A view is supposed to be always up to date.
If we modify the tuples in the base tables on which the view is defined, the view
must automatically reflect these changes.
Reshma D’Souza & Priyadarshini M, Dept. of CSE, CITech, Bangalore Source : diginotes.in
P a g e | 24 | DBMS Module 3 Source : diginotes.in
It is the responsibility of the DBMS and not the user to make sure that the view is up
to date.
If we do not need a view any more, we can use the DROP VIEW command to dispose
of it.
The disadvantage of this approach is that it is inefficient for views defined via
complex queries that are time-consuming to execute, especially if multiple
queries are applied to the view within a short period of time.
The other strategy, called view materialization, involves physically creating a
temporary view table when the view is first queried and keeping that table on the
assumption that other queries on the view will follow.
In this case, an efficient strategy for automatically updating the view table
when the base tables are updated must be developed in order to keep the
view up to date.
Techniques using the concept of incremental update have been developed for
this purpose, where it is determined what new tuples must be inserted,
deleted, or modified in a materialized view table when a change is applied to
one of the defining base tables.
The materialized view is generally kept as long as it is being queried. If the
view is not queried for a certain period of time, the system may then
automatically remove the physical view table and recompute it from scratch
when future queries reference the view.
Updating of views is complicated and can be ambiguous.
An update on a view defined on a single table without any aggregate
functions can be mapped to an update on the underlying base table under
certain conditions.
Reshma D’Souza & Priyadarshini M, Dept. of CSE, CITech, Bangalore Source : diginotes.in
P a g e | 25 | DBMS Module 3 Source : diginotes.in
For a view involving joins of multiple base tables, an update operation may
be mapped to update operations on the underlying base relations in multiple
ways.
To illustrate potential problems with updating a view defined on multiple tables,
consider the WORKS_ON1 view, and suppose that we issue the command to update
the PNAME attribute of 'John Smith' from 'ProductX' to 'ProductY'. This view update
is shown in UVl:
Reshma D’Souza & Priyadarshini M, Dept. of CSE, CITech, Bangalore Source : diginotes.in
P a g e | 26 | DBMS Module 3 Source : diginotes.in
This query can be mapped into several updates on the base relations to give
the desired update effect on the view. Two possible updates, (a) and (b), on
the base relations corresponding to UV1 are shown here:
A view update is feasible when only one possible update on the base relations can
accomplish the desired update effect on the view.
Whenever an update on the view can be mapped to more than one update on the
underlying base relations, we must have a certain procedure for choosing the
desired update.
In summary, we can make the following observations:
A view with a single defining table is updatable if the view attributes contain
the primary key of the base relation, as well as all attributes with the NOT
NULL constraint that do not have default values specified.
Views defined on multiple tables using joins are generally not updatable.
Views defined using grouping and aggregate functions are not updatable.
Reshma D’Souza & Priyadarshini M, Dept. of CSE, CITech, Bangalore Source : diginotes.in
P a g e | 28 | DBMS Module 3 Source : diginotes.in
For example, the practical relational model has three main constructs:
Attributes and their data types
Tuples (rows) and
Tables (sets or multisets of records).
The first problem that may occur is that the “data types of the programming
language differ from the attribute data types in the data model”.
Hence, it is necessary to have a binding for each host programming language
that specifies for each attribute type the compatible programming language
types. It is necessary to have a binding for each programming language because
different languages have different data types; for example, the data types
available in C and JAVA are different, and both differ from the SQL data types.
Another problem occurs because the “results of most queries are set (distinct
elements) or multisets (duplicated elements) of tuples, and each tuple is
formed of a sequence of attribute values.
In the program, it is often necessary to access the individual data values
within individual tuples for printing or processing.
Hence, a binding is needed to map the query result data structure, which is a
table, to an appropriate data structure in the programming language.
A mechanism is needed to loop over the tuples in a query result in order to
access a single tuple at a time and to extract individual values from the
tuple.
A cursor or iterator variable is used to loop over the tuples in a query result.
Individual values within each tuple are typically extracted into distinct
program variables of the appropriate type.
Reshma D’Souza & Priyadarshini M, Dept. of CSE, CITech, Bangalore Source : diginotes.in
P a g e | 29 | DBMS Module 3 Source : diginotes.in
Shared variables are declared within a declare section in the program, as shown in
Figure 3.4.1 (lines 1 through 7)
Figure 3.4.1: c program variables used in the embedded SQL examples E1 and
E2
A few of the common bindings of C types to SQL types are as follows:
i) The SQL types INTEGER, SMALLINT, REAL, and DOUBLE are mapped to the C
types long, short, float,and double, respectively.
Communicating between the Program and the DBMS Using SQLCODE and SQLSTATE:
SQLCODE and SQLSTATE are used by the DBMS to communicate exception or error
conditions to the application program.
The SQLCODE variable is an integer variable.
After each database command is executed, the DBMS returns a value in SQLCODE:
a) A value of 0 indicates that the statement was executed successfully by the
DBMS.
b) If SQLCODE > 0 (or, more specifically, if SQLCODE = 100), this indicates that no
more data (records) are available in a query result.
c) If SQLCODE < 0, this indicates some error has occurred.
In later versions of the SQL standard, a communication variable called SQLSTATE
was added, which is a string of five characters:
a) A value of "00000" in SQLSTATE indicates no error or exception.
b) Other values indicate various errors or exceptions. For example, "02000"
indicates "no more data" when using SQLSTATE.
Example of Embedded SQL Programming:
Embedded SQL loop that reads a social security number of an employee and
prints out some information from the corresponding EMPLOYEE record in the
Reshma D’Souza & Priyadarshini M, Dept. of CSE, CITech, Bangalore Source : diginotes.in
P a g e | 30 | DBMS Module 3 Source : diginotes.in
database.
Reshma D’Souza & Priyadarshini M, Dept. of CSE, CITech, Bangalore Source : diginotes.in
P a g e | 31 | DBMS Module 3 Source : diginotes.in
Figure 3.4.2: Program segment E1, a c program segment with embedded SQL
The program reads (inputs) a social security number value and then retrieves
the EMPLOYEE tuple with that social security number from the database via the
embedded SQL command.
The INTO clause (line 5) specifies the program variables into which attribute
values from the database are retrieved.
C program variables in the INTO clause are prefixed with a colon (:).
Line 7 in El illustrates the communication between the database and the
program through the special variable SQLCODE.
If the value returned by the DBMS in SQLCODE is 0, the previous statement was
executed without errors or exception conditions.
In El a single tuple is selected by the embedded SQL query; that is why we are
able to assign its attribute values directly to C program variables in the INTO
clause in line 5.
In general, an SQL query can retrieve many tuples. In that case, the C program
will typically go through the retrieved tuples and process them one at a time. A
cursor is used to allow tuple-at-a-time processing by the host language
program. We describe cursors next.
Reshma D’Souza & Priyadarshini M, Dept. of CSE, CITech, Bangalore Source : diginotes.in
P a g e | 32 | DBMS Module 3 Source : diginotes.in
the query result-one tuple at a time.
To determine when all the tuples in the result of the query have been
processed, the communication variable SQLCODE (or, alternatively, SQLSTATE)
is checked.
A CLOSE CURSOR command is issued to indicate that we are done with
processing the result of the query associated with that cursor.
Reshma D’Souza & Priyadarshini M, Dept. of CSE, CITech, Bangalore Source : diginotes.in
P a g e | 33 | DBMS Module 3 Source : diginotes.in
Several options can be specified when declaring a cursor. The general form of a
cursor declaration is as follows:
Ex:
DECLARE sinfo CURSOR FOR
SELECT S.sname,
S.age FROM Sailors
S
WHERE S.rating > :c_minrating;
When we are done with a cursor, we can close it: CLOSE sinfo;
For example, if sinfo is an updatable cursor and open, we can execute the
following statement:
UPDATE Sailors S
SET S.rating = S.rating 1
WHERE CURRENT of
sinfo;
When the optional keyword SCROLL is specified in a cursor declaration, it is
possible to position the cursor in other ways than for purely sequential access.
A fetch orientation can be added to the FETCH command, whose value can be
one of NEXT, PRIOR, FIRST, LAST.
The fetch orientation allows the programmer to move the cursor around the
tuples in the query result with greater flexibility, providing random access by
position or access in reverse order.
If the keyword INSENSITIVE is specified, the cursor behaves as if it is ranging
over a private copy of the collection of answer rows.
The order-item-list is a list of order-items; an order-item is a column name,
optionally followed by one of the keywords ASC or DESC. Every column
mentioned in the ORDER BY clause must also appear in the select-list of the
Reshma D’Souza & Priyadarshini M, Dept. of CSE, CITech, Bangalore Source : diginotes.in
P a g e | 34 | DBMS Module 3 Source : diginotes.in
query associated with the cursor.
Reshma D’Souza & Priyadarshini M, Dept. of CSE, CITech, Bangalore Source : diginotes.in
P a g e | 35 | DBMS Module 3 Source : diginotes.in
a) For example, we may want to write a program that accepts an SQL query
typed from the monitor, executes it, and displays its result, such as the
interactive interfaces available for most relational DBMSs.
b) Another example is when a user-friendly interface generates SQL queries
dynamically for the user based on point-and-click operations.
Reshma D’Souza & Priyadarshini M, Dept. of CSE, CITech, Bangalore Source : diginotes.in
P a g e | 37 | DBMS Module 3 Source : diginotes.in
Stored procedures can also have parameters. These parameters have to be valid
SQL types, and have one of three different modes: IN, OUT, or INOUT.
IN parameters are arguments to the stored procedure. OUT parameters are
returned from the stored procedure; it assigns values to all OUT parameters that
the user can process. INOUT parameters combine the properties of IN and OUT
parameters: They contain values to be passed to the stored procedures, and the
stored procedure can set their values as return values.
Reshma D’Souza & Priyadarshini M, Dept. of CSE, CITech, Bangalore Source : diginotes.in
P a g e | 38 | DBMS Module 3 Source : diginotes.in
Reshma D’Souza & Priyadarshini M, Dept. of CSE, CITech, Bangalore Source : diginotes.in
P a g e | 39 | DBMS Module 3 Source : diginotes.in
The parameters and local declarations are optional, and are specified only if needed.
If the procedure (or function) is written in a general-purpose programming
language, it is typical to specify the language, as well as a file name where the
The CALL statement in the SQL standard can be used to invoke a stored procedure
either from an interactive interface or from embedded SQL or SQLJ. The format of
the statement is as follows:
Reshma D’Souza & Priyadarshini M, Dept. of CSE, CITech, Bangalore Source : diginotes.in
P a g e | 40 | DBMS Module 3 Source : diginotes.in
Reshma D’Souza & Priyadarshini M, Dept. of CSE, CITech, Bangalore Source : diginotes.in
P a g e | 41 | DBMS Module 3 Source : diginotes.in
Consider the example in Figure 3.8, which illustrates how the conditional branch
structure can be used in an SQL/PSM function.
The function returns a string value (line 1) describing the size of a department
based on the number of employees.
There is one IN integer parameter, deptno, which gives a department number.
A local variable NoOfEmps is declared in line 2.
The query in lines 3 and 4 returns the number of employees in the department.
The conditional branch in lines 5 to 8 then returns one of the values {"HUGE",
Initially, data-intensive applications were combined into a single tier, including the
DBMS, application logic, and user interface, as illustrated in Figure 7.5. The application
typically ran on a mainframe, and users accessed it through dumb terminals that could
perform only data input and display. This approach has the benefit of being easily
maintained by a central administrator. The commoditization of the PC and the
availability of cheap client computers led to the development of the two-tier
architecture.
Reshma D’Souza & Priyadarshini M, Dept. of CSE, CITech, Bangalore Source : diginotes.in
P a g e | 42 | DBMS Module 3 Source : diginotes.in
Two-tier architectures, often also referred to as client-server architectures, consist of a
client computer and a server computer, which interact through a well-defined protocol.
In the traditional client server architecture, the client implements just the graphical
user interface, and the server. implements both the business logic and the data
management; such clients are often called thin clients, and this architecture is
illustrated in Figure 7.6.
Reshma D’Souza & Priyadarshini M, Dept. of CSE, CITech, Bangalore Source : diginotes.in
P a g e | 43 | DBMS Module 3 Source : diginotes.in
Presentation Tier:
Users require a natural interface to make requests, provide input, and to see
results. The widespread use of the Internet has made Web-based interfaces
increasingly popular.
At the presentation layer, we need to provide forms through which the user
can issue requests, and display responses that the middle tier generates. Ex: Using
The hypertext markup language (HTML)
Middle Tier:
The application logic executes here. An enterprise-class application reflects
complex business processes, and is coded in a general purpose language such as C++
or Java.
It controls what data needs to be input before an action can be executed,
determines the control flow between multi-action steps, controls access to the
database layer, and often assembles dynamically generated HTML pages from
Reshma D’Souza & Priyadarshini M, Dept. of CSE, CITech, Bangalore Source : diginotes.in
P a g e | 44 | DBMS Module 3 Source : diginotes.in
database query results.
Reshma D’Souza & Priyadarshini M, Dept. of CSE, CITech, Bangalore Source : diginotes.in
P a g e | 45 | DBMS Module 3 Source : diginotes.in
a) Heterogeneous Systems:
Applications can utilize the strengths of different platforms and different
software components at the different tiers. It is easy to modify or replace the
code at any tier without affecting the other tiers.
Note: Go through JDBC, SQLJ and Presentation layer from text book (DBMS by
Raghu Ramakrishna)
Reshma D’Souza & Priyadarshini M, Dept. of CSE, CITech, Bangalore Source : diginotes.in