Page 170 - IT-802_class_12
P. 170

4   Enter the following command if the database is already created:
             USE SCHOOL;
             If the database is not yet created, first create it by using the CREATE DATABASE command.
             The message Database changed appears.

         5   Now, enter the command to create a table and press the Enter key. The following message appears on the prompt:
             Query OK, 0 rows affected (0.10 sec)




















        1.4.5 Describe Table

        DESCRIBE or DESC command is used to describe the structure of a table.
        Syntax:

        DESC Table_Name;
        Example:

        DESC EmpLOyEE_DETAiLS;
        Output:
        +-----------------+-------------+------+-----+---------+-------+
        | Field           | Type        | Null | Key | Default | Extra |
        +-----------------+-------------+------+-----+---------+-------+
        | Emp_NAmE        | varchar(20) | yES  |     | NULL    |       |
        | Emp_DEpARTmENT  | varchar(20) | yES  |     | NULL    |       |
        | Emp_DESiGNATiON | varchar(20) | yES  |     | NULL    |       |
        | DATE_OF_BiRTH   | date        | yES  |     | NULL    |       |
        | ADDRESS         | varchar(20) | yES  |     | NULL    |       |
        +-----------------+-------------+------+-----+---------+-------+
        1.4.6 Inserting Records in a Table

        After creating a table, you can insert records into it by using the INSERT command.


          168   Touchpad Information Technology-XII
   165   166   167   168   169   170   171   172   173   174   175