Link to home
Start Free TrialLog in
Avatar of amirmaster
amirmaster

asked on

percentage growth of the last 30 days compared to the total

Given a table 'mailing':

CREATE TABLE mailing (
      addr VARCHAR(255) NOT NULL
);

The mailing table will initially be empty.  

New addresses will be added on a daily basis.  

It is expected that the table will store at least 10,000,000 email addresses and 100,000 domains.

Write a script in perl or python that updates

      another table which holds a daily count of email addresses by their domain name.

Use this table to report the top 50 domains by count
      sorted by percentage growth of the last 30 days compared to the total.
** NOTE **

- The original mailing table should not be modified.

- All processing must be done in Perl or Python (eg. no complex queries or sub-queries)

- Submit a compressed file(tar/zip) with the files required to run your script.
Avatar of Rob Farley
Rob Farley
Flag of Australia image

This sounds like an exam question. And it's not a SQL question if you're not allowed to do use a query to do the work.

In SQL, you could easily query the top 50 by count, joining it back to a query which counted the ones that appeared more than 30 days ago, ordering by one divided by the other. But that's not what this (exam) question is asking - it wants you to do in perl, and I doubt you'll get many marks when your instructor finds you've given a result posted on the web.

Rob
Avatar of amirmaster
amirmaster

ASKER

I did it my self
ASKER CERTIFIED SOLUTION
Avatar of amirmaster
amirmaster

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial