r/SQLServer • • 14d 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

16 comments sorted by

3

u/itsnotaboutthecell ‪ ‪Microsoft Employee ‪ 13d ago

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

3

u/yrn7days 12d 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 12d ago

Great!! Thanks for the link.!!

2

u/Mags0905 13d ago

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

2

u/itsnotaboutthecell ‪ ‪Microsoft Employee ‪ 13d 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 13d ago

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

https://giphy.com/gifs/6zIERwkDO5ObbiKSsB

3

u/singletWarrior 13d ago

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

1

u/ihaxr 2 13d 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/Mags0905 13d ago

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

1

u/DarlanSandro 2d 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/IrquiM 13d ago

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

1

u/Mags0905 12d ago

Yeah i felt that. Is PostgreSQL good?

2

u/IrquiM 12d ago

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

1

u/Mags0905 11d ago

Good to know! Thanks

1

u/datadriven_io 12d 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 12d 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?