Karellism icon

Basic SQL

Karellism | PRO | 02/11/20 09:55:25 PM UTC | 0 ⭐ | 6939 👁️ | Never ⏰ | []
SQL |

1.01 KB

|

None

|

0 👍

/

0 👎

    -- Create a new database with name DemoDB and with the character set 
    -- utf8 which stands for unicode text format 8 which is widely used for
    -- supporting international character set.
     
    CREATE DATABASE `DemoDB` DEFAULT CHARACTER SET `utf8` ;
     
    -- USE command will select the Database.
     
    USE `DemoDB`;
     
    -- Create table to create the table in the database.
             
    CREATE TABLE `Employee`(
        `EmpID`         INT,
        `FirstName`     VARCHAR(50),
        `LastName`      VARCHAR(50),
        `Salary`        NUMERIC(20,2)
    );
     
     
    -- Insert command to inserting data into the table.
     
    INSERT INTO `Employee`
    VALUES (1, 'A', 'A', 1000);
     
    INSERT INTO `Employee` 
    VALUES (2, 'B', 'B', 2000);
       
    -- Select Command or Query 
    -- used to retrieve the information from the table or relation.
     
    SELECT * FROM `Employee`;
     
    -- Drop command to drop the table. 
     
    DROP TABLE `Employee`;

Comments

  •  icon
    01/01/70 12:00:00 AM UTC
    Plain Text |

    0 B

    |

    👍

    /

    👎

    
        
  •  icon
    01/01/70 12:00:00 AM UTC
    Plain Text |

    0 B

    |

    👍

    /

    👎