ddd-fun / intro-data-capstone-musclehub

0 stars 0 forks source link

Excellent joining query #1

Closed Caealana closed 6 years ago

Caealana commented 6 years ago
query = '''
select  v.first_name, 
        v.last_name, 
        v.gender, 
        v.email, 
        v.visit_date, 
        f.fitness_test_date, 
        a.application_date, 
        p.purchase_date
from visits v 
left join fitness_tests f on v.first_name = f.first_name and v.last_name = f.last_name and v.email = f.email
left join applications a on v.first_name = a.first_name and v.last_name = a.last_name and v.email = a.email
left join purchases p on v.first_name = p.first_name and v.last_name = p.last_name and v.email = p.email
where v.visit_date >= '7-1-17' 

Great job on crafting a working joining query that pulls together all of the necessary components!