Page 140 - CodePilot V5.0 C8
P. 140

To remove all records from a table, use the following command:

                  DELETE FROM Students;





                              In MySQL, you can exit from a database by using the EXIT or QUIT commands.




                                                                                             21 st   #Critical Thinking
                       INTERDISCIPLINARY LEARNING                                           Century   #Information Literacy
                                                                                            Skills

                    In science class, you are recording daily temperatures to study climate change. Complete the given tasks:
                    (a)  Create a table named WeatherData with fields: Date, City, Minimum and Maximum Temperature.
                    (b)  Insert the temperature data for your city for a week.

                    (c)  Write SQL queries to show all data when the maximum temperature is above 38°C.
                    (d)  Write SQL queries to show all data when the minimum temperature is above 24°C.






                  TECH
                    T        ¢   ANSI SQL standard: A set of rules defined by the American National Standards Institute
                    E            to ensure consistency and compatibility of SQL across different database systems.
                    R
                    M        ¢   PRIMARY KEY: A field used to uniquely identify records in a database.
                    S
                             ¢   FOREIGN KEY: A field in a table that refers to the primary key in another table.




                  REWIND RUN



                  «   Data includes raw facts, figures or symbols that are yet to be processed into meaningful information.
                  «   A database is defined as an organised collection of data that is stored and accessed electronically.
                  «   A relational database is a type of database that stores data in the form of tables.

                  «   A key is a column or a set of columns that helps us to identify records in a table.
                  «   SQL enables us to store, retrieve and manipulate data in the form of tables.
                  «   A data type defines the sort of value that a column will contain.
                  «   SQL operators are used to perform operations on values in an SQL query.

                  «   SQL constraints are used to define rules for table data.












                   138
                        CodePilot (V5.0)-VIII
   135   136   137   138   139   140   141   142   143   144   145