When & where to use SQL?

When & where to use SQL?
0.0 0

#1

Greetings gang,

Can I please get some clarification into SQL and what should I learn pre/post SQL?

A quick background on me, I’m a frontend designer. My wife wants to take a SQL course because she believes it’ll help her leap frog other folks at work to pull her own reports & data. I thought it would be a great opportunity for us to both take this course and do something together.

That said, I have minimal backend dev understanding and wanted to see if I could get a really elementary overview of SQL, what should I learn before and/or after SQL in order to use it, and possibly a scenario where it might fit into my daily workflow as a designer/dev.

For example, does it make sense to first learn databases (MySQL) and how to set one up before taking SQL? Should I learn some PHP afterwords to actually do something w/ the data? While I wont be using it much, I’d be nice to have the 4th grade introduction overview of the who, whats, whys, and whens of SQL =)

'preciate any help.


#2

IMHO, you should probably get some basic understanding of databases before starting to learn SQL. Then start practicing queries. Probably should decide which syntax you will learn (I think MySQL is Oracle so you will learn PL/SQL. I’m sure someone will correct me if incorrect). Then learn how to integrate the database into a project (this part I have yet to do myself). That’s how I would structure it.


#3

Right on! Thanks for the insight here.


#4

Hello, sql/mysql/php are strictly related, i think the best way to learn it is understanding how they interact and how to use them for a small project. Once you get accustomed to that you will get ideas for bigger uses. I can tell you from my experience that the best way is to start to understand how a mysql archive work, after how the sql commands are used to interact with that archive and lastly use the php to build your pages. I may be wrong coz everything i have learned this far is self learned, but that worked out well for me. You can start downloading a small php/mysql project and study it. (I started with a big one but that’s because i’m a masochist :stuck_out_tongue: ) . Good luck. And sorry for my bad english.


#5

Guess that someone will be me :slight_smile:

Oracle the company owns MySQL, but only Oracle the DB speaks PL/SQL – MySQL still speaks its own dialect of SQL. These days, if you do an open source project with MySQL, chances are you’re going to use MariaDB instead, which is the fork of MySQL maintained by the community rather than Oracle.

If you learn a SQL database, do yourself a favor and learn the actual SQL data model, including concepts like normalization and transactions. If you just slap a high level library like an ORM on top and use it for storage, you may as well use a nosql database like Mongo. This isn’t to say ORMs are bad, but if you want a marketable skill in RDBMS work, they’ll expect you to know the low-level details.


#6

As for what to learn pre/post SQL: there’s nothing to learn beforehand; just download a database and start playing with it (I far prefer PostgreSQL over MySQL, but either will get you started). Tutorials abound, but I don’t know specific ones to point you at, sorry. As for what you learn after… SQL databases are complex things and therefore a very large subject, so I would concentrate on reading through the entire manual for your chosen database and trying to understand everything in it, at least superficially.

If you want to develop apps for databases, learn an object-relational mapper (ORM) but try to get a sense of when they’re appropriate and when raw sql queries are better. If you’re more interested in being a DBA, learn the operational side of things like replication, backup and restore, and performance tuning. Whichever angle you choose, you’ll definitely want to learn about transactions and different levels of normalization (don’t imagine you have to memorize them all, 3NF is as far as any sane person goes).


#7

Great info! This definitely gives me a better idea of the time needed to learn something like this. Again, I’m more interested in a general/high level understanding so this is all great info to know!

Thanks again!


#9

I just wanted to pull this out to emphasise it! If you can learn to think about the tables in your db throigh the lens of normalisation, you’ll have far few headaches down the track. Normalisation is basically about getting rid of redundancy and repetition between tables so you can link entries between tables cleanly - but it’s a little more complicated than that, so look into it :slight_smile:


#10

SQL is actually really easy. At least for most common things. Get sqlite3 (it’s super lightweight and easy to use) and play with it. Find a beginner’s SQL tutorial. If you find them confusing, contact me and I’ll make one for you.

Stay away from MySQL. MySQL is barely or not at all a database.

Here’s a quick screencast I just threw together with a demonstration of all the basic functionality you’ll need to write an application.


#11

Codecademy also has a SQL course, that could be helpful if you don’t want to install stuff. Querying dbs shouldn’t be that hard.
Database design on the other hand is a totally different beast.
It’ll probably be best to learn some server side language first though.


#13

Oh yes @LookOnTheBrightSide totally forgot about SQL on Codecademy! That is definitely where I will start. I’m a front end guy and don’t really have any desire other than just to “understand” at this point. Great suggestion! I appreciate it.


#14

Appreciate the help @ShawnMilo Again - not looking to be an expert, just enough to understand it. Hell, if I do enjoy it, who knows - but with my understanding I’m just trying to connect the dots as of now =)

Again, thanks for the hand & kindness.


#15

You make very good points about the market for MySQL, but I’m always going to push back against this trend that the best way to learn is to learn what industry uses. Industry uses a whole lot of utter crap, and learning should be done on the platforms that are the least broken. The sorry state of industry standards has only ever improved when people have learned that there are better ways to do things.

So yes, learn MySQL. After you learn something else.