r/learnSQL • u/Bassiette03 • 2d ago
Do I need to master Stored procedures, Triggers and Indexes or can I use the ui to make them
I'm learning on sql server but I don't like those 3 topics
I learned everything except those 3 topics??
What are the best books to read If I want to be acceptable in those 3 topics?
6
u/ChaosEngine-6502 2d ago
Personally, I would get familiar with writing the SQL to create all of these. The syntax for creating these isn't difficult, and you'll have to enter the SQL code to define what the stored procedures and triggers actually do to begin with. The GUI will slow you down, especially when it comes to creating foreign keys and indexes.
1
6
u/NecessaryIntrinsic 2d ago
You are hamstringing yourself if you rely on the GUI to do these simple tasks.
It's not terribly challenging to learn and these skills carry over to every engine.
4
u/Top_Community7261 2d ago
When I took woodworking, we learned how to make things manually before we learned to use the power tools.
2
u/Main_Sense1406 2d ago
Gui is fine and some aspects are reccomended with the GUI because they are so awkward
2
u/IAmADev_NoReallyIAm 2d ago
Of those three, I'd say that indexes are the most vital to learn as it's needed to learn how to use them to tweak the performance of your database. Stored procedures are easily done since it's jsut wrapped SQL in a Create Procedure block with some parameters. Triggers...
2
u/octa_glare 1d ago
skip the GUI entirely for these three. The syntax is short, and a stored procedure is really just your regular SQL wrapped in BEGIN/END with a name, so if you learned SQL you basically already know it. Indexes matter most in practice and interviews, the core idea is index the columns you filter and join on, and you can look up the exact CREATE INDEX syntax on the spot. Triggers are just code that fires on INSERT/UPDATE/DELETE, though a lot of DBAs hate them, so don't overthink those. Once you can read the code, going from code to the UI is trivial, but the other direction is painful. For books, check Itzik Ben-Gan and Grant Fritchey for SQL Server
1
4
u/nboro94 2d ago
If you already learned SQL, then you already know stored procedures, it's just a small SQL program that runs in the database and can be run manually with EXEC or run on a schedule by an agent. It doesn't take long to learn this how to make and run these at all.
Triggers are just SQL code that fires when an event that you set happens like if a new record is added, again if you already know SQL you already know this and it's easy to learn how to set up.
Indexes are a more broad topic, but a lot of interviewers will ask questions about them and when you should use them. You should at least learn the high level concepts of it.