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

Explain pipelining.        Ans: In order to describe pipelining in simple terms, think of it as breaking down processor functions into smaller and smaller parts. For instance,

Define Assertions in SQL a. An assertion is a predicate that is expressing a condition we wish the database to always satisfy.  b. Domain constraints, functional dependency

It defines that the tuple in one relation that refers to another relation must refer to an existing tuple in that relation. This constraint is states on two relations (not essentia

find a name whose address is erode from student table

statical data

Do NOT use the timestamp type.  Use separate date and time data types only.  Figure out how to define an SQL insert statement that uses built-in SQL (or MySQL) functions to define

Describe file organisation? A file is organized logically as a sequence of records. These records are mapped onto disk blocks. A) Fixed-Length Records Type deposit=record

Consider the relations described below: PHYSICIAN (regno, name, telno, city) PATIENT (pname, street, city) VISIT (pname, regno, date_of_visit, fee) Where the regno and pname ide

What is the main difference between read-only and update methods? A read-only method does not affect the values of a variable in an object, whereas an update method may alter t