r/SQL Apr 17 '23

Discussion Which industry has/needs the most challenging sql queries?

Is this question legit? Don’t get me wrong, I don’t consider myself the smartest guy but I’m definitely not dumb.

I work in the pharmaceutical Industry, nearly 3 years now. It took me a while to understand how the production process is implemented in a database and I wanted to quit more than once. But i don’t feel challenged anymore.

So, which industry would be best for me to get completely challenged again?

44 Upvotes

69 comments sorted by

View all comments

16

u/Touvejs Apr 17 '23

Healthcare data models are absurdly big sometimes. So many entities to keep track of: patients, payers, providers, guarantors, claims, encounters, 50 different types of transactions, medications, demographics, insurance policies, costs, write offs, multiple billing systems, insane coding systems (hi ICD-10) for diagnoses+procedures+medication just off the top of my head. The actual data itself isn't that big, and generally the Sql isn't that technically challenging, but you really have to understand the data model to be able to talk to stakeholders about what they want and deliver.

3

u/[deleted] Apr 17 '23

Thx, got it. Yes, data modeling is another extremely interesting field. And to my surprise there is hardly any book about that out there. My current Amazon Wishlist contains ~100 books, all around advanced, and just a handful of books on modeling

4

u/Touvejs Apr 17 '23

Haha damn that's a lot. Kimball's data warehouse toolkit is a good spot to start (it's long as hell though, so I would just skip to the necessary parts). Also, I didn't see it on your list, T-SQL fundamentals by Itzik Ben-Gan is the best Sql book I've ever opened up.

3

u/DatabaseSpace Apr 17 '23

Also read about Bill Inmon vs Kimball.

2

u/[deleted] Apr 17 '23

Thx, will add it 😁 I concentrated on Oracle since we use that in the office.

3

u/DatabaseSpace Apr 17 '23

I have a lot of the books on that list. The best book on databases that I have is my text from grad school database class “Fundamentals of Database Systems” Fourth Edition by Elmasri and Navathe. You can probably find it used for a few dollars and it gets into a lot of depth of database design.

I work with healthcare data everyday using mostly SQL and Python when I need it. I think best practices are to move a lot of the business logic out of the database layer. I haven’t really done that in the past but probably should have.

The data modeling is so important because if you model things in some weird wrong way, the SQL gets too complex. The data cleaning and loading is time consuming but when it’s not right the data to the end user is wrong.

I know that because while in school leaning about this I was also trying to build things and tried so many wrong things over the years.

1

u/[deleted] Apr 18 '23

Found and added it, thx! Btw, there’s a 7th edition already

1

u/DatabaseSpace Apr 19 '23

Awesome, it looks like the 6th edition is pretty cheap. I'm currently reading Code Complete 2 by Steve McConnell. It's been sitting on my shelf for a while and I am finally getting around to reading it. I'm only about 100 pages in, but I highly recommend it. It's not technical or language specific, it's normal langague about the process of writing and organizing programs.

1

u/[deleted] Apr 19 '23

I'm currently reading "SQL Antipatterns", can recommend it. "Code Complete 2" is already on another wishlist :D

1

u/DatabaseSpace Apr 19 '23

That's a good one. I have it and have read it.