开始使用免费开始使用

CREATE 您的第一个 TABLE

现在,您将开始实现一个更合理的数据库模型。为此,您需要为 professorsuniversities 这两个实体类型创建表。其他表会为您预先创建。

创建简单表的语法如下:

CREATE TABLE table_name (
 column_a data_type,
 column_b data_type,
 column_c data_type
);

注意:表名、列名以及数据类型不需要加引号。

本练习是课程的一部分

SQL 关系型数据库入门

查看课程

交互式实操练习

通过完成这段示例代码来试试这个练习。

-- Create a table for the professors entity type
CREATE TABLE ___ (
 ___ text,
 lastname ___
);

-- Print the contents of this table
SELECT * 
FROM professors
编辑并运行代码