Operators Are The Elements You Use Inside An Expression To Articulate How You Want Specified Conditions To Retrieve Data

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 1

OPERATORS are the elements you use inside an expression to articulate how you

want specified conditions to retrieve data

Comparison Operators True to their name, comparison operators compare


expressions and return one of three values: TRUE, FALSE, or Unknown

In database terms NULL is the absence of data in a field SELECT *


2 FROM PRICE
3 WHERE WHOLESALE IS NULL;

When you need to find everything except for certain data, use the inequality symbol,
which can be either < > or !=

SELECT *
FROM PARTS
WHERE NAME LIKE 'A%';
you would get any name that starts with A:
SQL> SELECT FIRSTNAME || LASTNAME ENTIRENAME
FROM FRIENDS; OUTPUT:
ENTIRENAME
----------------------
AL BUNDY
AL MEZA
BUD MERRICK
The two operators IN and BETWEEN provide a shorthand for functions If you
wanted to find friends in Colorado, California, and Louisiana, you could type
the following:
SELECT *
FROM FRIENDS
WHERE STATE IN('CA','CO','LA');
LASTNAME FIRSTNAME AREACODE PHONE ST ZIP
-------------- -------------- --------- -------- -- -----
MERRICK BUD 300 555-6666 CO 80212
MAST JD 381 555-6767 LA 23456
PERKINS ALTON 911 555-3116 CA 95633

INSERT:SQL> INSERT INTO BILLS VALUES("Joe's Computer Service", 25, 1);

The ALTER TABLE statement enables the database administrator or designer to


change the structure of a table after it has been created.
ALTER TABLE BILLS 2 MODIFY NAME CHAR(40); ALTER TABLE NEW_BILLS 2
ADD COMMENTS CHAR(80);
The DROP TABLE command deletes a table along with all its associated views and
indexes. SQL> DROP TABLE NEW_BILLS;
Why does the CREATE DATABASE statement vary so much from one system to another?
ANS.CREATE DATABASE varies because the actual process of creating a database varies from one database system
to another. Small PC-based databases usually rely on files that are created within some type of application program

You might also like