DBMS Unit 3
DBMS Unit 3
RELATIONAL ALGEBRA:
The relational is a procedural query language. It consists of a set of operations that take one or two relations
(tables) as input and produce a new relation, on the request of the user to retrieve the specific information, as
the output (result).
It gives a step by step process to obtain the result of the query. It uses operators to perform queries.
The relational algebra contains the following operations:
1) Selection
2) projection
3) union
4) Rename
5)Difference
6) Cartesian product
7)Intersection
.
The selection, projection and rename operations are called unary operations because they operate only on
one relation.
The other operations operate on pairs of relations and are therefore called binary operations.
1. Select Operation:
1. Notation: σ p(r)
Where:
p is used as a propositional logic formula which may use connectors like: AND OR and NOT. These
relational can use as relational operators like =, ≠, ≥, <, >, ≤.
For example: LOAN Relation
Output:
2. Project Operation:
3. This operation shows the list of those attributes that we wish to appear in the result. Rest of the attributes
are eliminated from the table.
o It is denoted by ∏.
Output:
NAME CITY
Jones Harrison
Smith Rye
Hays Harrison
Curry Rye
Johnson Brooklyn
Brooks Brooklyn
3. Union Operation:
o Suppose there are two tuples R and S. The union operation contains all the tuples that are either in R
or S or both in R & S.
o It eliminates the duplicate tuples. It is denoted by ∪.
1. Notation: R ∪ S
Example:
DEPOSITOR RELATION
CUSTOMER_NAME ACCOUNT_NO
Johnson A-101
Smith A-121
Mayes A-321
Turner A-176
Johnson A-273
Jones A-472
Lindsay A-284
BORROW RELATION
CUSTOMER_NAME LOAN_NO
Jones L-17
Smith L-23
Hayes L-15
Jackson L-14
Curry L-93
Smith L-11
Williams L-17
Input:
Output:
CUSTOMER_NAME
Johnson
Smith
Hayes
Turner
Jones
Lindsay
Jackson
Curry
Williams
Mayes
4. Set Intersection:
o Suppose there are two tuples R and S. The set intersection operation contains all tuples that are in
both R & S.
o It is denoted by intersection ∩.
1. Notation: R ∩ S
Output:
CUSTOMER_NAME
Smith
Jones
5. Set Difference:
o Suppose there are two tuples R and S. The set intersection operation contains all tuples that are in R but
not in S.
o It is denoted by intersection minus (-).
1. Notation: R - S
Output:
CUSTOMER_NAME
Jackson
Hayes
Willians
Curry
6. Cartesian product
o The Cartesian product is used to combine each row in one table with each row in the other table. It is
also known as a cross product.
o It is denoted by X.
1. Notation: E X D
Example:
EMPLOYEE
1 Smith A
2 Harry C
3 John B
DEPARTMENT
DEPT_NO DEPT_NAME
A Marketing
B Sales
C Legal
Input:
1. EMPLOYEE X DEPARTMENT
Output:
1 Smith A A Marketing
1 Smith A B Sales
1 Smith A C Legal
2 Harry C A Marketing
2 Harry C B Sales
2 Harry C C Legal
3 John B A Marketing
3 John B B Sales
3 John B C Legal
7. Rename Operation:
The rename operation is used to rename the output relation. It is denoted by rho (ρ).
Example: We can use the rename operator to rename STUDENT relation to STUDENT1.
1. ρ(STUDENT1, STUDENT)
SQL JOINS:
Join is a query in which data is retrieved from two or more tables. A join matches from two or more tables,
based on the value of one or more columns in each table.
The join is denoted by join symbol It is a relational algebra operation which is used to combine
(join) two relations like Cartesian-product but finally removes duplicate attributes and makes the selection,
projection operation. The join operations are 3 types.
1) Inner join
1) Natural join
2) Outer join
Inner join: inner join returns the matching rows from the table that are being joined
Natural join or Equi-join: Natural Join is a type of Inner join which is based on column having same name
and same datatype present in both the tables to be joined. The Natural join is a binary operation that allows
us to combine two different relations into one relation and makes the same column in two different relations
into only one-column in the resulting relation. Suppose we have relations with following schemas that
explained for natural join and for equi-join.
Customer table
Cust_id Cust_name Address City state postal_code
101 Ramesh Market center Ongole A.P 523001
102 Avinash Ram nagar Ongole A.P 523002
103 Sunil Gandh nagar Ongole A.P 523003
104 Vasanthi Anjaiah road Ongole A.P 523003
105 Krishna Mm road Ongole A.P 523003
Order table
Order_id Order_date Product_name Qty Cust_id
1001 ‟21-Apr-08‟ Xxx 5 101
1002 ‟22-Apr-08‟ Yyy 2 103
1003 „25-May-08‟ Zzz 8 101
1004 „27-May-08‟ Aaa 7 106
1005 „27-May-08‟ Bbb 3 104
A join in which the joining the condition is based on equality between values in common columns.
Common columns appear in the result table. For example, „Customer‟ and „Order‟ tables are using to apply
equi-join operation for retrieving the related rows.
SQL> SELECT CUST_ID, CUST_NAME, ADDRESS, ORDER_ID, ORDER_NAME, ORDER_DATE,
Product_NAME, qty FROM CUSTOMER, ORDER WHERE CUSTOMER.CUST_ID =
ORDER.CUST_ID;
SQL> SELECT * FROM EMP NATURAL JOIN DEPT ;
OUTER-JOIN: When tables are joined using inner join, rows which contains matching values in the join
predicate are returned. Sometimes you may want both matching and non matching rows returned for the
table are being joined. This kind of operation is known as an outer join.
An outer join is an extended from of the inner join. In this the rows in onw table having no matching rows in
the other table will also appear in the result table with nulls.
Types of outer join: 1) Left Outer-join. 2) Right Outer-join 3) Full Outer-join
LEFT OUTER JOIN : It displays all rows from left side table (i.e CUSTOMER table) and
non-matching values of right side table are not added but displays with null values. (i.e ORDER table).
RIGHT OUTER JOIN : It displays all rows from right side table (i.e ORDER table) and
matching values from left side table (i.e CUSTOMER table) and non-matching values of left side table are
not added but displays with null values.
FULL OUTER JOIN : It displays all rows when there is a match in either left or right table.Query:
Ex:A B1 A/B1
B2 A/B2
Tuple Relational Calculus (TRC): The tuple relational calculus is a non-procedural qery language because
it vies the desired information without showing procedure about how they should be computed.
A query in tuple relational calculus is expressed as {T|p(T)}
where, T tuple variable, p(T) „p‟ is a condition or formula that is true for „t‟
In addition to that we use,
T[A] to denote the value of tuple t on attribute A and
t є r to denote that tuple t is in relation r.
Syntax of TRC Queries:
Let „rel‟ be a relation name, „R‟ and „S‟ be tuple variables, „a‟ is an attribute of R. „b‟ is an attribute of S.
Let „op‟ denote an operator in the set. { < , > , = , >= , <= , ≠ }
Then, an atomic formula is one of the following.
Semantics of TRC Queries : The TRC query { T|p(T) } is the set of all tuples „t‟ for which the formula p(T)
evaluates to true with variable T assigned the tuple value t. To complete this definition, we must state which
assignments of tuple values to the free variables in a formula make the formula evaluates to true.
A query is evaluated on a given instance of the database. Let each free variable in a formula F be
bound to a tuple value. For the given assignment of tuples to variables, with respect to the given database
instance, F evaluates to true if one of the following condition is true.
1) F is an atomic formula R є Rel and R is assigned a tuple in the instance of relation Rel.
2) F is a comparision R.a op S.b, R.a op constant, or constant op R.a and the tuples assigned to R and S
have filed values R.a and S.b that make the comparison true.
3) F is of the form ¬p and p is not true, or of the form p ^ q and both p and q are true, or of the form p v q
and one of them is true, or of the form p ==> q and q is true whenever p is true.
4) F is of the form ЭR (p(R ) and there is some assignment of tuples to the free variables in p(R ), including
the variable R, that makes the formula p(R ) true.
5) F is of the form ) V R(p(R)) and there is some assignment of tupes to the free variables in p(R ) that
makes the formula p(R ) true no matter what tuple is assigned R.
Domain Relational Calculus (DRC): A domain variable that comes in the range of the values of domain
(data types) of some columns (attributes).
Syntax of DRC Queries: Let „op‟ denote an operator in the set { < , > , = , >= , <= , ≠ } and let x and y be
domain variables.
An atomic formula in DRC is one of the following,
1) < x1 , x2, x3,..........xn > є Rel, where Rel is a relation with n attributes, each xi , 1 ≤ i ≤ n is either a variable
or a constant.
2) x op y
3) x op constant, or constant op x:
A formula is recursively defined to be one of the following, where p and q are themselves formulas
and each p(x) denotes a formula in which the variable x appears.
1) any atomic
formula,
2) ¬p, p ^ q, p v q or p ==> q
3) Э R (p(x)), where x is domain variable,
4) V R(p(x)), where x is a domain variable.
The reader can remember these formulas very easily by comparing them with TRC formulas and see
how closely these two formulas correspond.
SCHEMA DEFINITIONS IN SQL:
The schema is collection of related objects which are created by user with create command such as
tables, views, domains, constraints, character sets, triggers, roles etc., In simple way, schema is nothing but
plan how to store the data on secondary storage device and how to extract the from secondary storage
device.
SQL Commands are used to define the definition to Schema by using DDL commands,
Data Definition Language Commands (DDL) : The DDL Commands are used to define database table in
schema. It includes create, alter, drop the tables and establishing constraints. These commands are restricted
to production version database.
CREATING THE TABLES: The tables are created in SQL by CREATE command. The CREATE
command is used to create a table with column_names. The column_name are called variables or field
names. To create a table, must follow the below steps.
1. Identify the appropriate data type, including length, precision, and scale for each attribute if required.
2. Identify the columns that should accept null values.
3. Identify the columns that need to be unique.
4. Identify the primary key and foreign key for attributes.
5. Determine the values to be inserted in any column for which a default value is specified.
6. Identify any column for which domain specifications may be stated. Eg: CHECK
Create index using existed table.
Syntax: CREATE TABLE table_name(column_name1 data type1 [<constraint_type
attribute_ name>], column_name2 data type2 [<constraint_type attribute_ name>]
[CONSTRAINT constraint_name] );
The table_name is name of table to store the data in secondary memory.
The column_name is name of filed name, used to store the data.
The data type is used to define column_name to store related data. The data types are number(),
char(), varchar2() and date.
The constraint_types are used with column_name to specify the constraint type. They are i) PRIMARY
KEY, ii)FOREIN KEY, iii) UNIQUE KEY iv) REFERENCE v)NOT NULL vi) CHECK.
Performing the operations on table definitions: Once the table is created, the user can perform operations
on table. They are adding the coulmn_names, change the size of column_name, and can remove the
column_name and table. These operations are done by using ALTER command, DESC command, DROP
command etc.
ALTER command: The ALTER command is used to change the definition of a table.
ADD
Syntax: ALTER TABLE table name MODIFY (column_name data type(size));
DROP
RENAME
ADD clause : The ADD is a keyword, used to add a column_name and/or constraints to an existing table.
Syntax : ALTER TABLE table_name ADD(new column_name data type);
Eg: ALTER TABLE student ADD(date_of_join date);
MODIFY clause : The MODIFY is a keyword, used to modify the definition of an existing column_name.
The MODIFY keyword in the ALTER command cannot make following three changes. They are
i) can not change the specification of column_name from NULL to NOT NULL when column_name
containing nulls.
ii)can not decrease the size of a column_name (or) data type when column_name contain a data.
iii)can not define constraints on a column_name except NULL/NOT NULL.
DESC command : This command is used to display the definition of an existed table. I.e., it will display
the structure of specified table.
Syntax : DESC table_name; Eg: DESC student;
DROP command: This command is used to delete the table name from the secondary memory.
Syntax : DROP TABLE table_name; Eg: DROP TABLE student;
RENAME command: This command is used to change the name of the table definition.
Syntax : RENAME old name TO new name;
Eg : RENAME student TO student_table;
QUERIES , TRIGGERS & CONSTRAINTS:
Introduction to SQL: SQL stands for Structured Query Language. It is the most widely used commercial
relational database language. There are numerous versions of SQL. The original SQL version was developed
at IBM‟s San Jose Research Laboratory, California in 1970. This was originally called as Sequel Language
of system R project in the early 1970‟s. The sequel was renamed as SQL during the years 1974 to 1979. The
SQL is a combination of relational algebra and relational calculus. This was a run under the DOS operating
system in 1981. The SQL language was announced as the MVS version, called DB2 in 1983.
In 1986, the ANSI/ISO published a SQL standard, called SQL-86. IBM published its own corporate
SQL standard, called the System Application Architecture database interface (SAA-SQL) in 1987. An
extended standard of SQL was published in 1989 by ANSI/ISO. The Next versions of ANSI/ISO are SQL-
92,SQL-94,SQL-96, and SQL-99. Some Other Organizations developed Relational Data Base Software‟s,
called INGRES, SYBASE etc.
In the DBMS, SQL can create the tables, translate user requests, maintain the data dictionary,
maintain the system catalog, update and maintain the tables, establish security and carry out backup and
recovery procedures.
SQL Benefits or Advantages : The benefits of relational language include the following. They are
1. Reduced training costs: This reduces the training costs in organization.
2. Productivity: The user can learn SQL language thoroughly and become proficient. The programmers
also write the programs and quickly maintain existing programs in SQL.
3. Application Portability: Applications can be easily moved from machine to machine and can develop
the standards.
4. Application longevity: The old applications developed in SQL old versions can be developed using the
advanced SQL do not taking a long time.
5. Reduced dependence on a single vendor: The learners can get assistance, training and educational
services from the vendors. Because, the SQL is easy language. So user does not depend on single person.
[i.e., more vendors are available to give the assistance].
6. Cross-system communication: Different DBMSs and application programs can more easily
communicate and co-operate in managing data and processing user programs.
we will present a number of sample queries using the following table definitions:
Sailors( sid: integer, sname: string, rating: integer, age: real)
Boats( bid: integer, bname: string, color: string)
Reserves (sid: integer, bid: integer, day: date)
SQL>SELECT S.sid, S.sname, S.rating, S.age FROM Sailors AS S WHERE S.rating > 7
This query uses the optional keyword AS to introduce a range variable. Incidentally, when we want
to retrieve all columns, as in this query, SQL provides convenient shorthand: we can simply write SELECT
*. This notation is useful for interactive querying, but it is poor style for queries that are intended to be
reused and maintained because the schema of the result is not clear from the query itself; we have to refer to
the schema of the underlying Sailors table.
Ex: Find the names of sailor's who have reserved both a red and a green boats.
SQL>SELECT S.sname FROM Sailors S, Reserves R, Boats B WHERE S.sid = R.sid AND R.bid = B.bid
AND B.color = „red‟ INTERSECT SELECT S1.sname FROM Sailors S1, Boats B1, Reserves R1 WHERE
S1.sid = R1.sid AND R1.bid = B1.bid AND B1.color = 'green';
Ex: Find the sids of all sailor's who have reserved red boats but not green boats.
SQL>SELECT S.sid FROM Sailors S, Reserves R, Boats B WHERE S.sid = R.sid AND R.bid = B.bid
AND B.color = „red‟ EXCEPT SELECT S1.sid FROM Sailors S1, Boats B1, Reserves R1 WHERE S1.sid
= R1.sid AND R1.bid = B1.bid AND B1.color = 'green';
Sailors 22, 64, and 31 have reserved red boats. Sailors 22, 74, and 31 have reserved green boats. Hence, the
answer contains just the sid 64.
NESTED QUERIES:
A Sub query or Inner query or a Nested query is a query within another SQL query and embedded
within the WHERE clause.
A sub query is used to return data that will be used in the main query as a condition to further restrict the
data to be retrieved.
Sub queries can be used with the SELECT, INSERT, UPDATE, and DELETE statements along with the
operators like =, <, >, >=, <=, IN, BETWEEN, etc.
There are a few rules that sub queries must follow
Sub queries must be enclosed within parentheses.
A sub query can have only one column in the SELECT clause, unless multiple columns are in the
main query for the sub query to compare its selected columns.
An ORDER BY command cannot be used in a sub query, although the main query can use an
ORDER BY. The GROUP BY command can be used to perform the same function as the ORDER
BY in a sub query.
Sub queries that return more than one row can only be used with multiple value operators such as
the IN operator.
A sub query cannot be immediately enclosed in a set function.
The BETWEEN operator cannot be used with a sub query. However, the BETWEEN operator
can be used within the sub query.
Set-Comparison Operators:
The set-comparison operators EXIST, IN, and UNIQUE, along with their negated versions. SQL also
supports op ANY and op ALL, where operator is one of the arithmetic comparison operators {<, <=, =,
<>, >=, >}.
Ex: Find sailors whose rating is better than some sailor called Horatio.
SELECT S.sid FROM Sailors S WHERE S.rating > ANY (SELECT S2.rating FROM Sailors S2
WHERE S2.sname = „Horatio‟);
If there are several sailors called Horatio, this query finds all sailors whose ratingis better than that of
some sailor called Horatio. On instance sailors this computes the sids 31, 32, 58, 71, and 74.
Ex: Find sailors whose rating is better than every sailor' called Horatio.
SQL> SELECT S.sid FROM Sailors S WHERE S.rating > ALL (SELECT S2.rating FROM Sailors S2
WHERE S2.sname = „Horatio‟);
On instance sailors we would get the sid", 58 and 71
AGGREGATE OPERATORS:
To simply retrieving data we often want to perform some computation or summarization. SQL
allows the use of arithmetic expressions. We now consider a powerful class of constructs for computing
aggregate values such as MIN and SUM. These features represent a significant extension of relational
algebra. SQL supports five aggregate operations, which can be applied on any column.
2. SUM ([DISTINCT] A): The sum of all (unique) values in the A column.
Ex: sum the rating of all sailors;
SQL>select sum(rating) from sailors;
3. AVG ([DISTINCT] A): The average of all (unique) values in the A column.
Ex: Average age of all sailors.
SQL> select avg(age) from sailors;
4. MAX (A): The maximum value in the A column.
Ex: Maximum rating of sailors.
SQL>select max(rating) from sailors;
5. MIN (A): The minimum value in the A column.
Ex: Minimum rating of sailors.
SQL>select min(rating) from sailors;
Syntax : SELECT column_name [, aggregate name] FROM <table name> [WHERE <condition>]
GROUP BY column_name;
The „column_name‟ of SELECT command and which used in GROUP BY clause must be same.
The <table name> is name of table.
The aggregate name is any function such as sum(), avg() etc., Eg:
1) Find the age of the youngest sailor for each rating level.
SQL> select sname,min(age) from sailors group by rating;
It will display only one sailors name and age for each rating group
Eg: 2) Find the age of the youngest sailor who is eligible to vote (i.e., is at least 18 years old) for each
rating level with at least h.uo such sailors.
SQL> SELECT S.rating, MIN (S.age) AS minage FROM Sailors S WHERE S.age >= 18 GROUP BY
S.rating HAVING COUNT (*) > 1;
HAVING clause : This clause is used in SELECT command and it is similar to WHERE clause, but it
identifies groups which match in a specified condition.
Syntax : SELECT column_name [, aggregate name] FROM <table name> [WHERE <condition>] GROUP
BY column_name HAVING <condition>;
The „column_name‟ of SELECT command and which used in GROUP BY clause must be same.
The <table name> is name of table.
The aggregate name is any function such as sum(), avg() etc.,
The HAVING < condition> contains relational expression and one of the column must be
Aggregate function.
Eg: 1) SELECT JOB FROM EMP GROUP BY JOB HAVING AVG(SAL) > 3000;
It will display only one job name for each group and whose employee average salary is > 3000.
Eg: 2) SELECT AVG(SAL), JOB FROM EMP GROUP BY JOB HAVING MAX(SAL) > 3000;
It will display only one job name, and average salary for each group and whose maximum salary > 3000.
NULL VALUES:
SQL provides a special column value called null to use in such situations. We use null when the column
value is either unknown or inapplicable. Using the Sailor table definition, we might enter the row (98. Dan,
null, 39). The presence of null values complicates many issues these issues are
Comparisons using null values
Logical connectivity AND, OR and NOT
Impact on SQL construct
Outer joins
Disallowing Null Values
Comparisons using null values:
SQL also provides a special comparison operator IS NULL to test whether a column value is null; for
example, we can say rating IS NULL, which would evaluate to true on the row representing Dan. We can
also say rating IS NOT NULL, which would evaluate to false on the row for Dan.
Outer Joins:
Interesting variants of the join operation that rely on null values, called outer joins, are supported in
SQL. Consider the join of two tables, say Sailors Reserves. Tuples of Sailors that do not
match some row in Reserves according to the join condition do not appear in the result. In an outer join, on
the other , Sailor rows without a matching Reserves row appear exactly once in the result, with the result
columns inherited from Reserves assigned null values.
In a left outer join,
Sailor rows without a matching Reserves row appear in the result but not vice versa. In a right outer
join, Reserves rows without a matching Sailors row appear in the result, but not vice versa. In a full outer
join, both Sailors and Reserves rows without a match appear in the result.
SQL allows the desired type of join to be specified in the FROM clause. For example, the following
query lists
SQL>SELECT S.sid, R.bid FROM Sailors S LEFT OUTER JOIN Reserves R on s.sid=r.sid;
INTEGER is the underlying, or source, type for the domain ratingval, and every ratingval value must
be of this type. Values in ratingval are further restricted by using a CHECK constraint; in defining this
constraint, we use the keyword VALUE to refer to a value in the domain. By using this facility, we can
constrain the values that belong to a domain using the full power of SQL queries. Once a domain is defined,
the name of the domain can be used to restrict column values in a table.
The optional DEFAULT keyword is used to associate a default value with a domain. If the domain
ratingval is used for a column in some relation and no value is entered for this column in an inserted tuple,
the default value 1 associated with ratingval is used.
A trigger can be thought of as a 'daemon' that monitors a database, and is executed when the
database is modified in a way that matches the event specification. An insert, delete, or update statement
could activate a trigger, regardless of which user or application invoked the activating statement; users may
not even be aware that a trigger was executed as a side effect of their program.
A condition in a trigger can be a true/false statement (e.g., all employee salaries are less than
$100,000) or a query. A query is interpreted as true if the answer set is nonempty and false if the query has
no answers. If the condition part evaluates to true, the action associated with the trigger is executed
for example, we have to examine the age field of the inserted Students record to decide whether to
increment the count.
The keyword new refers to the newly inserted tuple. If an existing tuple were modified, the keywords
old and new could be used to refer to the values before and after the modification.
1) Arithmetic operators : The Arithmetic operators are used to link the two operands for getting a new
results. The Arithmetic operators are Addition(+), Subtraction(-) multiplication (*), division (/), and
modulo (%).
Eg 1 : SELECT emp_no, emp_name, sal+hra FROM emp;
It will display emp number, employee name and sal with adding hra from emp table. Eg 2
: SELECT emp_no, emp_name, sal - tax FROM emp;
It will display emp number, employee name and sal by subtracting tax from emp table.
Eg 3 : SELECT emp_no, emp_name, sal * 12 / 100 FROM emp;
2) Relational operators : The Relational operators are used to compare two operands for further process.
The Relational operators are
Operator Meaning
> greater than
< less than
>= greater than or equal to
<= less than or equal to
= equal to
<> not equal to
3) Logical operators : The Logical operators are used to compare two relational expressions. The Logical
operators are AND, OR, and NOT operators.
Eg 1 : SELECT *FROM emp WHERE emp_no >= 10 AND emp_no <= 20; It
will display rows of data which emp_no are in between 10 and 20.
Eg 2 : SELECT *FROM emp WHERE emp_no >=10 or sal = 4500;
It will display rows of data which emp_no is greater than or equal to 10 or which sal is equal to
4500.
4) Special operators : The special operators are used to match the values in given list.
The special operators are
a) BETWEEN operator b) IN/NOT IN operator
c) LIKE operator d) IS NULL operator
a) BETWEEN operator : This operator is used to match the particular column values in the given
range. The range consists lowest value and highest value.
Syntax : BETWEEN low value AND high value ;
Eg: 1 SELECT *FROM emp WHERE emp_no BETWEEN 5 AND 10;
It will display the rows of data from emp table which employee number in between 5 and 10.
Eg: 2 SELECT *FROM emp WHERE sal BETWEEN 5000 AND 10000;
It will display the rows of data from emp table which employee salary is in between 5000 and
10000.
b) i) IN operator: The IN operator is used in where clause to match the values of column in the
given list.
Syntax: IN (list)
b) ii) NOT IN operator: The NOT IN operator is used in where clause to which column values are not
match in the given list.
Syntax: NOT IN (list)
c) LIKE operator: The LIKE operator is used in where clause to match the possible values in the given
list. I.e. it is possible to select rows that match a character pattern. The character pattern matching
operation may be referred to as „wild-card‟ search. The symbols can be used to construct the search
string.
d) IS NULL operator: The IS NULL operator is used in where clause to test the NULL value in the
given column name.
Eg: SELECT * FROM emp WHERE hra IS NULL;
It will display the rows of data from emp table which hra value is null value.