Page 130 - CodePilot V5.0 C8
P. 130

The MySQL prompt appears, allowing queries to be performed on the MySQL server.

























                      PRIVACY PRACTICES

                      Update  your database  passwords regularly, avoid  reusing them  and always back  up your
                      database work.





                         SQL DATA TYPES


                  A data  type  defines  the  type  of value that  a column  will contain.  In  a database  table,  every
                  column must have a name and a data type. Some common SQL data types and their descriptions
                  listed below:

                     Data Type                     Description                                 Example

                                                                                  age INT;
                   INTEGER(INT)     Stores whole numbers (no decimals).
                                                                                  Example: 25, 30
                                    Stores  fixed-length character  strings of  gender CHAR(1);
                   CHAR(n)
                                    size n.                                       Example: ‘M’, ‘F’
                                    Stores  variable-length character strings  name VARCHAR(50);
                   VARCHAR(n)
                                    with a maximum size of n.                     Example: ‘Yash Gupta’, ‘Sonia’


                                    Stores  numbers  with precision  p and  price DECIMAL(5,2);
                   DECIMAL(p,s)
                                    scale s.                                      Example: 123.45, 99.99
                                    Stores  date  values in YYYY-MM-DD  birthdate DATE;
                   DATE
                                    format.                                       Example: ‘1990-05-25’

                                    Stores   floating-point    numbers     with temperature FLOAT(5);
                   FLOAT(p)
                                    precision p.                                  Example: 98.6, 35.75

                                                                                  appointment_time TIME;
                   TIME             Stores time values in HH:MM:SS format.
                                                                                  Example: ‘10:30:00’, ‘15:45:00’




                   128
                        CodePilot (V5.0)-VIII
   125   126   127   128   129   130   131   132   133   134   135