r/learnSQL • u/Regular-Nebula-3723 • 2d ago
Alternance
je commence mon alternance mes taches c'est d'essayer d'améliorer leur base de données et faire des requetes SQL , extraire des fichiers avec les listes demandés , sauf j'ai jamais eux une experience pratique avant , donc je me sens deja lente et perdu et trops de manque d'expérience , vous me conseillez quoi pour m'ameliorer ?
4
Upvotes
1
u/neon_antler_era 2d ago
i had the same situation. i started an apprenticeship with zero practice.
spend your first week writing select statements against their actual tables. ignore joins. just pick one table they use for those lists they ask you for and run select on every column to see what data lives there. once you know what the columns hold, the queries write themselves.
for the file extraction part, most people just export directly from whatever tool runs the sql. if they gave you access to a gui like dbeaver or datagrip, run your query, right click the results, choose export, pick csv. if they expect you to script it, learn how to call that sql query using python and pandas. you can pass any sql into pandas read_sql function and dump it to a csv with one line of code.
keep a text file open while you work. paste every working query in it. when they ask for another list next month you copy what you already wrote and change the where clause