I have a data set of credit card transactions.  

create table trans (
  card_id int,
  amount int
);

insert into trans values (1, 1);
insert into trans values (2, 1);
insert into trans values (3, 1);
insert into trans values (4, 1);
insert into trans values (5, 1);
insert into trans values (5, 1);
insert into trans values (6, 1);
insert into trans values (6, 1);
insert into trans values (7, 1);
insert into trans values (7, 1);
insert into trans values (8, 1);
insert into trans values (8, 1);
insert into trans values (8, 1);
insert into trans values (9, 1);
insert into trans values (9, 1);
insert into trans values (9, 1);
insert into trans values (10, 1);
insert into trans values (10, 1);
insert into trans values (10, 1);
insert into trans values (10, 1);


I desire to know:

1. how many cards were used to make at least 1 transaction
2. how many cards were used to make at least 5 transactions
3. how many cards were used to make at least 10 transactions
4. how many cards were used to make at least 20 transactions
etc...


SQL:

select count, sum(count2) from
  (
  select count, count(*) count2 from
    (
    select card_id, count(*) count
    from trans
    group by card_id 
    ) d
  group by count
  ) d2
where count&gt; {is at least __} /*this is the part causing an error*/
group by count
order by count


You have an error in your SQL syntax...

http://sqlfiddle.com/#!9/705b5/5


Question: Any smart way to get the interest down on our student loans?
Answer: There was another question about using a credit card to lower their student loan payments. There are drawbacks that will also apply in your situation regarding a HELOC or 2nd mortgage:


Make sure you understand the interest rate. If it is not fixed you could have made your situation worse. 
Monthly Payment. The repayment period of the HELOC or 2nd mortgage will greatly influence the monthly payment.
Closing costs?
There is no going back. If you want to switch back to a student loan you can't. 
Can you get a get a loan big enough? You need 72K, with only 40K in equity. Gone are the days where the loans could exceed the houses value at the start of the loan.
Tax implications?
Forgiveness programs. Some employers will forgive parts of the loan, or if you work in public service for X years they forgive some of the loan. They will not view the mortgage  debt the same way.