2016-04-08 31 views
0

だから私は、テーブルにデータを挿入について質問があり、ここで質問です:ここでMySQLのテーブルにデータを挿入する

Assume a database table: customers 

Assume these columns 

name  varchar(10) 

streetAddress  varchar)15) 

stateAbbreviation  varchar(2) 

balance  decimal(6,2) 

Write the SQL that will insert a record to the customers table with these values: 

name:  Jimmy 

streetAddress:  10 Main St. 

stateAbbreviation:  KS 

balance:  17.56 

は、私が出ているコードです:

insert into customers (name,streetAddress,stateAbbreviation,balance) values ('Jimmy','10 Main St.','KS','17.56'); 

私はそれが正しくないと言っているエラーを取得している、私は何を正しくしていないのですか?おかげ

+0

はきっともっと便利があります:数値を挿入し、その代わり

'17.56' 

をエラーメッセージ "どこかではない" ... – David

答えて

0

balance列はdecimalですが、文字列値を挿入しようとしている:

17.56 
+0

トリック、ありがとう! – user5953981

関連する問題