SQL 新手問題............

CREATE Database ASS;

use ASS;

CREATE TABLE Staff
(staffNo CHAR(5) NOT NUll,
fname VARCHAR(20) NOT NUll,
lname VARCHAR(15) NOT NUll,
postion VARCHAR(15) NOT NUll,
sex CHAR(1) NOT NUll,
DOB DATE,
salary NUMBER(7,2),
branchNo CHAR(4),
CONSTRAINT Staff_staffNo_pk PRIMARY KEY (staffNo),
CONSTRAINT Staff_branchNo_fk FOREIGN KEY
(branchNo) REFERENCES Branch(branchNo));

點解佢話個salary NUMBER(7,2),出錯??
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for
the right syntax to use near 'NUMBER(7,2),
branchNo CHAR(4),
CONSTRAINT Staff_staffNo_pk PRIMARY KEY (staffNo)' at line 8

[ 本帖最後由 vincent1989 於 2009-3-14 12:33 編輯 ]

NUMERIC(7,2)

TOP

MYSQL 冇 NUMBER 依個 type
請用 DECIMAL, NUMERIC, FLOAT 或 DOUBLE

TOP

THX!!!!!!!
感謝主!!!!
比我遇到你
你係我既恩人
!!!!!!!!!!!!!

TOP

其實我係阿SIR份Notes Copy出黎.........
想睇下係點...........
點知搞左2個鐘.............都唔知錯咩
估唔到 IVE 既 Notes 都可以錯..........

TOP

點先可以Delete 唔要既 table ??

TOP

DROP TABLE table_name;

TOP

回覆 6# 的帖子

DROP TABLE {table_name}

TOP

原帖由 vincent1989 於 2009-3-14 12:51 發表
其實我係阿SIR份Notes Copy出黎.........
想睇下係點...........
點知搞左2個鐘.............都唔知錯咩
估唔到 IVE 既 Notes 都可以錯..........


IVE 係咪教 Oracle 呀? 你用緊 MySQL喎

TOP

佢係教SQL..........
但係佢叫我地唔好聽佢講 , 因為一定會唔識 , 叫我地自己去買書學.........
!@#$%^!@#$%^
都唔知咩阿 SIR !!!

[ 本帖最後由 vincent1989 於 2009-3-14 14:38 編輯 ]

TOP