3 ms·
Ideally, yes you should be able to understand and recall all of the basic commands: - DDL: create, drop, alter, truncate - DML: insert, update, delete, call,
by financltravsty 3y ago
Ideally, yes you should be able to understand and recall all of the basic commands:
- DDL: create, drop, alter, truncate
- DML: insert, update, delete, call, explain, lock
- TCL: commit, savepoint, rollback
- DQL: select
- DCL: grant, revoke
If you've used them before, you'll have a good enough intuition to understand what each does and when to bring them out of the toolbox. Some database engines have extended versions of these or other ways to achieve the same result, but the underlying concepts are the same.
From there, you should be able to create a basic SELECT statement, and understand the basic flags:
- FROM
- WHERE
- GROUP BY
- HAVING
- ORDER BY
- LIMIT
Then understand joins and how this is all just relational calculus/algebra with sets.
Honestly, I couldn't list these off the top of my head, but I know what each one does when I see them, and I'll instinctively reach for them when I'm writing SQL. But once you know all of this, you know 80% of the SQL you will ever need, and won't have to reach for an ORM. It only takes one weekend to grok SQL, but it will serve you for the rest of your career.
- FirmwareBurner 3y ago>It only takes one weekend to grok SQL, but it will serve you for the rest of your career. Can't agree on that. If I don't use a language or certain concepts I learned more than 6-12 months, I forget it. Groking something in one weekend that you won't immediately put to use then it gets immediately flushed by the garbage collector. At least for me.