Page 25 - Modular_V2.0_SQL_Flipbook
P. 25

C.  Write 'T' for true and 'F' for false.

                    1.  In a database table, every column must have a name and data type.                   ……………………

                    2.  A data type defines a sort of value that a column will contain.                     ……………………
                    3.  The TIMESTAMP data type stores only hour, minute and second values.                 ……………………

                    4.  Primary keys must have unique values and may have NULL values.                      ……………………

                    5.  After creating a table, you cannot add a column to it.                              ……………………

                 D.  Short answer type questions.

                    1.  What is a table?
                    2.  Define default constraint.

                    3.  Write the syntax of the DROP TABLE command.
                    4.  Write the syntax for adding a column to a table.

                    5.  What is the use of Time data type?
                 E.   Long answer type questions.
                    1.  What is MySQL?

                    2.  What are the constraints used in MySQL?
                    3.  How do you delete tables from a database?

                    4.  How can you change the data type of the column in a table?
                    5.  Describe any five data types used in SQL.
                                                                                               21 st  Century   #Critical Thinking
                 F.  Competency-based/Application-based question.                                  Skills  #Technology Literacy
                    1.   Anaya has created a table in SQL. Now, she wants to remove a field from the table. But she forgot the
                       syntax. Help her by writing the syntax.

                    2.   Viraj is working on a table in MySQL. He wants to restricts the value range that can be placed in a
                       column. Suggest a SQL constraint that can help him.
                                                        In the lab                             21 st  Century   #Creativity
                                                                                                       #Technology Literacy
                                                                                                   Skills
                  1.  Create a table named ‘Employee’ with the following structure:
                     EmpID                Integer
                     FirstName            Char(30)
                     LastName             Char(30)
                     Salary               Integer
                  2.  Create another table and set table constraints as follows:
                     a.  2 fieldnames as primary keys
                     b.  All fields to have not null values



                  Teacher's Corner

                 1.  Help the students download and install MySQL.
                 2.  Demonstrate the students to modify a table with examples.

                                                                                                                     23
                                                                                               Introduction to MySQL
   20   21   22   23   24   25   26   27   28   29   30