Handy SQL Snips

  • Views Views: 9,361
  • Last updated Last updated:
  • These are to be used only when necessary as most of these actions can be achieved via Fabrik itself.

    Please only use these if you are comfortable that you know what they are doing.

    Insert data into columns​

    SQL:
    INSERT INTO your_table (column1_name, column2_name, column3_name) VALUES (1, 'another value', 450);

    Insert data into multiple columns​

    SQL:
    INSERT INTO your_table (item_name, item_color)
    VALUES ('a boingle', 'blue'),
    ('a doingle', 'red'),
    ('a foingle', 'yellow'),
    ('a poingle', 'aqua'),
    ('a qoingle', 'green'),
    ('a shoingle', 'purple'),
    ('a loingle', 'orange');

    Delete a column​

    SQL:
    ALTER TABLE your_table DROP COLUMN column_name;

    Change the ordering of your columns in the database table​

    SQL:
    ALTER TABLE table_name CHANGE field_name field_name INT(6) AFTER another_field;
Back
Top