[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y ] [Search | Free Show | Home]

SQL

This is a blue board which means that it's for everybody (Safe For Work content only). If you see any adult content, please report it.

Thread replies: 17
Thread images: 1

Anyone got any book recommendations to learn SQL?

Picture potentially related.
>>
https://www.amazon.co.uk/Fundamentals-Database-Systems-Ramez-Elmasri/dp/0136086209
>>
>>58808605
That looks hilariously dense.
>>
>>58808542
https://docs.google.com/file/d/0B9aJA_iV4kHYM2dieHZhMHhyRVE/edit
>>
>>58809150
Thanks for the link. I'll have a read through.
>>
>>58808542
I never see SQL in production anymore, it's all mongodb now. Is it because I'm a code monkey?
>>
>>58809201
Yes :(
>>
>>58808542
If you got the basics down, do some work with it
then read this book from Bill Karwin
"SQL Antipatterns: Avoiding the Pitfalls of Database Programming"

Also good resource
http://use-the-index-luke.com

>>58809201
still relevant
https://www.youtube.com/watch?v=b2F-DItXtZs
>>
>>58809201

Depends entirely on where you work.
Mongo had a huge hype, then many people realized where SQL is better.

I think it's best to know both, but I'd alway put some effort in learning SQL (the commands as well as the theory of relational databses). You must learn the rules before you can break them, so you know when to use NoSQL and the advantages/disadvantages.

Even if I have never seen a real Database that had Boyce-Codd normal form, it's still worth knowing what it is and the possible problems you're facing when you denormalize your DB.


>>58808542

Sorry to say, but it's a lot "learning by doing".
Most people skip through SQL syntax and think they understood it, but there area lot of pitfalls when you try more advanced stuff.

Only some points:

-SQL uses tenary logic, these are 3 sets without overlap:
SELECT * FROM table WHERE a = 1
SELECT * FROM table WHERE a <> 1
SELECT * FROM table WHERE a IS NULL

-Beware of the "WHERE x NOT IN (...)" statement, most of the time you want "WHERE NOT EXISTS (...)"
>https://explainextended.com/2009/09/15/not-in-vs-not-exists-vs-left-join-is-null-sql-server/

-beware of dates (days, months, years) that are stored as numbers
If you really have to use values that are NOT stored as datetime, use strings/varchars:
SELECT * WHERE delivery_month = '02'
vs.
SELECT * WHERE delivery_month = 2

-in reality you want a powerful abstraction that is flexible enough without being absurdly complicated. You need some practice and will probably make some mistakes until you get that

-It doesn't end with SQL syntax. Once you got SQL down, learn to analyze performance (read query plans, find bottlenecks), get some theory (how do lookups work), do migrations and DO BACKUPS. This is so fucking crucial, learn how to do backups and how to restore data.

>http://blogs.ironmountain.com/2013/service-lines/data-backup-and-recovery/3-key-differences-between-backup-and-archive/
>http://webcheatsheet.com/sql/mysql_backup_restore.php
>>
>>58809512
That's an excellent post, but to slightly burst your bubble I'm just looking for a rough idea so I can relate (ahue) the topic to logic programming.
>>
>>58809597

No problem.

But the more you know, the easier it gets.
>>
>>58809732
Very true. Thanks for your contribution.
>>
>>58808542
1. https://www.youtube.com/watch?v=b2F-DItXtZs

2. Replace MySQL in 1. with an ACID compliant ORDBMS like Oracle, DB2 or postgresql.

3. Find the IBM book "database fundamentals" and read it cover to cover, don't get too hung up on details. It's free.

4. From there on Pic related or any implementation specific Oreilly book.
>>
>>58808542
In what context do you want to "learn SQL"?

Are you asking about how to write SQL because you want to know how to query data, or are you looking at becoming a database administrator? Is there something more to what you want to do with SQL, or are you going to accept being an ORM monkey where you occasionally write some SQL when you realize that making objects out of everything is slow as fuck? Are you looking at database design, or are you looking at being the guy who queries that database and makes sense out of the stored data? Is this a stepping stone for you because you want to work in analytics, or you eventually want to step out and do elastic or you want to be a "data scientist" or because you're a real scientist who realizes that maybe R with CSVs isn't the right way to clean and store data?
>>
>>58809974
You missed this post: >>58809597
>>
>>58809993
Hmmm... if it's the ideas behind the language you're interested in, you could start with some papers explaining the fundamentals of how SQL languages work:

http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.129.6517&rep=rep1&type=pdf

Is that the kind of thing you're looking for?
>>
>>58810204
Yes, that looks good, thanks.

I'm interested in this sort of thing: https://www.youtube.com/watch?v=R2Aa4PivG0g&t=1132s

I'm learning [about] Prolog at the moment, moving onto Bud/Bloom after that.
Thread posts: 17
Thread images: 1


[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y] [Search | Top | Home]

I'm aware that Imgur.com will stop allowing adult images since 15th of May. I'm taking actions to backup as much data as possible.
Read more on this topic here - https://archived.moe/talk/thread/1694/


If you need a post removed click on it's [Report] button and follow the instruction.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com.
If you like this website please support us by donating with Bitcoins at 16mKtbZiwW52BLkibtCr8jUg2KVUMTxVQ5
All trademarks and copyrights on this page are owned by their respective parties.
Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
This is a 4chan archive - all of the content originated from that site.
This means that RandomArchive shows their content, archived.
If you need information for a Poster - contact them.