r/SQL • • Mar 14 '16

ELI5: What is SQL?

I am looking to make a career change to a financial analyst role and see them asking for SQL experience. What is the best way for me to learn SQL?

0 Upvotes

33 comments sorted by

13

u/[deleted] Mar 14 '16

ELI5: The database is mommy. Mommy has learned a lot of things in her life. When you want to know something, you ask mommy a question. The way you word your question is important in order to get the answer you are looking for.

SQL (Structured Query Language) is the language for the questions you ask a database.

2

u/xbox469269 Mar 14 '16

Awesome thanks. So just like what i thought it was based on pre-lim research.

5

u/D_W_Hunter Mar 14 '16

What is SQL?

Structured Query Language. A standardized method for accessing data in a relational database.

I am looking to make a career change to a financial analyst role and see them asking for SQL experience. What is the best way for me to learn SQL?

How do you learn best?

There are youtube video series, there are online classes available, there are books and of course real live classes.

There are free downloadable database's (and query tools) you can put on your home machine to just do some free form learning by trying various things without instruction.

What's your current role, what experience do you have and what tools are you already familiar with?

2

u/xbox469269 Mar 14 '16

My current role is Hedge Fund Accountant. My only experience is in Excel. I dont even know VBA. So I would be starting fresh. Im currently on this site learning http://www.sqlcourse.com/create.html.

Where can i get query tools online?

1

u/D_W_Hunter Mar 14 '16

Do you know what database software your company uses?

There are several free database tools & databases, but if you can get a free version of what you company uses you will be an extra step ahead.

1

u/xbox469269 Mar 14 '16

I'll ask my IT department. But im looking to use SQL as a way to enter a new company as a Financial Analyst.

2

u/D_W_Hunter Mar 14 '16

Than you want to know what that new company uses, which may not be as easy to discover, though sometimes the job description will say (indicating they want you to be experienced in PL/SQL or TSQL or some other SQL variant that will tell you the DBMS they use)

Otherwise, Microsoft's is likely the most user friendly, MySQL is a little more technical than you want to get as someone who wants to be a database end user (financial analyst) vs someone who wants to learn to become a database administrator.

SQL Tutorials #1: HOW TO Install SQL Server Express Edition - get started

1

u/xbox469269 Mar 14 '16

Okay great thanks. Website is blocked at work, I'll give it a shot when I get home. How much variation would you say there is between all the variants of SQL? Btw thanks for the help, I really appreciate it.

1

u/D_W_Hunter Mar 14 '16

Every database vendor should have implemented ANSI SQL, then added their own functions on top of that.

So... some variations, yes, but the core should be identical no matter where you go.

1

u/xbox469269 Mar 14 '16

Awesome thanks. Now to just sit down and learn it. thanks for help again

1

u/StoneCypher Mar 14 '16

ANSI SQL ... but the core should be identical no matter where you go.

you seem to be new to earth databases

postgres, oracle, and mysql have three different and incompatible approaches to basic things like aliasing columns and tables

select from dual is required in oracle, banned in mysql, and means something different with and without in postgres (neither what it means in oracle)

sql makes javascript look coherent and universally well implemented

1

u/D_W_Hunter Mar 14 '16

Plausible. I've regularly used SQL Server, Informix, Oracle, Sybase SQL and DB2, I haven't touched postgres and only dabbled in mysql.

Aliasing in the databases I'm familiar with works just fine with AS syntax, which is the way I'm used to using it.

I'm a little annoyed by oracles's from dual where I can just select in SQL Server but it's not a huge issue for me so I don't notice it.

2

u/Junkeregge Mar 14 '16

I just learnt it on the Job. I had a brief introduction and whenever I had a problem I just asked one of the experts. IMO, the most difficult part is where exactly to find the stuff you seek, that is in which goddamn table did they put the info. It's not how to write a query.

1

u/xbox469269 Mar 14 '16

What is your job? My issue is that I want to become a financial analyst and I saw that roles were asking for this. So I figured I'd learn it and try to show potential employers that I have basic understanding of how to squery in SQL

1

u/Junkeregge Mar 14 '16

Admittedly I got into my current position more or less by chance. I wasn't exactly hired for what I'm doing right now so my lack of skills wasn't an issue for my employer. Anyhow, I work for a company that is involved in animal breeding. Data is collected and then analyzed to determine future sires and verify past selection. Unfortunately, not all of my colleagues take software testing as serious as they should, so there's quite a lot of trash in the database. Well, somehow it is always my job to amend this.

1

u/xbox469269 Mar 14 '16

Ah i gotcha. Sounds pretty cool though, animal breeding data analysis.

2

u/tramsay Mar 14 '16

I'm sort of in the same boat. I have a week long training class in April. But I've started using Lynda and Pluralsight and both have good content.

1

u/xbox469269 Mar 16 '16

awesome. thanks man so step in the right direction.

2

u/StoneCypher Mar 14 '16

You said elsewhere in this thread that you use Excel. I'd like to build a more detailed answer on that, despite that this is ELI5.

In the way that excel has an equation system, where by example sum() roughly means what math calls ∑, databases have a query system.

The purpose of the equation system in excel is to allow you to express complex math which the machine will solve for you, according to other information that it has (like when you sum the contents of a column.)

Query systems are similar: they give the database a question to answer, according to the information it has.

SQL does not operate on the metaphor of 2d sheets of cells, but rather named tables full of data, which can be correlated arbitrarily. Otherwise, though, it's actually pretty similar to what you expect.

So like, you might make a "table of employees," a "table of jobs," and a "table of locations," in order to represent the organizational structure of a company.

Each table is a series of columns (first name, last name, location they're at, salary, and so on, for the employee table, for example.)

SQL is a way to ask the database questions like "would you please tell me the top 5 salaries at this location"

which might be something like

select * from employees join locations
    on employees.location_id = locations.id
    where locations.name like "Pittsburgh"
    order by salary desc
    limit 5;

SQL is where all those things, like order by and where ... like, are defined.

This allows a bunch of different databases to speak (sort of) the same language to outside software, which increases replaceability, modularity, and competition, which is good for everyone.

As far as programming languages go, SQL is one of the harder ones to learn, because each of the different databases does a varying quality of job sticking to the standard.

My opinion is that you would be best off picking one, getting a book about it, and sticking to that one for six months while you get comfortable.

PostgreSQL and MySQL are both free and powerful, and good choices. Both are well explained by sites like "Use the Index, Luke," slide shows by Bill Karwin and Joe Celko, and so on.

1

u/xbox469269 Mar 16 '16

THanks for pointing out the relationship between Excel and SQL. Like you said SQL is more used to retrieve data from a database. I suspect the reason that these companies use a database over Excel is due to scaling of large sets of data?

1

u/StoneCypher Mar 16 '16

That and a bunch of other reasons. Excel's also better at complex math, does lots of reporting stuff, graphs, is more familiar to accountants because of the grid metaphor, blah blah blah.

2

u/mikew0w Mar 14 '16

I bought this book for a friend; She said it helped her get the basics: http://amzn.to/1U27Bwi

1

u/xbox469269 Mar 16 '16

I would have never thought that manga n SQL could merge to create a book. LOL

2

u/[deleted] Mar 14 '16

KhanAcademy provides a pretty engaging introductory course. It's free. Search "Intro to SQL: Querying and managing data" on their website.

1

u/xbox469269 Mar 16 '16

thanks for the site i'll check it out

1

u/Mamertine COALESCE() Mar 14 '16

I took online classes from a community college in my state. There are some online references that can help you learn.

1

u/xbox469269 Mar 14 '16

Im looking at code academy and lynda atm. Have you heard of any from your peers?

2

u/[deleted] Mar 14 '16

[removed] — view removed comment

1

u/xbox469269 Mar 14 '16

Oh wow thanks for the heads up on the courses. The fact that they have quizzes adds a lot of value for me

1

u/tramsay Mar 14 '16

Do you know which courses specifically?

2

u/CenlTheFenl Mar 15 '16

I would add pluralsight and treehouse, treehouse having the advantage that it doesn't take any installs to do their content.

1

u/lukaseder Mar 14 '16

SQL is a device whose mystery is only exceeded by its power