TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

PostgreSQL Exercises

420 pointsby pvsukale3over 7 years ago

11 comments

tekkkover 7 years ago
Very impressive! Works well, nice UI, informative.<p>After doing a couple exercises what I don&#x27;t like is the naming convention. Something like &quot;montlymaintenance&quot; or &quot;recommendedby&quot; are just hard to read and type and I&#x27;d much rather use snake-case and&#x2F;or shorter names. Eg. &quot;monthly_maintenance&quot; or &quot;maintenance_per_month&quot; or just &quot;maintenance&quot; if it&#x27;s explicit enough that it&#x27;s always per month.<p>Also to me using shorthands for ids is a bit hmm hmm I mean sure you write them a lot so it&#x27;s useful to spare your fingers when typing queries but &quot;facid&quot; just seems wrong. Again maybe underscore? &quot;fac_id&quot; or even &quot;facility_id&quot;.<p>Well that&#x27;s at least my opinion. Also would it be a better practise to use &quot;timestamptz&quot; instead of &quot;timestamp&quot;? And FYI I had to zoom to 125% because the font was so small on my laptop.
评论 #15861796 未加载
评论 #15860664 未加载
评论 #15860917 未加载
dansoover 7 years ago
This seems as good of place as any to ask novice-level questions about PostgreSQL. I teach students SQLite and one of the most massive pain points in transitioning to PgSQL is how the latter, in the `WHERE` clause, fails to recognize aliases in the `SELECT` clause, e.g.<p><pre><code> SELECT UPPER(name) AS bigname FROM people WHERE bigname = &#x27;JOE&#x27;; </code></pre> <a href="https:&#x2F;&#x2F;stackoverflow.com&#x2F;questions&#x2F;38040631&#x2F;postgresql-does-not-accept-column-alias-in-where-clause" rel="nofollow">https:&#x2F;&#x2F;stackoverflow.com&#x2F;questions&#x2F;38040631&#x2F;postgresql-does...</a><p>Apparently this is the SQL standard, which PgSQL seems to do a better job of following than SQLite, but I&#x27;m at a loss to understand why this computation is particularly problematic for PgSQL (or any variant) to adopt? Unlike other SQL standard rules that PgSQL follows that SQLite&#x2F;MySQL doesn&#x27;t (such as forbidding the selection of column names that aren&#x27;t being GROUPed by in a GROUP BY clause), this strictness seems to be all inconvenience.
评论 #15862703 未加载
评论 #15862637 未加载
评论 #15863315 未加载
评论 #15863767 未加载
Devacover 7 years ago
Cool.SQL Zoo <a href="http:&#x2F;&#x2F;sqlzoo.net&#x2F;" rel="nofollow">http:&#x2F;&#x2F;sqlzoo.net&#x2F;</a> is also worth recommending for beginners.
评论 #15861523 未加载
thibaut_barrereover 7 years ago
Neat - thanks for sharing!<p>In the SQL MOOC space, you can also check out <a href="https:&#x2F;&#x2F;academy.vertabelo.com" rel="nofollow">https:&#x2F;&#x2F;academy.vertabelo.com</a>.<p>If other people have resources, please share them out, I think this is an area where spreading the knowledge is particularly useful to most developers.
nik736over 7 years ago
Great idea, does what it should and can be extended to cover a lot more. Keep up the great work.<p>First time looking at it I thought I was on a official Ubuntu site, what a font and color can do to a branding is fascinating.
评论 #15860480 未加载
评论 #15861883 未加载
hultnerover 7 years ago
Did a few exercises and seems nice. An improvement would be if hints included links to PostgreSQL documentation, would make it easier for beginners to find good information.
genghisjahnover 7 years ago
Zipcode is an integer? What about zips in New Jersey?
评论 #15861901 未加载
评论 #15862412 未加载
koffiezetover 7 years ago
A suggestion: repeat the table names on every exercise in the description. I had been going trough them casually - and always forgot what the table name was and had to go back or press the &quot;show answer&quot; button.
nbrigmonover 7 years ago
i was just googling for these yesterday! this is great
antoaravinthover 7 years ago
Very good site. Just a question here, is there any book or tutorial which teach (like the site do) index&#x27;s, triggers, function etc?
bogomipzover 7 years ago
What a great tool&#x2F;site. Thanks for sharing!