Question: NEED HELP WITH SQL PROBLEM. I wrote the code below and the error I'm getting. Please insert 4 transactions into your money table with the
NEED HELP WITH SQL PROBLEM. I wrote the code below and the error I'm getting.
Please insert 4 transactions into your money table with the following information. a. Use only cid=1 for the homework 1 b. type D: deposit, W: withdraw c. mydatetime the date and time when you insert the record. d. note Manually inserted for homework 1 e. Insert two deposits and two withdraws. f. Amount - a negative number for the W (withdraw), and a positive number for D (deposit). g. The 4 transactions should have different codes. h. The balance (the sum of the amounts) should not be negative for any customer.
Here is my code:
insert into Money_xxxx(code,cid,type,amount,mydatetime,note) values("1D",1,D,10000,GETDATE(),"Manually inserted");
insert into Money_xxxx(code,cid,type,amount,mydatetime,note) values("2W",1,W,-1000,GETDATE(),"Manually inserted");
insert into Money_xxxx(code,cid,type,amount,mydatetime,note) values("3D",1,D,10000,GETDATE(),"Manually inserted");
insert into Money_xxxx(code,cid,type,amount,mydatetime,note) values("4W",1,W,-15000,GETDATE(),"Manually inserted");
ERROR 1054 (42S22): Unknown column 'D' in 'field list'
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
