• The SQL AND and OR operators are used to combine multiple conditions to narrow data in an SQL statement. These two operators are called conjunctive operators.

    These operators provide a means to make multiple comparisons with different operators in the same SQL statement.


    AND Operator Example

    CustomerIDCustomerNameContactNameAddressCityPostalCodeCountry
    1

    Alfreds FutterkisteMaria AndersObere Str. 57Berlin12209Germany
    2Ana Trujillo Emparedados y heladosAna TrujilloAvda. de la Constitución 2222México D.F.05021Mexico
    3Antonio Moreno TaqueríaAntonio MorenoMataderos 2312México D.F.05023Mexico
    4

    Around the HornThomas Hardy120 Hanover Sq.LondonWA1 1DPUK
    5Berglunds snabbköpChristina BerglundBerguvsvägen 8LuleåS-958 22Sweden



    AND Operator Example

    SELECT * FROM Customers
    WHERE Country='Germany'
    AND City='Berlin';


    OR Operator Example

    SELECT * FROM Customers
    WHERE City='Berlin'
    OR City='München';


    Combining AND & OR

    SELECT * FROM Customers
    WHERE Country='Germany'
    AND (City='Berlin' OR City='München');



  • Sorry No animation Yet.

    We are Working On this


OUR PARTNERS&Website builderuCoz