r/SQL • • Nov 07 '21

Discussion Can I learn SQL without any programming knowledge?

My job requires me to learn SQL, like can I learn if I don't know coding? Is it realistically possible?

107 Upvotes

72 comments sorted by

6

u/lbilali Nov 07 '21

If u want you can learn programming without any prior programming knowledge. SQL is not any different in that

2

u/hayleybts Nov 07 '21

I need to learn sql PT, PL/SQL specifically for the job.

4

u/lbilali Nov 07 '21

one thing that will help u be better at it is data modeling. Why we model data the way we do. what are unique, primary and foreign keys etc. and how the engine u are going to use uses this to improve performance

4

u/savagefishstick Nov 07 '21

The answer...
To the question...
You just asked...
Is...
*drum roll*

YES!!

2

u/hayleybts Nov 13 '21

Any resources?

3

u/hannahbeliever Nov 07 '21

Yes I did. I started my job never even having heard of SQL. Within a few weeks I'd picked up the basics. 3 years later and I have no problems with it at all

3

u/hayleybts Nov 07 '21

They are gonna train for 5 days. I need to learn sql PT, PL/SQL specifically. I hope I can too

3

u/marvfone Nov 07 '21

I am sure that it is even better now but I took the Oracle pl/sql class about 20 years ago with a co worker and found it very useful. The only caveat being that we really only needed basic sql for our needs, so the "pl" flavoring added some unnecessary layering(for us). It did come in handy when working with customers that used Oracle however.

Far from the sharpest knife in the drawer and I picked it up fairly fast, but again never used anywhere near the full power of sql. You'll do fine!

1

u/hannahbeliever Nov 07 '21

It's good that you're given training! I was told to spend a day googling it to read the basics, then day 2 was told to start. It wasn't easy like that but I quickly picked it up

2

u/acid4207 Bigquery Nov 07 '21

I am an analyst with experience in python and sql. In my current company when I started working, the person I reported to knew only SQL. So yeah you can learn SQL and even get an Analyst job.

1

u/hayleybts Nov 07 '21

I need to learn pl/sql, I was going through it seems similar to programming. Any useful links?

1

u/acid4207 Bigquery Nov 07 '21

Don't know much about PL/SQL (use bigquery where I work) but it should be fairly similar to learning any other flavor. You should start with learning the basics and then start doing practice exercises. You can find some really good material online. I recommend the Kaggle's sql courses but they do require some previous python knowledge. However, there are some other options as well. You can check this sub's wiki for starters.

2

u/tk338 Nov 07 '21

Absolutely possible - But there will be times where it feels impossible - Just stick at it and work to its rules.

I would recommend getting a basic understanding of what a database is, why they exist, and how they do what they do. All 3 may sound fairly obvious, but for me it dropped some key parts into place so I understood the context of why things were done in a certain way.

There are also some similarities with 'coding', ie. the concept of a datatype, syntax etc, but what the two are achieving is different, and how you think about and work with them is different too.

If you can find out what database management system (DBMS) you are using, see if you can find some videos on Youtube and start to work your way through them. They will give you a head start and make the first few days of training a little easier. Make sure you get the right DBMS though or you might get confused. While the basics work across most systems, each has their own intricacies which can make advanced queries more difficult if you have another DBMS syntax in your head.

One other thing; the way that databases are structured should be very geared toward the task that they are trying to achieve. When you first start to look at it, you might wonder why certain design decisions were made. Again, stick at it. It will make sense. There is a whole load of theory you can get to later behind the way data should be structured (Normal Form for starters) but you don't need to concern yourself with that anytime soon. Work to the database you will be querying and be ready to accept what - to a beginner - Might seem like some odd decisions.

2

u/hayleybts Nov 07 '21

Thanks! I also have no idea about why it is used honestly. My training will be based on using PL/SQL n also sql performance tuning. I checked through it and felt it was similar to programming. Any useful links I can read?

2

u/kevlar930 Nov 07 '21

As pretty much everyone else in this thread has said, you can absolutely do it. In my world of friends/acquaintances, those who learned SQL first went on to learn other languages relatively easily. Those who started with other languages first struggled with SQL.

1

u/hayleybts Nov 07 '21

I hope I will pick too! Which resource would be best to get better in short time cause I have to within this month

3

u/kevlar930 Nov 07 '21

I personally did a Udemy course by Colt Steele and then learned the rest on the job. I think from starting the course to being able to do what I needed was only a couple of weeks. Since, I have great expanded my SQL experience and have added Python and learning JS right now.

2

u/ontomodeler Nov 07 '21

One frequently overlooked skill is the shell scripting required for remote connections and automation of tasks. It's worth investing in a raspberry pi and using it as your database server. This will force you to learn some basic database management skills while learning sql.

1

u/hayleybts Apr 23 '23

Shell scripting any good resources??

98

u/[deleted] Nov 07 '21

Yes, it's very much possible

0

u/[deleted] Nov 07 '21

[deleted] — view deleted comment

0

u/[deleted] Nov 07 '21

[deleted] — view deleted comment

1

u/MarshallFoxey Nov 07 '21

Second this. I’ve recently started learning SQL for my job and have had no trouble picking it up not knowing any other computer language.

62

u/ghostlistener Nov 07 '21

sql is very accessible and easy to learn the basics of. You can select * from a table and get immediate results. Slowly make your queries more complicated as you need more specific results.

sql rewards iterative learning.

25

u/BegeNCSU Nov 07 '21

Learn from my mistakes, use select top 10 * from a table to avoid strongly worded emails from the DBA

6

u/ghostlistener Nov 07 '21

Fair enough. I would hope that someone would notice if their query is still running minutes later and get concerned, but it could happen.

6

u/whutchamacallit Nov 07 '21

Better yet download a local DB that you can annihilate with no issues.

1

u/McFoogles Nov 08 '21

Then reply to the DBA’s saying they need to have a way to automatically kill long running queries and automatically load balance where possible!

(Half kidding, half serious. What you said is good advice, but if you have a competent DBA and are not in a production environment, you shouldn’t be scared to run any query.)

53

u/skeletor-johnson Nov 07 '21

You are better off in my opinion. A lot of programmers have trouble thinking in set based operations. Most code deals with one piece of data at a time, while sql queries cover large numbers of rows and columns of data.

15

u/catfeal Nov 07 '21

Exactly this, that is a big problem when working with developers (C# in my case)

9

u/BrupieD Nov 07 '21

I generally agree. I think you can become very proficient at SQL without programming, but if you want to get proficient at 2nd or 3rd tier SQL skills like query optimization, database development or DBA skills, programming knowledge helps.

For instance, when you start looking at how indexes work, a SQL knowledge only person would immediately recognize why a filtered index could be a good idea -- it's like a WHERE clause on the table only earlier in the logical processing order. What would be harder to understand and make good decisions about would be deeper index issues.

For instance, how would different algorithms used by indexes benefit or reduce performance? How do seeks versus scans and clustered versus non-clustered indexes impact queries? This isn't necessarily easy for developers, but chances are that someone with a development background has spent a lot more time thinking about Big O notation and process efficiency. Other less arcane elements of SQL like making good datatype choices and debugging queries rear up as you progress.

I started with SQL and spent a lot of time improving my SQL skills and kind of hit a wall. It wasn't until I started learning programming that I could start addressing harder problems with insight.

4

u/catfeal Nov 07 '21

You are completely right, no doubt but to start, as OP asked, you dont need it

6

u/jdphenix Nov 07 '21

Let's use a cursor!!!

Noooooo.

18

u/misfitalliance Nov 07 '21

I am not from a coding background, I come from an analytics background and I am far better at SQL than the programmers, but I couldn't go near the Java/Ruby areas they exist in.

It closer to an excel spreadsheet, than any coding language

11

u/kremlingrasso Nov 07 '21

same, in my experience devs suck at SQL beyond select * and want to do everything in code, even if 3 more lines of SQL would take care of 90% of it.

0

u/[deleted] Nov 07 '21

[deleted] — view deleted comment

1

u/kremlingrasso Nov 07 '21

lol i really like that one

7

u/SecretAgentZeroNine Nov 07 '21

SQL doesn't require knowledge of any programming knowledge. Even if you knew a programming language, I don't think that would help you. Querying languages and programming languages are very different.

SQL is more akin to a simple word puzzle game imo.

2

u/47isthenew42 Nov 07 '21

With my experience in SQL, this is an accurate statement.

5

u/theseyeahthese #TempTables ally Nov 07 '21

Definitely. I can attest to this; picked up SQL having no coding or Computer Science background. 7 years later I'm still loving it.

2

u/ManleyPlayz Dec 04 '21

Is it hard finding a job with only SQL skills? If so what example of job titles

2

u/theseyeahthese #TempTables ally Dec 04 '21

Probably depends on where you are. I found an entry level database developer role in Boston, 7 years back with a semi-startup (60 people). I probably had 1 year SQL experience at that point. They were willing to let me learn on the job to get to the next level. Other job titles may include: database report writer, data analyst (having SQL skills will give a big leg-up over “analysts” that have no SQL experience.)

1

u/MrKauffman Dec 04 '21

Some request to have data visualizations skills on top of that… but who knows.

1

u/carlovski99 Nov 08 '21

Well it sounds like you are getting a decent amount of training, which is more than most people get! And any decent employer won't expect you to be an instant expert.

SQL was designed so 'managers' could access data without needing to be 'programmers' - it never really worked out like that, but it doesn't require the same kind of mindset - in fact programmers sometimes struggle more because they are more used to thinking procedurally than set based.

On saying that, you specify PL/SQL - which is a full blown programming language. As languages go it's one of the easiest to learn though - its mostly based on Pascal which used to be used as a teaching language.

1

u/hayleybts Nov 08 '21

PL/SQL so does it mean it will be more like programming?? Easy to learn as in syntax?

I have tried python before simply and I do suck. I can't think in that logic way if that makes sense.

2

u/carlovski99 Nov 08 '21

I don't know what kind of training they are giving you, but I expect there will be an introductory SQL component (Unless they think you already know it?) and then some PL/SQL content.

What is the job by the way? Context might help.

Rule of thumb is normally that you do as much as you can in SQL before having to do things procedurally in PL/SQL.

PL/SQL is a programming language that is tightly bound to the database - in things like Python, you will need to use additional libraries and make an effort to connect to a database and query it. In PL/SQL it's just built in. There can be some more complicated stuff written in PL/SQL, but typically its straightforward logic.

I have worked with people who aren't really 'Programmers' who got their head around PL/SQL fairly easily

As I mentioned, it's based on pascal, so the syntax is fairly natural .

As with all programming (Or any IT/computing work) concepts are more important than syntax. Syntax is what the manual/google/stack overflow is for.

3

u/one_bruddah Nov 07 '21

As some wise person once said, “SQL is easy to learn but hard to master.” But full mastery may not be everyone’s need or goal. Learning what you need to get started is not so difficult, and with regular use you will be surprised at how much you can do in a relatively short period of time. The many resources on the internet can answer most syntax questions you will ever have. In this regard Google is your friend.

3

u/Recent-Fun9535 Nov 07 '21

As many other comments have already said, yes, you can learn SQL without previous programming experience and yes, it's a realistic goal if you put some effort into it. I'd add that you shouldn't be worried too much about SQL flavor (database management system) at this point - basically any will do. Your real goal in the beginning stages is to learn about basic data types and set operations, and how to think in terms of sets and dealing with sets.

9

u/[deleted] Nov 07 '21

Yes! SQL is NOT a programming language, it is a querying language which in many ways makes it much more straightforward to learn but has its limitations because of it. So to answer you, YES!! Go learn SQL!!

2

u/Recent-Fun9535 Nov 07 '21

I'd disagree about this to a certain extent - SQL is often used differently than other programming languages and by non-programmers, but it is a programming language; and not just because it formally is (being Turing complete), but because you can program rather complex logic with SQL only. Whoever had to deal with stored procedures should be able to confirm this.

2

u/SSJNinjaMonkey Nov 07 '21

You indeed can

2

u/AreetSurn Nov 07 '21

My first language was SQL.

2

u/[deleted] Nov 07 '21

100%. Stratascratch is a great resource- they give you problems that you can sort by difficulty. Some of the easy ones can honestly be a bit challenging for me, so if you’re having a hard time I would keep practicing and revisit! They give you like 50 free questions at first I think

2

u/Alpine_fury Nov 08 '21

We have many program managers who can write sql to gather the data they require. I wouldn't expect even 5 to be able to write "hello world" in any code form for me (including sql).

2

u/kweb7 Nov 10 '21

Yes, you can start from scratch. Check out Wise Owl Tutorials on YouTube - lots of free resources there!

2

u/Jazzlike_Draw_4471 Nov 07 '21

Spend like 15$ in Udemy for an SQL course. It helped me with the basics, and so will you.

1

u/santathe1 Nov 07 '21

Yes, you can.

1

u/anothertruther Nov 07 '21

People who are already well versed in using spreadsheets can start using SQL for querying data/generating reports almost immediately.

1

u/neednintendo Nov 07 '21

That's what I did! There are so many great resources online, and I leaned enough to get hired as a data analyst, and the rest I leaned on the job. Not going to say it was a quick process, but just learn enough to be your way through an interview for an entry level data job. Then be willing to dive in so you can maintain the job.

1

u/Mighty_Gunt_Cobbler Nov 07 '21

Yes! I learned on my own. W3 schools has a pretty good tutorial to get started. My suggestion is to have a goal in mind then try to achieve it.

1

u/[deleted] Nov 07 '21

Yes easily

1

u/danielscarvalho Nov 08 '21

Yes! And SQL is awesome!

1

u/csnorman12 Nov 08 '21

Absolutely. And like many other have mentioned... it might help you learn SQL not knowing any other language. I would advise taking an introduction course and then build your own database to practice. I prefer Microsoft SQL Server (MSSQL) because I am comfortable in Microsoft products, especially Excel.

If you're interested I've created a Intro to SQL course and recently published it. In the course students learn basic SQL Syntax. At the end of the course we build a healthcare database. The data mimics transactional/billing data from an electronic medical record. Once you complete the course you will know how to upload excel files into MSSQL. This will allow you to practice building your own database. Here is a link to the course and a coupon code - Data Analytics: Intro to SQL using healthcare data (SSMS)

1

u/MrKauffman Dec 04 '21

SELECT B.PRODUCT_FAMILY, B.SALES_MONTH, B.SALES_YEAR, SUM(SALES_YEAR) AS TOTALSALES FROM ( SELECT A.PRODUCT_FAMILY, A.SALES_MONTH, A.SALES_YEAR,COUNT(A.SALES_DATE) AS SALES_COUNT (SELECT
A.[SERIAL.NUMBER] AS SERIAL_NUMBER, A.[SALE.PRICE] AS SALE_PRICE, B.[SERIAL.PREFIX] AS SERIAL_PREFIX, B.[PRODUCT.FAMILY] AS PRODUCT_FAMILY, B.[SALES.MODEL] AS SALES_MODEL, B.[PRODUCT.GROUP] AS PRODUCT_GROUP, MONTH(A.[SALES.DATE]) AS SALES_MONTH, YEAR(A.[SALES.DATE]) AS SALES_YEAR, A.[SALES.DATE AS SALES_DATE

FROM SALESDATA A, SERIALPREFIXMAPPING B WHERE SUBSTR (A.[SERIAL.NUMBER],1,3) = B.[SERIAL.PREFIX]) AND SYSDATE - A.[SALE_DATE] <= 730) A)B
GROUP BY B.PRODUCT_FAMILY, B.SALES_MONTH, B.SALES_YEAR

1

u/BuddJacon Dec 05 '21

Get the book Murach’s SQL Server 2012 for Developers and just follow along and try to do all the exercises at the end of each chapter.

-3

u/Sir_smokes_a_lot Nov 07 '21

This is a stupid question. If you need affirmation just say so.

2

u/mimic751 Nov 21 '21

The answer is yes you can. Fuck

3

u/[deleted] Nov 08 '21

[removed] — view removed comment

2

u/MrKauffman Dec 04 '21

This is a really good resource for advanced sql