I need to create dummy data for a presentations.
I have been given 10 records which I need to copy them and change their date each time for every day of the month. Then I need to delete random records per date ranging from 0 up to 4 records each day (so they seem more random data)
A simplified example
dummyId Name onDate
1 xd 2016-07-01
2 gd 2016-07-01
3 yd 2016-07-01
4 ad 2016-07-01
5 bd 2016-07-01
6 zd 2016-07-01
7 md 2016-07-01
8 qd 2016-07-01
9 nd 2016-07-01
10 dd 2016-07-01
11 xd 2016-07-02
12 gd 2016-07-02
13 yd 2016-07-02
14 ad 2016-07-02
15 bd 2016-07-02
16 zd 2016-07-02
17 md 2016-07-02
18 qd 2016-07-02
19 nd 2016-07-02
20 dd 2016-07-02
..
In the above example the records of the 1st of July where copied over having date 2d of July. This will go on for every July date. After that I need to delete from every group of dates [except from 1st of July] (Group By onDate) 0-4 records so the data to seem random.
eg below 3 records deleted for 2d of July
dummyId Name onDate
1 xd 2016-07-01
2 gd 2016-07-01
3 yd 2016-07-01
4 ad 2016-07-01
5 bd 2016-07-01
6 zd 2016-07-01
7 md 2016-07-01
8 qd 2016-07-01
9 nd 2016-07-01
10 dd 2016-07-01
11 xd 2016-07-02
13 yd 2016-07-02
14 ad 2016-07-02
16 zd 2016-07-02
17 md 2016-07-02
18 qd 2016-07-02
20 dd 2016-07-02
..