Q:

MYSQL Join three tables and group by joined date

I am a MySQL beginner so please be patient with me! 
I have three tables
1-Order 
Order Id | Order Date 

2-users
user Id | Registration date

3-connection
user Id | Order ID

I am trying to calculate conversion rate grouped by date 
The conversion rate, example, 300 users registered in January 2013, and 100 of them made one or more purchases, the conversion rate of the registered user to purchaser is 33%
so the final output should be 
table 
date    | number of registered users | number of orders | Conversion rate  

Jan-2011|            300             |         100      |     33%

many thanks for the help! 

A:

I think something like this is that you need: 
select u.registrationDate as date, 
       count(distinct u.id) as number_of_registered_users,
       count(distinct o.id) as number_of_orders,
       round(count(distinct o.id)/count(distinct u.id)*100) as conversion_rate
from users u 
left join `Order` o on u.registrationDate = o.orderDate 
left join connection c on c.orderId = o.id and c.usersId = u.id
group by u.registrationDate;

See SQL Fiddle.

