SQL Operators

अब Quizwiz के साथ अपने होमवर्क और परीक्षाओं को एस करें!

NOT

Logical operator that displays a record if the condition(s) is NOT TRUE. Example SELECT * FROM Customers WHERE City NOT LIKE 's%';

AND

Logical operator that is true if all conditions separated by AND are true Example SELECT * FROM Customers WHERE City = "London" AND Country = "UK";

EXISTS

Logical operator that is true if the subquery returns one or more records Example SELECT * FROM Products WHERE EXISTS (SELECT Price FROM Products WHERE Price > 50);

To ask about and add

SQL Compound Operators Operator Description += Add equals -= Subtract equals *= Multiply equals /= Divide equals %= Modulo equals &= Bitwise AND equals ^-= Bitwise exclusive equals |*= Bitwise OR equals SQL Bitwise Operators Operator Description & Bitwise AND | Bitwise OR ^ Bitwise exclusive OR

Operator Overview

These are the SQL equivalent of filters. These are like if equations that only pull information when they conclude to be true.

>=

Comparison operator that checks if the first value is greater than or equal to the second value

ALL

Logical operator that is true if all of the subquery values meet the condition Example SELECT * FROM Products WHERE Price > ALL (SELECT Price FROM Products WHERE Price > 500);

OR

Logical operator that is true if any of the conditions separated by OR are true. Example SELECT * FROM Customers WHERE City = "London" OR Country = "UK";

ANY

Logical operator that is true if any of the subquery values meet the condition Example SELECT * FROM Products WHERE Price > ANY (SELECT Price FROM Products WHERE Price > 50);

SOME

Logical operator that is true if any of the subquery values meet the condition Example SELECT * FROM Products WHERE Price > SOME (SELECT Price FROM Products WHERE Price > 20);

IN

Logical operator that is true if the operand is equal to one of a list of expressions Example SELECT * FROM Customers WHERE City IN ('Paris','London');

BETWEEN

Logical operator that is true if the operand is within the range of comparisons Example SELECT * FROM Products WHERE Price BETWEEN 50 AND 60;

LIKE

Logical operator that is true if the operand matches a pattern Example SELECT * FROM Customers WHERE City LIKE 's%';

%

Modulo division Gives you the remainder of an integer division of the given numbers. Example 5 % 3 = 2 It does 5/3 in integer division, finds that 3 goes into 5 once and gives you the remainder of 2.

|

OR Requires that one of the values being OR'd together are true

+

Arithmetic operator that adds

/

Arithmetic operator that divides

*

Arithmetic operator that multiplies

-

Arithmetic operator that subtracts

>

Comparison operator that checks if the first value is greater than the second value

<=

Comparison operator that checks if the first value is less than or equal to the second value

<

Comparison operator that checks if the first value is less than the second value

<>

Comparison operator that checks if the first value is not equal to the second value

=

Comparison operator that checks if the two values are equal

+=

Compound operator

&

AND Requires that both of the values being AND together are true


संबंधित स्टडी सेट्स

S66 Unit 19 (Types of investment risk) Quiz

View Set

Chapter 15: Newborn Nutrition Prep-U Maternal

View Set

Chapter 16: Trustworthiness and Integrity in Qualitative Research (Rated 4.8 so double check with the TB)

View Set

Chapter 9- Motivation, Performance, and Effectiveness

View Set

Quiz 4: Financial management weeks 7 and 8 and is based on material from chapters 8 to 10

View Set

midterm exam interpersonal communications

View Set