【发布时间】:2014-12-31 05:24:38
【问题描述】:
我正在尝试创建一个包含以下步骤的 SQL 代码的数据库脚本,并且
使用 MySQL Workbench 执行每个步骤以创建和填充新表
在 fooddb 中称为 recipe。
该配方表应包含以下对象变量的列:id(使用 auto
increment)、title、Instructions(只有一个字符串)、numServings 和 totalTime(in
分钟)。
编辑 3 - 2014 年 11 月 4 日 - 15:32... 我可能已经弄清楚了,但是我不太确定:
create table recipe (
RecipeID int not null auto_increment,
'RecipeName' varchar(300),
'RecipeType' varchar(100),
"Instructions" text,
NumOfServings int not null,
TotalTimeInMinutes int not null,
primary key(RecipeID));
insert into recipe values (0, 'RecipeName', 'RecipeType', "Instructions", 0, 0);
select * from recipe;
这有什么问题吗?
【问题讨论】:
-
如果您在软件开发环境中需要它,您可以考虑使用 Liquid Base 而不是脚本。
标签: mysql sql database create-table