learning SQL

All things Programming
Post Reply
User avatar
john-boy
Global Moderator
Posts: 559
Joined: Fri Dec 18, 2020 11:23 am
Location: Desperately seeking moksha in all the wrong places

learning SQL

Post by john-boy »

If somebody asked you what's the best resource for the above, what would you say ?

I've been using this (SQL, mostly TSQL) for years *, and my gut response is leaning towards "just use it", perhaps along with linky open on a spare tab and Google at the ready. Oh and for God's sake avoid MS-Access.

The hard bit is always going to be whatever schema that you're working with, the language isn't that difficult. So I'd advise to do the above and perhaps get read-only access to a DB that I know they'd want access to (I'll let them do with chasing here), followed by a few examples of basic queries to extract data that I think would interest them,

* Therein lies the problem, is the above a reasonable approach ? If I need a bit of scripting for data, I'll have a gander at Python (for example) and I can get something running fairly quickly, I've forgotten what it's like for this stuff to be new.
Like the Roman, I seem to see "the River Tiber foaming with much blood"
User avatar
notageek
Site Admin
Posts: 595
Joined: Fri Dec 18, 2020 2:28 am
Location: India

Re: learning SQL

Post by notageek »

The quintessential DB textbooks are a better source for learning SQL. If you understand the theory, you'll understand what SQL does therefore you'll write SQL better.

A little bit of googling brought me to Korth's textbook available online: https://www.db-book.com/db6/slide-dir/

The other book is Navathe's Fundamentals of DB.

Also Knuth's book on DB.

I'm remembering from memory back from the days I was a student.

Modern resources and books are something you'd want to look at. My links and resources are dated and traditional.
"Defeat is a state of mind. No one is ever defeated, until defeat has been accepted as a reality." -- Bruce Lee
User avatar
john-boy
Global Moderator
Posts: 559
Joined: Fri Dec 18, 2020 11:23 am
Location: Desperately seeking moksha in all the wrong places

Re: learning SQL

Post by john-boy »

Interesting, I can just recall being formally taught this stuff and it only really made sense when I started using it for real - away from test databases and on something with live data.

Perhaps that's just the way I learn, the draw back with live data, is that what should be isn't necessarily what is. So if you're looking for beautifully normalised databases, they're somewhat rare in the wild (at least in my experience). It's a case of kludges.

That's probably colouring my approach, in trying to get a new learner doing stuff first.
Like the Roman, I seem to see "the River Tiber foaming with much blood"
User avatar
notageek
Site Admin
Posts: 595
Joined: Fri Dec 18, 2020 2:28 am
Location: India

Re: learning SQL

Post by notageek »

There's this https://www.mockaroo.com/ to generate ton of mock data in any kind (normalized, un-normalized) and practice if that's what makes it easier.
"Defeat is a state of mind. No one is ever defeated, until defeat has been accepted as a reality." -- Bruce Lee
User avatar
john-boy
Global Moderator
Posts: 559
Joined: Fri Dec 18, 2020 11:23 am
Location: Desperately seeking moksha in all the wrong places

Re: learning SQL

Post by john-boy »

Interesting site (book marked), thanks. It does have some SJW stuff going on in the gender field, but that's fixable.
Like the Roman, I seem to see "the River Tiber foaming with much blood"
Post Reply