Special comparison operator used in where clause-dml, Database Management System

Special comparison operator used in where Clause

a.   between. ...and...It gives range among two values (inclusive)

Example:

SELECT ENAME, SAL FROM EMP

WHERE SAL BETWEEN 1000 AND 1500;

b.   In (list): match any of a list of values

Example:

SELECT EMPNO, ENAME, SAL, MGR FROM EMP

WHERE MGR IN (7902, 7566, 7788);

7902, 7566, and 7788 are Employee numbers c.      Like: match a character pattern

  • % indicates zero or many characters
  • Like operator is used only with char and Varchar2 to match a pattern
  • _ indicates one character
  • Combination of % and_can also be used.

Example:

(I)  List the names of employees whose name begins with 's' SELECT ENAME FROM EMP

WHERE ENAME LIKE 'S%';

 (II)    List the ename finished with's'

SELECT ENAME FROM EMP WHERE ENAME LIKE '%S';

(III)   List ename having I as a second character

SELECT ENAME FROM EMP WHERE ENAME LIKE '_I%';

d. Is null operator

Example:

 to search employee whose manage-id is not specified

SELECT ENAME, MGR FROM EMP WHERE MGR IS NULL;

Posted Date: 3/11/2013 1:04:31 AM | Location : United States







Related Discussions:- Special comparison operator used in where clause-dml, Assignment Help, Ask Question on Special comparison operator used in where clause-dml, Get Answer, Expert's Help, Special comparison operator used in where clause-dml Discussions

Write discussion on Special comparison operator used in where clause-dml
Your posts are moderated
Related Questions
An example of a weak entity is Staff because the availabilityID cannot be uniquely identified unless it is used in conjunction with the foreign key known as availabilityID in the A

With the help of a diagram defines the typical element modules of a DBMS? The functional elements of a database system can be widely divided into: 1) Storage manager and 2) q

Define the term- Actors and Data Stores Actors: An actor is the active object which drives data flow graph by producing or consuming values. Actors are attached to inputs a

What is theta join explain? Theta  Join  - The  theta  join  operation  is  an  extension  to  the  natural-join operation which permits us to merge selection and a Cartesian

Explain the two constraints, check and foreign key in SQL along with an example for each. Give the syntax. CHECK constraint - CHECK constraint specifies an expression which

Using Literal Character String Example: To print IS A as one string with column name employee SELECT ENAME || ' IS A ' || JOB AS "EMPLOYEE" FROM EMP;

Q.1 Briefly discuss the different layers of ANSI SPARC architecture. Ans: The three layers of ANSI SPARC architecture are like this: 1. Internal view is at the lowest leve

Object-based Models: Use objects as key data representation components . Examples:-   Entity-Relationship Model: It is a collection of real world objects known as entitie

The following relational database schema represents part of a simplified database used by a library: tblBook (BookID, Title, PublisherID, Category,Price) tblPublisher (Publishe

Explain the Difference between DROP and DELETE DELETE deletes one or more than one tuples of a particular relation from the database. DROP is employed to remove a table from th