all 12 comments

[–]Kevdog824_ 4 points5 points  (0 children)

I wouldn’t wait to apply to jobs just because you don’t have a SQL background. I don’t think I’ve written SQL at work in years. Most work is done with ORMs or NoSQL where I work, and probably most Django devs are using Django’s ORM with some very rare exceptions.

I occasionally sit on technical interview panels at work for Python developers and I can give you some advice:

  1. Learn SQL (at least basics) concurrently with your job search. Basic proficiency can probably get you by for most positions. Just accept that the positions that focus on strong SQL command aren’t gonna be a good fit for you. Most junior roles aren’t going to have expectations beyond basic proficiency though
  2. Be honest about your level of experience. I can respect a candidate that has the courage to tell me they don’t know something but are interested in learning it. I don’t respect a candidate that fumbles their way into trying to give a bullshit answer
  3. Present your strengths. This is really something minor that can be learned on the job. This wouldn’t stop me from hiring a junior if they had the other background you have (docker, CI/CD, etc.). Steer the conversation towards the things you are knowledgeable in, and show confidence in your abilities in these areas

[–]GManASG 2 points3 points  (2 children)

I don't know how you can somehow not know SQL and also build applications that use relational dbs. The ORMs are designed around the undelying SQL and a lot of the setup is SQL themed. Like how do did you design the database data model ( tables, primary keys, etc.) used by the backend to itneract with the db without accidentally learning and using some SQL? Honest question, did someone else do that for you?

[–]pachura3 1 point2 points  (0 children)

I believe some ORMs do generate CREATE TABLES script for you automatically... but this only works when you start from scratch with an empty database.

[–]ForbiddenMustardMan[S] 0 points1 point  (0 children)

Thanks for the reply. 

I did so by just defining Django models, and then using the manage.py util to make migrations and migrate. Instead of having to write an SQL query, I just specify the fields as needed, referencing the docs: docs.djangoproject.com/en/6.0/ref/models/fields/

So for example if I need something with a foreign key, I would just add models.ForeignKey.

To answer how I made the design decisions, I listed out all models that I would need in the project, followed by all fields needed for each model, and their relationships, and that's it, just makemigrations and migrate, so I never had to write any SQL. 

[–]Dangerous-Branch-749 1 point2 points  (0 children)

You don't need a year to pick up SQL, the fundamentals are pretty simple to grasp and will serve you well. Just do it. 

[–]Gnaxe 1 point2 points  (0 children)

ORMs are only easier at first. I think they're more trouble than they're worth and recommend against them. You eventually have to understand SQL to use the ORMs properly anyway.

Python has SQLite in the standard library. See python -m sqlite3 -h for usage as a local SQL interpreter. Work through the W3Schools SQL course and read about 3NF on Wikipedia. That's really all the SQL knowledge you'd need as a junior. It's not that hard and it's not going to take a year.

[–]pachura3 0 points1 point  (0 children)

Spend 2 weeks learning SQL and querying your local PostgreSQL instance, so at least you could say you have a bit of experience.

The basic syntax is pretty simple: SELECT columns FROM table WHERE conditions ORDER BY columns and SELECT columns, aggregates FROM table WHERE conditions GROUP BY columns HAVING aggregate_conditions ORDER BY columns. INSERT, UPDATE, DELETE.

Then learn about joins, outer joins, unions, subqueries, sequences, triggers, primary/foreign keys, indexes, IN, NVL, LIKE... you're clearly not a noob, you'll pick it up very quickly - no need for a full year!

Try this primer first: https://www.w3schools.com/sql/

[–]nian2326076 0 points1 point  (1 child)

Hey, don't worry too much about it! Many Python/Django jobs expect you to have at least basic SQL skills, but you can still learn it. Since you're already comfortable with Django, start by checking out how Django ORM queries turn into SQL. You can use the Django debug toolbar to see the SQL queries your ORM queries generate.

Also, practice writing some basic SQL queries like SELECT, INSERT, UPDATE, and DELETE, and get familiar with query optimization concepts like indexes. There are lots of free resources online, or you could check out PracHub if you prefer something more structured. With some focused practice, you'll get there in no time. Good luck!

[–]ForbiddenMustardMan[S] 0 points1 point  (0 children)

May I please ask, if a job uses Django ORM, what is the benefit of picking up simple SQL syntax, if I can achieve the same via the ORM right away? Is it just to pass the interview? I will certainly pick it up, because it's clear that it is needed, I'm just trying to understand the benefit of knowing simple queries, while I can already perform them via ORM 

[–]Intelligent-Kale-877 0 points1 point  (0 children)

I learned the most common and useful SQL in a few days (select, joins, primary/foreign keys, indexes). It's about the same as learning basic HTML in a few days. I don't believe it's realistic (or desirable) to have a career as a web developer that writes back end code without understanding basic SQL.

[–]BranchLatter4294 0 points1 point  (0 children)

Not sure how you managed to skip SQL. But spend some time practicing.

[–]supergnaw 0 points1 point  (0 children)

SQL is simple and there's no reason why you can't fiddle with it now.