建立你的第一批 TABLE
你現在要開始實作一個更好的資料庫模型。為此,你會為 professors 和 universities 這兩種實體建立資料表。其他資料表會替你建立。
建立簡單資料表的語法如下:
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