mysqlworkbench

When I create a SQL table in Workbench, a error occurs


[enter image description here][1]

Screenshot [1]: https://i.sstatic.net/Hiai9.jpg


Solution

  • Here is how CREATE TABLE works.

    I see you have a database, new_schema, already created.

    You need to input column names and the details of the types of variables that will go in the columns.

    For example, to create a new_table with three (3) columns:

        USE new_schema
    

    then

        CREATE TABLE new_table (
                                 new_column_1 VARCHAR(50) NOT NULL,
                                 new_column_2 VARCHAR(30) NOT NULL,
                                 new_column_ 3 INT NOT NULL,
                                 PRIMARY KEY(new_column_1)
        );
    

    I hope this helps.

    Ps: rather than upload an image alone; it is best to share the code you used or are having difficulty with getting to work.