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
FDs in Relationships:  Enrols Relationship: None as it is many to many Teaches Relationship : Course code → Instructor Instructor → Course code The next question is:


Normalize the following table upto and including the 3NF. Submit a 1 page printout of only the final set of normalized tables in Data Architect. Just use Data Architect to do the t

Consider a systems development project with the following data Activity                                Duration (weeks)        Precedence Relationship 1. Software design

Question: This question refers to the database schema. a) Express the following queries in SQL: (i) Write the SQL code that will create the table Company. Your answer sh

What is candidate key? Candidate Key - A candidate key of an entity set is a minimal superkey, which uniquely identifies each row in the relation.

what factors might influence a company to outsource its IT infrascture.


Question: Data Mining is the process of extracting knowledge hidden from large volumes of raw data. (a) Using a suitable example, illustrate how Data Mining can be useful t

Have database built but having problems with some questions that go with the database