How hard is it to learn SQL if you already know how to program...

How hard is it to learn SQL if you already know how to program ? I know it's a query language but do I really have to study it that much to get it enough to say I know it?

Attached: SQL-logo1.png (300x251, 41K)

Other urls found in this thread:

sqlzoo.net/
techcrunch.com/2017/08/29/salesforce-is-using-ai-to-democratize-sql-so-anyone-can-query-databases-in-natural-language/
lagunita.stanford.edu/courses/DB/SQL/SelfPaced/about
twitter.com/NSFWRedditGif

You don't know programming if you haven't used SQL before.

SQL is a declarative language meaning you basically tell it what to retrieve for you versus explicitly programming something.

PLSQL or TSQL is more programming oriented with your loops, etc.

Not really difficult. If you learn the syntax of select and update calls, you're alright. I don't think anybody would mind if you need to look up the syntax for defining tables etc.

What
What's the difference between all these sql? Do I have to learn them all?
So I'm good just getting a reference book?

Is not that hard, in 2 hours you'll know how to do basic selects, and even joins.
If you are planning to manage a database and build it from zero, then we are talking about , gross guesstimate, 5-10 hours for basic commands
The real hard part is learning the inside outs of the several dialects that are supported by the different RDBMS.
>MSSQL and i don t remember which other supports Transact SQL
>Oracle supports T-SQL
>MySQL does its own thing
>Postgresql does its own thing
Also, do yourself a favor and if you need to design a database schema, read some theory first. I had lost count on how many times I had laid eyes on revolting unsecure designs because some ((dev)) thought: IT WERKS

In the time it took you to post this you could have learned it.

>So I'm good just getting a reference book?

Personally, I just use the documentation from the mysql web page if there's some specifics I'm forgetting, but most of the time you'll just be doing
"SELECT fieldname FROM tablename WHERE secondfieldname="penis"; or something.

the set theory in math helps you understand joins in sql

Attached: UI25E.jpg (966x760, 154K)

Oh I like set theory that's cool
I just need a job!

How to learn 1C

SQL simply retrieves stuff from the DB for example:
SELECT * FROM db.table WHERE column1 LIKE 'N%';
this will return all columns (*) from the table (group of columns) called "table" in the database called "db", where the contents of column called "column1" start with the letter 'N'

TSQL (Transac-SQL) is the MS brand of SQL, same shit different flavor for the syntax in certain spots. MySQL is the same way, but it's closer to Oracle SQL cause they're both owned by Oracle, but MySQL is free.

PLSQL(Oracle Procedural SQL)will allow you to do stuff like make for loops and functions and then call them in your sql statements, allowing you to do stuff like iterate through your results and call other functions on certain ones. Basically it gives you a lot more freedom at the cost of complexity.

Usually pure SQL is enough to do most things you will ever need, for entry level you won't really need to know much about the procedural ones, just know that they exist and what they do.

Also be aware that other types of databases exist that do not use SQL, such as mongo db which uses JSON instead of SQL.

Recommended resources for learning SQL?

>>SQL is a declarative language meaning you basically tell it what to retrieve for you versus explicitly programming something.
this is what makes it a fucking pain in the ass once you get past the basics. I guarantee you you'll bang your head against the wall with SQL because you'll know how to specify a procedural algorithm to select exactly what you want, but be unable to come up with the same thing in declarative form.

>Intro to database exam in 2 days
>haven't even stared learning

Attached: 1525804422614.jpg (2048x1536, 260K)

>*tips fedora*
>*takes fat rip from vape*
amen, /b/rother

half of these are wrong btw

2 days is not enough to learn database theory, user.

I bet you've never read SICP.

It 100% is

>first job interview fresh out of college for a QA tester position
>*thick Indian accent* Ok user please do the needful and answer these SQL questions
From that day on, I gave up on software development because they ask you irrelevant shit that you could learn as you get hired and the industry of full of street shutters. I'm much more happy with the path I chose, still get to work with tech and not get paid peanuts for it.

What do you do?
Also yeah sql being something people ask about is ridiculous. All relevant sql can be picked up in the first week on the job when they retrain you anyway

you can pretty much learn the basics of it in a few hours.

sqlzoo.net/

The actually useful stuff in database theory is very little. 2 days are certainly more than enough to learn anything you will ever need to actually work with a database (the rest is DB-specific).
Now, for a test, it's a different story, as they are often loaded with unnecessary shit.

Basic stuff is easy, if you want your shit to be performant as well then you better know how shit actually works.

Nah

Yah.

Due stop

I got a free udemy pajeet course for postgresql.
How fucked am I if I learn postgresql over MSSQL? Most companies over here use MSSQL afaik

Not terribly. But sure, the differences in SQL server capabilities and dialects suck a bit.

Surprised it is not MSSQL on the pajeet course though. The Microsoft stack is shit.

Or just run your queries against it and have the query planner tell you what it does and fuck around with it til you think it l1ooks ok

honestly I like using MSSQL at work way more than Postgres at home, it's so much easier to shit out nice looking queries in the former

Why use postgresql at home then?

Oracle's procedural language is PL/SQL. You can also use Pro*C if you already know C/C++ well.

It was my favorite before I started using MSSQL, and the old Unix SysV box I use for most of my autistic endeavors at home can't support it anyway. I've seriously considered busting out a new system/VM for it though.

It's not really all that big a deal, though. And to actually answer the original question if you're the one who asked it, if you've used one you can figure out the other quite easily. The fundamental concepts are still the same.

Unix sysV?

As a guy who writes SQL all the time and loves doing it, I think it's frustrating to watch people struggle with stuff like that. I don't know what it is, but I've occasionally met people who just "get" SQL and don't need any handholding through understanding how it works and I have no idea how to get through to people who struggle with it.

Most courses don't get into the things that really show the differences between the two dialects, especially if you're taking them to get a feel for actually writing SQL (as opposed to being a DBA). Can you give us a list of the titles for the course videos or a course summary or something like that?

Can you be my mentor

I keep an HP-UX system around mostly for fucking around with and testing C89 code with a stricter compiler, since it's quite reliable and on 24/7 anyway, I also use it for my local web and database hosting.

>write SQL all the time
Sounds like a shitty, repetitive job that's gonna get AI'd real soon. It's already happening
>techcrunch.com/2017/08/29/salesforce-is-using-ai-to-democratize-sql-so-anyone-can-query-databases-in-natural-language/
And quite frankly you sound like an asshole who isn't even half as smart as he think he is.
>I'm good at X and I can't understand how someone doesn't just "get it"

Screw you. I wish I was him

Unless you're a brainlet, no, you don't. He's basically writing plain HTML with nothing but the tags for a living.

Go full stack or embedded, or stay home.

SQL was a mistake. Using it isn't particularly hard. The theory behind it is relatively straightforward, hell database normal forms are pretty logical even. The problems ultimately stem from the fact the language is fucking declarative and that things like fully normalized databases will likely be doing more joins and other performance killing shit, or at least make it hard to partition data.

Sadly this legacy cucked bullshit won't be leaving us anytime soon.

Which ones are wrong?

Frankly? All of them. Joins are more like Cartesian products, not Venn diagrams.

Exactly. And because of how the data is accessed, it doesn't matter if you normalize the data or not, either way complexity of the queries themselves grow in a nonlinear fashion. Thank Jebus for multicolumn indices.

>because simplified representations aren't useful to anyone
Autism speaks.

I work in data conversion of really fucking big systems. So I write tons of SQL every day. It boils down to repeating the same steps over and over. It basically goes like this:
creating tables
altering tables
updating tables
making transformations based on requirements documents which involves select case statements and joins
then updating tables again
So if you can do all of that you're pretty much good. And I agree that's a job that will be AI'd out of existence in the next 5-10 years.

Showing cross products is much better than Venn diagrams for visualization.

>doesn't even mention constraints or indices
Seriously, you need to shut the fuck up.

>Showing cross products
That's implied.

And that's why I said it BASICALLY goes the way I said. I stated what the majority of my day to day is. Indices take literally 2% of my fucking time. So choke on my dick.

>tl;dr you're doing glorified data entry
If indices and constraints are of no concern to you, then the data is
>a) super simple
or more likely
>b) static, as in, you do some shitty ETL procedures, and the dataset is stored your job is done

>so desperate for sexual attention he's begging it from males online
That's sad. I guess data entry doesn't pay well enough to get some help from an escort service.

>projecting your sexual starvation while trying to flex on an anime imageboard

Attached: 1535112977584.jpg (700x835, 157K)

It's not that hard and 90% of developers just need to know the basics, unless you're developing business intelligence shit or you want to be a DBA or something.

>get reamed online for bragging about doing data entry for a living
>n-n-o u
Pathetic.

Well I wouldn't go that far. There are many useful applications that lack a DB.

NOT EXISTS
NOT EXISTS

Just go on w3schools SQL course to get a plebian understanding of it and you'll get the hang of it.

>gonna get AI'd real soon. It's already happening

This always works, right? Automating development is the best - it's always perfect or even remotely usable, that's why wysiwyg editors are now the dominant way of doing web development. Thank god for Adobe Muse and Wix - the best ways of doing any development ever.

Also, thank god business users also know what they're looking for, and what they're asking for when they ask for information - that way we can just have them do it themselves. And thank god they always seem to ask questions that can be done in a single query with no subqueries. Man the world is just so perfect, everything in that Techcrunch article is just so perfect and amazing.

>Everybody that works in BI gets btfo'd instantly

>read some theory first

Link nigga

I don't care . He's better than me

I need a job user

>talk about automating away the job of a data entry pleb
>go to an irrelevant rant about not being able to automate everything
>end rant by conflating data entry with data science and BI
All I can say is
>absolutely seething

... I write SQL all the time because I work in BI. Who does data entry with SQL? It's you who clearly has no idea what you're talking about if you consider BI and data science the same thing.

I thought I saw a reference to data scientists in that post, reread it, there were none, my bad. Still talking about writing subqueries as if it you were an astrophysicist is just laughable. It's babby tier.

Also your entire argument hinges on the techcrunch article being a complete lie. So much cope it's painful.

easy to learn
not so easy to master

The worst is when is a lot of logic is put into queries. It can be very tiring to read. It's somehow gets worse than reading normal code.

And yet, it's something I see "full stack developers" struggle with all the time. There's a complete lack of ability to envision the output of a query as just another table. It's exactly that kind of thing that I find frustrating. It IS simple, and yet developers, who are otherwise perfectly competent, can't seem to get it right. This is exactly what is frustrating.

When I see an AI that can, without a fuckton of training in the area, take a question like, "What brands should I be talking to, to get more money?" and convert that into the real question, "What brands should we be carrying in our new warehouse to minimize shipping costs while maximizing revenue based on the fact that we otherwise send out separate orders to a 3rd party fulfillment company to fill missing items?" and figure out that it needs to come up with a broad strategy for the next few brands to target, but also take user input to exclude brands that the business user knows aren't going to sign, and write the query for that, then maybe I'll think it's worth something.

Writing a single query isn't rocket science either, and citing a Techcrunch article that only has examples of doing so is "laughable. It's babby tier."

I'm going to resist the urge to tell you my educated opinion about the true complexity and depth of what you do for a living in comparison to these "full stack developers who don't have instant recall regarding SQL", and just concede that I agree, we're not at a place where BI people are eternally BTFO'd by AI.

its literally the english language.

Attached: reac1.png (314x199, 22K)

>No, son.
>SELECT 'No, son.' FROM DUAL

No, son.

Screw MySQL, nosql is better anyway. And you don't even have to learn it, it's a literal hashmap.

please do the needful sir

All of them. SQL join is not a set operation.

>SQL join is not a set operation.
(not true, by the way)

you can learn the basics in one day
after that you should also look into
1) indexing
2) normalization
3) read about the most common pit falls
after that you should be more proficient than 50% of the SQL users

Sounds like you guys are typical >"select * from" sql "programmers".

No, the guy you are responding to is right. Venn diagrams are a misleading way to think about joins. How are you going to represent a cross-join as venn diagram?

>he thinks nosql deprecates sql

>hrm, why is the query so slow.
>NOLOCK
>NOLOCK
>"fixed!"
Yeah, he'll be better than 50% of "sql devs", but he won't be a decent sql dev yet.

It takes maybe 90IQ to use properly, and 110IQ to design databases

You don't know programming if you know SQL.
Real engineers make their own shit, and they don't work on boring end-user shit.

SQL is literally for retards. That's why it took off.

SQL is basically four statements
select, insert, update, delete
the tedious part is marshaling data back and forth between $LANG and SQL
which is probably why you are using an ORM and not SQL in the first place

This is sadly true
I haven't found a candidate yet with SQL on their resume who can explain third normal form in an interview
I would accept as little as "so help me Codd"
zero candidates

I've used SQL for a decade and I can't explain it either. Not because it's difficult but because no one uses the terms in real life. I obviously always design normalized dbs but is it in 3rd or 4th form? No idea.

I use the oracle version, very easy once you know how to use WITH()

>I've used SQL for a decade and I can't explain it either
sounds like an old person who is proudly computer illiterate to me
>I obviously always design normalized dbs
clearly doesn't know the difference between OLAP and OLTP
no offense intended, but you sound stuck in the expert beginner phase
you can do much better
please study further and better yourself

Attached: ExpertBeginner.jpg (413x777, 25K)

dont learn it, Python can execute queries, for example Django has a psycopg2 package

Who actually normalizes their tables lmao

>admitting he doesn't know when normalization is appropriate
>openly brotato
I'm sorry user, but you don't seem like a good cultural fit

Which you still need to know SQL to make queries. hurr.

no, you write the queries in python, then python translates them into SQL

I moved from engineering to programming by learning SQL at a startup. I thought I was hot shit writing my tight, efficient, layered subqueries and deriding joins as inefficient tools.

Then I got a job where every project has its own server, the schema ranges from "somewhat consistent" to "the guy who has been here three years doesn't know where to find stuff sometimes", and a query to get basic data has nightmarish sections like this:

FROM
report.kpi_level_2_results kl2r
LEFT JOIN
report.kpi_hierarchy kph ON kl2r.pk = kph.session_kpi_results_fk
LEFT JOIN
probedata.session prs ON prs.pk = kl2r.session_fk
LEFT JOIN
static.stores stsr ON prs.store_fk = stsr.pk
LEFT JOIN
static.state stst ON stst.pk = stsr.state_fk
LEFT JOIN
static.kpi_level_2_target kl2t ON kl2t.pk = kl2r.kpi_level_2_target_fk
LEFT JOIN
static_new.manufacturer manufacturer ON manufacturer.pk = kl2r.numerator_id
LEFT JOIN
static_new.product product ON product.pk = kl2r.numerator_id
LEFT JOIN
static_new.brand brand ON brand.pk = kl2r.numerator_id
LEFT JOIN
static.custom_entity custom_entity ON custom_entity.pk = kl2r.numerator_id
LEFT JOIN
static.kpi_result_value krvalue ON krvalue.pk = kl2r.result
LEFT JOIN
static.kpi_result_value krvalue2 ON krvalue2.pk = kl2r.target

My boss at the startup told me that he knew guys that would write SQL queries that would parse years of data and take days to run just to get final values for stuff.

So in short, like every other programming language, it is easy to learn, hard to master.

>getting ripped off by Oracle

lagunita.stanford.edu/courses/DB/SQL/SelfPaced/about

Much appreciated.

SQL is like PHP, you just write things down and drop the bat script on the exe files.

I love comments like this...
> ford or chevy?
> bro what kind of idiot are you, any respectable person would buy a mill and just make your own car

Some of us arent children that think recreating the wheel is a good way to spend time. IRL time === money.

>IRL time === money
Someone in Jow Forums making money through their hard work?
Pffft... Yeah, sure...