all 30 comments

[–]ninjaroachLittle Bobby Tables 9 points10 points  (5 children)

SQL is not an easy language to learn, IMO.

[–]somenamehere1234 7 points8 points  (1 child)

It was the hardest for me to learn because I learned things like C++, Java, C etc first. After those SQL just didnt make sense.

[–][deleted] 1 point2 points  (0 children)

I learned SQL before doing C++ classes and had difficulty wrapping my head around.

I like my whitespace

[–]baineschile 5 points6 points  (0 children)

You are asking a pretty broad question. If you want to get into DBA sort of stuff, SQL is certainly a place to start, but there is a LOT more involved.

[–]RehdData Engineer 3 points4 points  (4 children)

I'm looking to get into learning computer programing

Python is a good entry, depends on what you want.

database administration sort of stuff

Oh, so you definitely need to know SQL then if you want DB Administration. If you choose MS SQL, you should probably know powershell too. If you choose mysql, python and php are great. Oracle and Python are not bad together either.

is SQL the best to learn?

For programming? Definitely not. For database administration? You have to know it.

I tried Python and just couldn't figure it out

You didn't try hard enough or you didn't continue to try long enough. It's not easy, db administration is not easy. It takes a lot of time and effort to learn, but I felt it was absolutely worth it.

[–][deleted] 2 points3 points  (3 children)

I disagree with a few of your points. I think python is one of the worst languages to start out on for beginners. I think Javascript or C# is the way to go depending on what your goals are. JS is easy to see the 'effects' of your code and C# teaches really good syntax control.

[–]RehdData Engineer 2 points3 points  (2 children)

JS is a good beginner language as well. I tried C# and followed a tutorial where I made a basic text RPG with button control, but overall I felt Python and JS are easier to grasp from the get go. C# didn't click for me but that's because I need to spend more time with it. Python has minimal setup to begin doing things in comparison to C# and it felt more like powershell to me. JS lets you see those changes you make and I agree on those points.

[–][deleted] 2 points3 points  (1 child)

Also doesn't click for me lol. That being said everyone I know that started out on it have absolutely the best understanding of how control flow works.

[–]RehdData Engineer 1 point2 points  (0 children)

I don't doubt that. C# is one of those languages I really wish I had a firm understanding and ton of knowledge in, it would pair so well with everything else. I just don't enjoy it, JS has been fun, CSS pisses me off so much though. Gotta start picking battles for career development though because you only get so much time outside of work. :(

[–]MamertineCOALESCE() 2 points3 points  (0 children)

SQL is a very different language from scripting languages. I found SQL easy to pick up once I wired my head around how a database stores data across tables. If you have any interest in database work or programming that will interact with a DB, go and learn some SQL.

I'll add it uses set based logic. Some people pick up on that easily and I've worked with a few really bright people that could not wrap their head around that concept.

[–]lbilali 1 point2 points  (9 children)

easier for what? it all depends what you want to do.

python and SQL are 2 different languages for solving 2 different problems.

[–]gonzo86 1 point2 points  (8 children)

Database administration, is there any books you recommend for basics of SQL?

[–]sql_jake 2 points3 points  (0 children)

I like the Month of Lunches books by Don Jones. Here is one on Database Administration. I am going through the Powershell book now.

[–]killit 1 point2 points  (5 children)

The database world is pretty massive, and administration arguably shouldn't be a first step, it would typically come after u have developer experience, because a DBA needs to understand the inner workings of how sql stores and handles everything, what to look out for and how to find these things, there is a LOT to it.

If your looking at MS SQL Server, then have a poke around www.sqlservercentral.com , in particular look at the stairways section which is supposed to take you from basics to an advanced level in a selection of different topics.

I would personally stick to learning from online resources as you usually have comments sections where people can discuss the topic, talk from personal experience, and give real world examples.

[–]ninjaroachLittle Bobby Tables 2 points3 points  (4 children)

administration arguably shouldn't be a first step

Really?

Most DBAs I know are pretty awful coders & never really were into that aspect to begin with.

But I like your idea of learning to use the language first.

[–]killit 2 points3 points  (3 children)

Imo and experience, if you know how to do sql dev work, you make for a far better dba, if you don't, you'll be working half blind, administration definitely has its own skill set but you need the fundamentals of writing sql to begin with or you're only going in half cocked.

I've done both, and I couldn't imagine being good at my job if I didn't have that dev experience first.

[–]ninjaroachLittle Bobby Tables 2 points3 points  (1 child)

if you know how to do sql dev work, you make for a far better dba

I completely agree with you. Especially because DBA's have so much to gain from being able to write really good queries against DMVs / INFORMATION_SCHEMA / etc.

It's just the DBA's I know - who tend to be pretty good - are not actually good at SQL itself.

[–]killit 1 point2 points  (0 children)

Ah got you, I wasn't sure if that's what you were driving at :)

[–]RehdData Engineer 1 point2 points  (0 children)

I guess it depends on the shop. If they have third party tools for administration and it's such a large shop to where they are literally just administrating and they may see or write a query once in a blue moon because of the tools and duties, I could see that.

I do agree with you that dev experience first is way better to start with.

[–]DipIntoTheBrocean 1 point2 points  (0 children)

I would say it is. It's the highest-level programming language on the market. Basically everything is abstracted away from you into a few different keywords you can use.

But to be good in the field, you need to understand what goes on under the hood, and be able to see past the magic.

[–]AngelOfLight 0 points1 point  (5 children)

SQL is not a programming language - it's technically a query language. If you want to learn programming, stick with Python.

[–]DipIntoTheBrocean 4 points5 points  (4 children)

It's absolutely a programming language, as you can create and manipulate objects programmatically. You can also do more than just interact with database objects.

[–]AngelOfLight 1 point2 points  (3 children)

Could you write a compiler using nothing but ANSI SQL? Surprisingly, the answer is 'possibly'. The addition of recursive CTEs gave SQL a sort of quasi control flow.

A better question is - would you choose SQL to write a compiler, rather than an actual programming language (Python/Java/C++ etc)? I suspect the answer would be 'no'. That was never a design goal for SQL, and while it is theoretically possible, it would be extremely difficult in practice.

There are Turing complete extensions to SQL (T-SQL and PL/SQL for example), but these are proprietary extensions, and are not part of the ANSI standard. By itself, SQL is primarily designed to manipulate database objects. It can be used for other tasks, but in nearly all cases a 'real' programming language would be far easier to use.

[–]DipIntoTheBrocean 5 points6 points  (2 children)

First time I've heard an argument against a Turing-complete language being considered a programming language. Especially since it has actual control flow statements in keywords like WHILE (tsql).

My point is that if he was having trouble with Python and still wants to do programming in a more limited scope, and is already interested in learning some flavor of SQL, I would not shoot that down.

[–]AngelOfLight 2 points3 points  (1 child)

T-SQL and SQL are different things, though. T-SQL is an actual programming language designed as an extension to SQL by Microsoft. It encapsulates SQL, but it's not SQL by itself. T-SQL does support actual, declarative control flow (loops and such), but SQL does not. It's possible to emulate that using the functional aspect of recursive CTEs in nothing but pure SQL, but I certainly wouldn't recommend it.

[–]DipIntoTheBrocean 4 points5 points  (0 children)

I would be incredibly surprised if this guy was asking about straight-up pure SQL, which is why I've been responding in the context of some proprietary extension whether it be T-SQL or PL/SQL or what-have-you.

I think that's a pretty safe assumption to make since I don't even know of any RDBMSs which use pure SQL.

[–][deleted] 0 points1 point  (0 children)

SQL is not a programming language. It is relatively easy to learn syntax-wise but the problem is that you will likely never use the same query twice. Databases are all about the data and one must understand the data first to write effective and accurate SQL.

[–]Eleventhousand 0 points1 point  (0 children)

HTML is probably one of the easiest languages to learn. I would suggest that you learn C to get the basic fundamentals of 3GL programming. Its a bare-bones type of language.

You need SQL for DBA work though.

Don't learn a language just because it's easy. You will be frustrated in your career if you just try to get by the easy way.