|< < 37 > >|

Postgres Stored Procedures

A better function to convert dollars to euros

Really shouldn't hardwire the conversion rate.

Revised schema

create table account( account_id int not null primary key, account_number varchar not null, account_type varchar not null, balance numeric(10, 2) not null ); create table conversion( currency varchar not null primary key, to_rate numeric(16, 6) not null, from_rate numeric(16, 6) not null );
  • Conversion rates to/from dollars are recorded for various currencies.

|< < 37 > >|