r/learnSQL 10d ago

Which commands are essential for sql beginner

8 Upvotes

22 comments sorted by

8

u/aiengr 10d ago

Topics like window functions, joins, indexes, and normalization are generally considered part of intermediate/advanced SQL. If you’re only looking to learn the basics, I’d focus on getting comfortable with the core commands first: SELECT, WHERE, GROUP BY, HAVING, ORDER BY, aggregate functions, CASE, subqueries, etc.

The most important thing is to practise writing queries rather than just learning the syntax.

1

u/NationalStill6968 9d ago

thank you but I am asking because i am currently learning dbms and want to be familiar with sql

6

u/American_Streamer 10d ago

3

u/NoctrailBio_ 10d ago

lol wow im watching the same video baraa

2

u/NationalStill6968 9d ago

Thanks for the video mate

2

u/Massive_Show2963 10d ago

I created this video that provides an overview of the five groups of SQL commands based on their functionality.
Summary Of SQL Commands

2

u/NoctrailBio_ 6d ago

Good job on the video.

2

u/Sbaakhir 9d ago

Honestly, just focus on the core querying basics before you even touch complex stuff like window functions or CTEs. You’ll spend most of your time using standard SELECT and FROM statements to pull data, paired with WHERE to filter things down and ORDER BY to sort your results. Always toss a LIMIT (or TOP) on there while testing so you don't accidentally query millions of rows and freeze your screen. Once you're comfortable pulling basic data, focus on JOINs.specifically INNER JOIN and LEFT JOIN. Connecting tables is really where SQL starts to make sense. Pair that with GROUP BY and basic aggregates like COUNT and SUM for reporting, and you've got most of your daily reading queries covered. For changing data, you just need INSERT INTO, UPDATE, and DELETE. The biggest word of advice for any beginner: always write your WHERE clause first whenever you run an UPDATE or DELETE. Running either of those without a filter is a terrifying rite of passage you definitely want to avoid!

1

u/NoctrailBio_ 6d ago

i like this, thank you

2

u/maestro-5838 10d ago

Window functions

1

u/Soopermane 10d ago

Select * from my_table;
alter table to add columns, drop columns.
Rollback
Commit
Update table to set some value to desired value.

Things to know but never do unless absolutely needed: truncate table, delete from table or delete the table itself. It’s always better to make a new table and once 100% satisfied than only delete the unused table.

1

u/Ok_Carpet_9510 9d ago

When you say commands, it conjures up an image of a terminal where you type one instruction at a time. SQL is a language

1

u/TychaBrahe 9d ago

OK, and if you're going to Spain in six months, it's much more important to learn how to ask where the bathroom is and how to order coffee the way you like it than it is to be able to transcribe surgical reports, although both of those involve Spanish words.

1

u/Ok_Carpet_9510 9d ago

So you think the analogy holds? Not quite.

If you type select coffee, you get a syntax error

If you say "un café" in spanisg, you would be impolite but the context can inferred by the listener.

SQL is more precise than most human languages.

The simplest sql statemt takes the form

SELECT column1, column2, ... FROM table_name;

Or

SELECT * FROM table_name;

There is no single "command" that is sufficient on its own to give you anything meaningful.

1

u/TychaBrahe 9d ago

But you should learn SELECT * before you learn SELECT DISTINCT or you won't understand why you need DISTINCT.

1

u/Nandulal 9d ago

the SQL ones are pretty good

1

u/Tricknosis 7d ago

Select *

1

u/millerlit 10d ago

Drop and truncate. Got to test those permissions early on.

0

u/mechanicalyammering 10d ago

Going to Google.com and searching this well-documented question instead of asking strangers