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
a method named WonGame that checks each letter in the word is matched by its label

1) Define a job scheduling strategy that will meet business requirement of reporting availability by 6am CST for the following cubes? Show the job scheduling dependencies in a pict

Oracle & Distributed Databases 1. Differentiate between PL/SQL functions and procedures. 2. Draw the diagram of logical structure of oracle database and explain it in brief.

What are referential integrity constraints? A value that appears in single relation for a given set of attributes also appears for a particular set of attributes in another rel

Objectives After reading this part, you should be able to: Modify, create, and delete database schema objects; Update database using SQL command; Retrieve data f

Economics: It is now usually accepted that it costs less to make a system of smaller computers with the equivalent power of a one large computer. It is more cost-effective to get s

What are the three data anomalies that are likely to occur as a result of data redundancy?  Can data redundancy be completely eliminated in database approach?  Why or why not? A

What are stored and derived attributes? Stored attributes: The attributes keeps in a data base are known as stored attributes. Derived attributes: The attributes that are de

Depending upon the rules we have found, we can classify the locks into two types. Shared Lock: A transaction might be acquiring shared lock on a data item in order to read it

Accessing information about permissions to all users- Object level permissions: With the use of data dictionary you can see the permissions to user. Let us get the table name fro