Basic HTML Version

|  | Table of Contents |  | View Full Version

Page 66 - 2611_SmartGPT Pro V(5.0) C-8
P. 66

    LOGICAL OPERATORS
                      Logical operators are used to combine multiple conditions in a query. These operators allow

                      you to create complex queries. They include the following types:

                                           Operator                              Description

                                   AND                         Returns TRUE if both conditions are true.

                                   OR                          Returns TRUE if at least one condition is true.
                                                               Reverses the  logical  state  of its  operand,
                                   NOT                         returning TRUE if the condition is FALSE and
                                                               vice versa.

                      SPECIAL OPERATORS

                      Some special operators in SQL are as follows:

                                           Operator                              Description

                                                              Returns TRUE if all of the subquery values meet
                                 ALL
                                                             the condition.
                                                              Returns TRUE if any of the subquery values meet
                                 ANY
                                                             the condition.

                                                              Used to  indicate  a range which  otherwise  is
                                 BETWEEN
                                                             done using relational operators.
                                                              Returns TRUE if the subquery returns one or
                                 EXISTS
                                                             more records.

                                SQL CONSTRAINTS

                      SQL  constraints are used  to  define  rules for table  data.  These rules control  the  data  that
                      can be stored in a column. Constraints are used to restrict the types of data that can be entered
                      into a table.

                      Some different types of constraints include:

                         NULL constraint: The NULL constraint allows a column to store NULL values. If no value is
                         provided during insert or update, it does not cause an error.
                         NOT NULL constraint: The NOT NULL constraint specifies that a column must have a value.
                         Records cannot be inserted or updated without providing a value for this column.

                         PRIMARY KEY constraint: The Primary key constraint uniquely identifies each record in a table.
                         Primary keys must be unique, cannot be NULL and only one primary key can exists per table.

                       64   Computer Science (V5.0)-VIII

| 61 62 63 64 65 66 67 68 69 70 71 |