Solutions-Who was the string puller?

 

29. The tables account and bank_transaction

30. Via foreign key on bank_transaction referencing the table account, both have a primary key and connection to table name via the column name without foreign constraint.

31. Via the column name in the tables person and account.

32. 203993 and 203987

33. Use

select * from account where name 
like 'Sara%' or name like 'Philip%';

34. Use

select sum(amount) from bank_transaction 
where account_number_fk = 203987;

and

select sum(amount) from bank_transaction
where account_number_fk = (select account_number_pk 
from account where name like 'Sara%');

35. Use

select sum(amount) from bank_transaction
where account_number_fk = 203987
and date > "2014-10-22" and date < "2014-10-26";

36. Use

select account_number_fk, sum(amount)
from bank_transaction where date > "2014-10-22";

and

select account_number_fk, sum(amount)
from bank_transaction where date > "2014-10-22"
and date < "2014-10-26"
group by account_number_fk having sum(amount) > 10000;

Back to Tutorial