结构化查询语言

时间:2014-10-14 09:05:23

标签: sql

create table customer(
    custno number(10) constraint foo primary key,
    custname character(15),
    city character(15),
    phone number(10));

create table invoice(
    invo number(10) constraint inv primary key,
    invdate date(10),
    constarint c references customer(custno));

我无法创建第二个表并且对数据类型日期有疑问。如果我忽略了该属性(invdate),我仍然无法创建第二个表。请原谅。

1 个答案:

答案 0 :(得分:1)

create table customer
  ( custno    int constraint foo primary key
   ,custname  character(15)
   ,city      character(15)
   ,phone    int
  )
  go
create table invoice
  (  invo int constraint inv primary key
   constraint ck references customer(custno)
   ,invdate date
  )