In: Computer Science
Use ap tables
To test whether a table has been modified correctly as you do these exercises, you can write and run an appropriate SELECT statement. Or, when you’re using Oracle SQL Developer, you can click on a table name in the Connections window and then on the Data tab to display the data for all of the columns in the table. To refresh the data on this tab, click the Refresh button.
invoice_id
The next id in sequence (find out what this should be)
vendor_id:
32
invoice_number:
AX-014-027
invoice_date:
8/1/2008
invoice_total:
$434.58
payment_total:
$0.00
credit_total:
$0.00
terms_id:
2
invoice_due_date: 8/31/2008
payment_date:
null
NOTE:
SOLUTION 1:
insert into invoice(invoice_id,vendor_id,invoice_number,invoice_date,invoice_total,payment_total,
credit_total,terms_id,invoice_due_date,payment_date) select max(invoice_id)+1,32,AX-014-027,'8/1/2008',$434.58,$0.00,$40.00,2,'8/31/2008',null from invoice;
Explanation :
SOLUTION 2:
alter table vendors alter account_number set default 403;
Explanation :
SOLUTION 3:
update invoice set term_id = 2 where vendor_id = 2;
SOLUTION 4:
delete from invoice order by invoice_id desc limit 1;
Explanation :
SOLUTION 5:
rollback;
For verifying purpose execute 'desc vendors' and the default value for account_number should be 400 and not 403.