DEV Community

Cover image for CRUD and SQL - the basics!

CRUD and SQL - the basics!

GrahamTheDev on January 08, 2024

What the heck is CRUD? Well it is used as a polite swear word in the UK, but in the context of software development it stands for: Create Read U...
Collapse
 
tpoisson805 profile image
Tim Poisson

Nice article and the graphics are very cool. It's worth noting that the quote syntax in these examples is specific to MySQL and not standard SQL convention. In PostgreSQL (which closely adheres to conventional SQL), for example, you will not see the use of backticks in a standard operation. In fact, you will typically not see quotes at all when referring to identifiers like table or column names unless the identifier contains special characters or is a reserved keyword.

For example, this is valid syntax in Postgres but not in MySQL:

UPDATE contacts
SET email = 'freddy@gmail.com'
WHERE id = 2;
Enter fullscreen mode Exit fullscreen mode

Just thought I'd point this out for anyone new(er) to SQL. Thanks!

Collapse
 
grahamthedev profile image
GrahamTheDev

Great point! However in your example you say that is not valid MySQL, but it would run fine? Is it not more of a best practices thing to use backticks in MySQL?

Collapse
 
marqitos profile image
Marcos Porto Mariño

I think the problem is that you should specify that you are using the MySQL syntax, and not standard SQL. Because for people without knowledge they may think that they are learning standart SQL.

Collapse
 
rickdelpo1 profile image
Rick Delpo

hey thanks @grahamthedev , nice writeup
If u want to see the Javascript equivalents to SQL CRUD check out this article
dev.to/rickdelpo1/crud-4-sql-comma...

Collapse
 
pranjalt24 profile image
Pranjal Tiwari

Its really a nice article which covers up the fundamental understanding of SQL with Commands and CRUD, thanks for sharing mate.

Collapse
 
grahamthedev profile image
GrahamTheDev

Happy new year everyone, a nice gentle and beginner friendly post to start the year off!

Let me know what you think. 💗

Collapse
 
jhelberg_63 profile image
Joost

Good article, clear for beginners. Please change to SQL without dialect though. It is not necessary to use MySQL dialect to prove your point.

Collapse
 
grahamthedev profile image
GrahamTheDev

Good suggestion, I did say SQL in the title! Not even sure why I went MySQL to be honest, I haven’t used it in ages lol.

Will change it at weekend 👍💗