create table

    0

    3

    lucycodes42

    SQL public snippets

    The preceding code creates a table if it does not already exist. The table has an ID column and a name column, both of which are text fields. The table is a primary key column, with the ID field being the primary key.

    Shortcut: table.create

    CREATE TABLE IF NOT EXISTS `table_name` (
      `id` INT UNSIGNED NOT NULL AUTO_INCREMENT,
      `name` VARCHAR(255),
      PRIMARY KEY `pk_$`(`$`)
    );
    
    
    Codiga Logo
    Codiga Hub
    • Rulesets
    • Playground
    • Snippets
    • Cookbooks
    soc-2 icon

    We are SOC-2 Compliance Certified

    G2 high performer medal

    Codiga – All rights reserved 2022.