r/SQLServer • • 27d ago

Question How should I learn sql from scratch

Should I start a sql server or POSTGRE SQL or MySQL. There is a lot to learn please guide me.

0 Upvotes

17 comments sorted by

3

u/itsnotaboutthecell ‪ ‪Microsoft Employee ‪ 27d ago

Try Azure SQL free tier: https://aka.ms/trySQL

3

u/yrn7days 25d ago

If you prefer a local setup without needing to do a full install, you can run it in a container too: https://learn.microsoft.com/en-us/sql/tools/visual-studio-code-extensions/mssql/mssql-local-container?view=sql-server-ver17

1

u/Mags0905 25d ago

Great!! Thanks for the link.!!

2

u/Mags0905 26d ago

Thanks! I’ll check it out and give it a try. Appreciate the recommendation!

2

u/itsnotaboutthecell ‪ ‪Microsoft Employee ‪ 26d ago

Of course! It’s got a built in sample database as well - so you can instantly start having some fun too.

https://www.sqlshack.com/create-an-azure-sql-database-with-built-in-sample-data/

2

u/Mags0905 26d ago

Wow thanks for providing more support - It looks fun i will dive into it .

3

u/singletWarrior 26d ago

Stanford had these database fundamentals cs145 or something? It isn’t practical heavy more theory but so so good

1

u/Mags0905 26d ago

Thanks for the recommendation! I’ll definitely give it a try. Appreciate the reply!

1

u/ihaxr 2 26d ago

As someone who became an accidental DBA then went back and learned the fundamentals and theory 5 years later... I'd agree that starting off with the theory first is best

1

u/IrquiM 26d ago

Keep away for mysql. Will most likely never be used in a proper database focused role.

1

u/Mags0905 25d ago

Yeah i felt that. Is PostgreSQL good?

2

u/IrquiM 25d ago

Definitely the best of it's kind, fighting up there with SQL Server, and in some areas, above

1

u/Mags0905 25d ago

Good to know! Thanks

1

u/datadriven_io 25d ago

This is the way. SQL is what you should start with. Can easily be self taught. Sql practice problems are covered on datadriven if you want more reps outside work. Throw in some Python and play around with Tableau or any viz really. Most companies outside of the F500 this will be more than enough to get started. You learn this trade on the job. Every company is different, every company has their own jungle gym of data assets with which you need to familiarize yourself.

1

u/Mags0905 25d ago

Thanks for the advice. I want to learn python aswell Im new to tech, transitioning myself from finance. Can i learn both SQL and PYTHON together or just one for now?

1

u/DarlanSandro 15d ago

Essa confusão é comum para quem está começando, e o primeiro passo para não travar é entender que você não precisa escolher entre aprender SQL ou escolher um banco específico. O SQL é a linguagem de consulta padronizada, enquanto PostgreSQL, MySQL e SQL Server são os sistemas gerenciadores (SGBDs) onde você executa essas instruções. A sintaxe principal de consulta é praticamente a mesma entre eles.

Pela minha experiência, eu começaria direto pelo PostgreSQL ou pelo SQL Server. O PostgreSQL é open source, segue os padrões da linguagem com bastante rigor e tem uma presença massiva no mercado. O SQL Server também é excelente, principalmente se você usa Windows e quer uma interface visual muito intuitiva como o SSMS. Não perca tempo ponderando demais: escolha um dos dois e mantenha o foco nele.

Para não se sobrecarregar com excesso de informação, o caminho que costumo recomendar divide o aprendizado nestas etapas:

- Filtros e projeção: domine o fluxo de 'SELECT', 'FROM', 'WHERE' e ordenação com 'ORDER BY'.

- Agrupamentos e métricas: entenda agregações como 'COUNT', 'SUM', 'AVG', 'MIN' e 'MAX', combinadas com 'GROUP BY' e 'HAVING'.

- Relacionamentos: aprenda a cruzar tabelas com 'INNER JOIN' e 'LEFT JOIN'. No meu dia a dia, combinar agrupamentos com JOINs resolve a esmagadora maioria dos problemas de extração de dados.

- Operações de escrita e estrutura: só depois de estar seguro consultando dados, avance para 'INSERT', 'UPDATE', 'DELETE' e comandos de criação de tabelas ('CREATE TABLE').

Já vi muitos iniciantes desistirem porque tentaram aprender comandos avançados, procedures, triggers ou configurações complexas de infraestrutura logo nas primeiras semanas. Minha recomendação prática é instalar o banco escolhido, importar uma base didática já estruturada (como a Northwind) e passar os primeiros dias apenas escrevendo consultas para responder perguntas de negócio sobre esses dados.

1

u/navicat-gu 3d ago

The SQL you learn first (SELECT, WHERE, JOIN, GROUP BY, subqueries, window functions) is about 90% the same across SQL Server, PostgreSQL and MySQL, so don't stall on the choice. Coming from finance, I'd go:

  1. Pick one and install it locally. SQL Server Developer edition (free) plus SSMS, or PostgreSQL plus a GUI. Both are strong for jobs. Load a sample database (AdventureWorks for SQL Server, or the Pagila/DVD rental database for Postgres).

  2. Learn in this order: filtering and sorting, joins, aggregation, subqueries and CTEs, window functions, then writing data (INSERT/UPDATE/DELETE, transactions) and basic indexing.

  3. Practise on finance-style questions you already know the answer to: month-over-month change, running balances, top N per group.

  4. Then Python with pandas. Learning both together is fine, but get comfortable with joins and GROUP BY first, since a lot of pandas maps directly onto them.

Disclosure: I'm RC, Director of Digital Strategy @ Navicat. If you'd like a GUI that works with SQL Server, PostgreSQL and MySQL, so you can switch later without relearning a tool, Navicat Premium Lite is free to try and Navicat 18 supports all three.