create database ChinaMobile
use  ChinaMobile
create type xyz from char(22)
create table CustomerMaster
(
custId char(20) Primary key,
custName xyz not null,
custAddress  char(20),
custPassportNo not null
)create table NumberMaster
(
numNumber char(20) Primary Key,
numAmount not null,
numOffer char(20)
)create table ConnectionDetails
(
cnNO char(20) Primary key,
cnCutomerId char(20),
cnMobileNumber char(20),
cnDate datetime
)

解决方案 »

  1.   


    create database ChinaMobile --創建數據庫
    use  ChinaMobile create type xyz from char(22) 
    create table CustomerMaster --客戶管理基礎表

    custId char(20) Primary key, 
    custName xyz not null, 
    custAddress  char(20), 
    custPassportNo not null 
    ) create table NumberMaster  --序號管理基礎表

    numNumber char(20) Primary Key, 
    numAmount not null, 
    numOffer char(20) 
    ) create table ConnectionDetails  --關聯明細表

    cnNO char(20) Primary key, 
    cnCutomerId char(20), --外鍵:客戶管理
    cnMobileNumber char(20), --外鍵:序號管理(這個有存在疑問)
    cnDate datetime 
    )以上注釋都是根據字段名來定義的,如果定義不對,請樓下的糾正
      

  2.   

    其实我都知道
    create table NumberMaster  --序號管理基礎表

    numNumber char(20) Primary Key, 
    numAmount not null, 
    numOffer char(20) 
    ) 只不过这个表里面的属性分别指的是什么属性??????
      

  3.   


    create table NumberMaster  --序號管理基礎表 

    numNumber char(20) Primary Key, --序号
    numAmount not null, --数量
    numOffer char(20) --这个不清楚