【问题标题】:When creating a table, is it possible to declare multiple columns to have the same type without repeatedly mentioning the type?创建表时,是否可以将多个列声明为相同类型而不重复提及类型?
【发布时间】:2017-12-21 16:10:56
【问题描述】:

在mysql中创建表时,如果我声明多个列具有相同的类型,是否可以在不重复提及类型的情况下声明它?

例如:

create table courseMarks ( mark1 integer, mark2 integer, mark3 integer, mark4 integer, mark5 integer, mark6 integer);

我在 google 上搜索了“mysql create table几个相同类型的列”但找不到解决方案,或者我错过了一些东西。

谢谢。

【问题讨论】:

  • 如果您有一长串数据类型相同且名称相似的列,如您的示例,则很可能是 Repeating Groups 的情况——违反了第一范式。

标签: mysql


【解决方案1】:

不,数据类型不可能不是兼性参数,您可以在 Mysql Documentation 中看到它

兼性参数在 [...]

【讨论】:

    猜你喜欢
    • 2016-07-03
    • 2020-03-31
    • 1970-01-01
    • 2023-03-24
    • 2021-10-18
    • 1970-01-01
    • 2016-09-25
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多