Page 76 - Computer Software Application TP - Volume 1
P. 76

COMPUTER SOFTWARE APPLICATION - CITS



           SQL

           CREATE TABLE table name (
             column1 name data type PRIMARY KEY,
             column2 name data type,
             column3 name data type,
             ...

           );
           Replace:
           table name with the desired name for your table (e.g., employee table).
           column name with the names of each data column.
           data type with the appropriate data type for each column (e.g., INT, VARCHAR, DATE).

           PRIMARY KEY specifies the unique identifier for each row (usually an auto-incrementing INT).
































           6  Insert Data:
           Use the INSERT INTO command:
           INSERT INTO table name (column1 name, column2 name, column3 name)
           VALUES (value1, value2, value3);
           Replace:

           table name with the name of your table.
           column name with the names of the columns you want to insert data into.
           value with the actual data for each column (e.g., numbers, strings, dates).
           7  Retrieve Data:

           Use the SELECT command:
           SELECT * FROM table name;
           This retrieves all data from the table.
           You can modify the SELECT command to specify specific columns or filter data based on conditions.



                                                           61
 CITS : IT & ITES - Computer Software Application - Exercise 20   CITS : IT & ITES - Computer Software Application - Exercise 20
   71   72   73   74   75   76   77   78   79   80   81