I'm trying to build an app involving my local lottery system and would need to store the numbers. Each draw has the following:
Since you are planning on querying the database with different queries I would recommend a standard SQL database and not a noSql approach. NoSQL databases really shine if the data to store is not so well defined. However, you have a clear pattern of data to store. Here is what I would suggest:
table drawing: ------------- id | date | draw_number | lottery_id table winning_number: -------------- id | number | position | drawing_id
With that design you could store the info if a number is drawn as extra number in the position field. If you know in what order all numbers are drawn you can store this too in the field.
id should be the primary key in each table. winning_number.drawing_id is a foreign key to the drawing table.
lottery_id is also meant as foreign key to a table that describes the parameters of the lottery system. maybe something like this:
table lottery --------------- id | total_numbers | country | whatever
Queries about frequency should now be easy. Ask, if you have further questions.