欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

创建数据表

程序员文章站 2024-03-21 11:00:58
...
CREATE TABLE dept1 AS department WITH NO DATA; 

 

CREATE TABLE dept1, NO FALLBACK AS department WITH NO DATA
UNIQUE INDEX (department_name);

 

CREATE TABLE SampDb.PhoneList
,FALLBACK
,NO BEFORE JOURNAL
,NO AFTER JOURNAL
(
   Number	 CHAR(10) TITLE 'Number' NOT NULL
  ,Name		 CHAR(25) TITLE 'Name' NOT NULL
  ,LType	 CHAR(4)  TITLE 'Line Type'
  ,Calls	 INTEGER  TITLE 'Calls Made' FORMAT 'zzz9'
  ,Take		 CHAR(1)  TITLE 'Important'
)
UNIQUE PRIMARY INDEX( Number );

 

CREATE TABLE PhoneUS
AS (
   SELECT * FROM PhoneList WHERE country = 'US'
   ) WITH DATA;