Is is possible to add sql commands after table creation

DbSchema Scripts, Schema & Synchronization
Post Reply
nulmanit
Posts: 2
Joined: Tue Feb 13, 2018 11:49 am

Is is possible to add sql commands after table creation

Post by nulmanit » Tue Feb 13, 2018 12:04 pm

Hi,
Is it possible to add SQL commands that will be added to the script after the "create table" statement?
such as insert into table?

Thanks,
Ilanit

LindaTovar
Posts: 1
Joined: Wed Jun 13, 2018 1:43 am

Re: Is is possible to add sql commands after table creation

Post by LindaTovar » Wed Jun 13, 2018 2:03 am

To create the recipes table inside recipes_database, we can use the CREATE TABLE command:

CREATE TABLE recipes (
recipe_id INT NOT NULL,
recipe_name VARCHAR(30) NOT NULL,
PRIMARY KEY (recipe_id),
UNIQUE (recipe_name)
);

INSERT INTO recipes
(recipe_id, recipe_name)
VALUES
(1,"Tacos"),
(2,"Tomato Soup"),
(3,"Grilled Cheese");

I'm not sure if this is true but we can try!

Post Reply