Tutorials Hut

  • SQL Testing




  • SQL Create Table Statement

    SQL CREATE TABLE statement is used to create table in a database.

    We can create many tables in a database.

    Create Table Syntax

    The basic syntax of the CREATE TABLE statement is as follows −

    CREATE TABLE       Table_name
    (column_name1     data_type(size),
     column_name2     data_type(size),
     column_name3     data_type(size),
     ………………………………
     ………………………………
     column_namen    data_type(size));

    Example

    CREATE TABLE Employee(
    EmployeeID                         INT         NOT NULL PRIMARY KEY AUTO_INCREMENT,
    Employee_FirstName            VarChar(30) ,
    Employee_LastName            VarChar(20),
    DepartmentID                      INT,
    DepartmentName                VarChar(10),
    EmployeeEmail                    VarChar(10),
    CITY                                    VarChar(10),
    Salary                                  DECIMAL
    );

    Statement to check whether a table exists or not in a database and the description of the table.

    Syntax

    DESC TableName;

    Example

    DESC Employee;

    SQL Create Table _ DESC



  • SQL Testing

  •  

    •  
     
     
     
     
     
     
     
      •  

















  • Leave a Reply

    Your email address will not be published. Required fields are marked *