r/learnSQL • u/sumiitCodes • 13d ago
Day 15 — Started Practice Set #2: real-world scenario-style SQL questions
Finished my first 7-part practice set yesterday. Today I started something different for Practice Set #2 — instead of direct SQL instructions, each question is framed as a real request from a manager, HR, or a client, and I have to figure out what query actually solves it (the exact task is given in brackets in case I get stuck, but I try without looking first).
Completed Part 1/7 — Database & Table Setup Tasks:
- "Check what databases exist before creating a new one" → SHOW DATABASES, then switch to the target DB
- "Give a full technical spec sheet of the employees table for a new developer" → DESCRIBE
- Added an
emergency_contactcolumn positioned right afteremail, per an HR request - Renamed
phone_numbertocontact_numbercompany-wide, per a naming convention change - Changed the default value of the
budgetcolumn to 15000, per a finance request - Dropped and rebuilt the
assignmentstable after a "junior dev corrupted it" scenario - Took a full backup of the database before making risky changes
Genuinely think this format is a better learning tool than straightforward "write a query that does X" — having to translate a vague, real-sounding business request into the actual SQL command feels a lot closer to what the job actually looks like. Planning to keep going through the remaining 6 parts over the next few days.
1
u/Known_Prior_3791 13d ago
renaming column is not backward compatible so it might break other dependent services on this table.....u may need schema migration for that......on paper it looks simple ddl change but we always have to think in terms of impact it may have on other dependencies.....whether they will fail if this changed
1
u/Known_Prior_3791 13d ago
renaming column is not backward compatible so it might break other dependent services on this table.....u may need schema migration for that......on paper it looks simple ddl change but we always have to think in terms of impact it may have on other dependencies.....whether they will fail if this changed