Page 24 - SQL
P. 24

Chapter 3: AND & OR Operators




        Syntax



            1.  SELECT * FROM table WHERE (condition1) AND (condition2);

            2.  SELECT * FROM table WHERE (condition1) OR (condition2);



        Examples


        AND OR Example


        Have a table



          Name     Age    City

          Bob      10     Paris


          Mat      20     Berlin

          Mary     24     Prague



         select Name from table where Age>10 AND City='Prague'


        Gives


          Name


          Mary



         select Name from table where Age=10 OR City='Prague'


        Gives



          Name

          Bob


          Mary


        Read AND & OR Operators online: https://riptutorial.com/sql/topic/1386/and---or-operators









        https://riptutorial.com/                                                                                6
   19   20   21   22   23   24   25   26   27   28   29