jmbejara / comp-econ-sp19

Main Course Repository for Computational Methods in Economics (Econ 21410, Spring 2019)
48 stars 26 forks source link

SQL Joining Data Q3-5 #56

Closed jonhelium closed 5 years ago

jonhelium commented 5 years ago

I'm having some issues trying to get the exact correct output for questions 3-5 in the Joining Data SQL assignment: I'm fairly confident that I'm outputting queries that match what each question is looking for, but it seems that the feedback system wants a query that is exactly a specific order (in terms of rows). It seems to me that the order of the queries that I output changes when I name or space things differently in my query, even though this naming should not be that substantial. For instance, the following code block

""" SELECT a.id, a.body, a.owner_user_id        
      FROM 'bigquery-public-data.stackoverflow.posts_questions' AS q        
      INNER JOIN 'bigquery-public-data.stackoverflow.posts_answers' AS a ON q.id = a.parent_id        
      WHERE q.tags LIKE '%bigquery%'         
"""          

does not give me an output with the same order of rows as

""" SELECT pa.id, pa.body, pa.owner_user_id        
      FROM 'bigquery-public-data.stackoverflow.posts_questions' AS pq         
      INNER JOIN 'bigquery-public-data.stackoverflow.posts_answers' AS pa         
              ON pq.id = pa.parent_id         
      WHERE pq.tags LIKE '%bigquery%'         
"""

Is it okay if we get queries that match what the questions are asking for but do not perfectly align with the order that the feedback system wants?

jmbejara commented 5 years ago

If they're the same, outside of order, that should be fine.