You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was confused by the example on aliasing at the end of 03-sql-joins.
I don't think that changing all by-now remembered tables and field names is making the query clearer, just shorter. It is, however, harder to read, as one has now to concentrate extra hard to learn the new names. Why renaming the tables?
I would simplify the example as below:
SELECT
surveys.year AS year,
surveys.month AS month,
surveys.day AS day,
species.genus AS genus,
species.species AS species
FROM surveys
JOIN species
ON surveys.species_id = species.species_id;
Additionaly, I did not wanted to create an issue, just for that, but maybe it would be good to introduce aliasing much before it is done, so that learners are exposed to it, and can use it in examples and challenges of all episodes.
The text was updated successfully, but these errors were encountered:
juanfrh
pushed a commit
to juanfrh/sql-ecology-lesson
that referenced
this issue
Apr 16, 2020
Thanks for this observation @MathildeMousset. I think the reason to alias the tables is as you've mentioned - to make the query shorter - because otherwise it takes FOREVER to type. However, the speed comes at the cost of clarity! I think it would be worth hearing from people who have taught the lesson about the trade-offs.
(We do introduce aliases in a previous episode, so this is not the first time they appear, but we could maybe use them in more exercises so that people are familiar with them).
Discussion question: is it better to include the full table names (clearer, but longer) or alias them (shorter, but harder to read)?
I was confused by the example on aliasing at the end of 03-sql-joins.
I don't think that changing all by-now remembered tables and field names is making the query clearer, just shorter. It is, however, harder to read, as one has now to concentrate extra hard to learn the new names. Why renaming the tables?
I would simplify the example as below:
Additionaly, I did not wanted to create an issue, just for that, but maybe it would be good to introduce aliasing much before it is done, so that learners are exposed to it, and can use it in examples and challenges of all episodes.
The text was updated successfully, but these errors were encountered: