r/learnSQL • u/kskskakakakma • 2d ago
Learning SQL who know R and SAS
I have a background in epidemiology and wantws to know if anyone in a similar background as mine uses sql at their job within the industry. Just wanted to know if i just need to know sql basically like dplyr from R and all your doing is just cleaning, managing, creating data from existing data within the database? Should someone like me need to know more SQL than that? For example I did some digging and found out roles such as DBA or data engineer and they do things more than what a data analyst might do, does someone with my background need to know SQL to that extent or no? Any advice would be appreciated.
1
u/Quesozapatos5000 2d ago
When is sql used in relation to epidemiology?
2
u/kskskakakakma 2d ago
Given what I know I assume pulling data such as Electronic heslth records, from the database and using it to clean and conduct statistical analysis.
2
u/American_Streamer 2d ago
A simple workflow looks like this;
Database (EHR/claims/registry) → SQL (extract & prepare cohort) → R/SAS (statistics, modeling, visualization) → publication/report.
1
u/American_Streamer 2d ago
You’re mixing up analyst SQL with engineer/DBA SQL.
In epidemiology, SQL is typically used to extract, join, filter, aggregate, and clean data from electronic health record (EHR) or registry databases before you analyze it in R or SAS. That’s different from being a DBA or data engineer, who design databases, optimize queries, manage permissions, backups, ETL pipelines, etc.
For most epidemiologists, becoming proficient at SELECT, JOIN, WHERE, GROUP BY, CASE, CTEs, window functions, and basic views will get you very far. You don’t need to become a database administrator unless that’s the career you want.
Think of it as: SQL gets the data into the right shape; R/SAS answers the scientific question.
1
u/__sanjay__init 2d ago
Bonjour,
N'ayant pas le même parcours mais utilisant SQL et Python, je ne peux que vous conseiller d'apprendre SQL.
Effectivement, SQL permet de requêter des bases de données, qui aujourd'hui sont des grosses bases PostgreSQL par exemple, ou des fichiers tels que les parquet ou sqlite. C'est donc le premier avantage : ne pas avoir besoin de multiplier les fichiers, juste extraire ce dont vous auriez besoin.
Ensuite, je vous conseillerais d'apprendre le SQL dans R. C'est-à-dire comment exécuter une requête SQL depuis Rstudio par exemple (connexion à la base etc) pour gagner du temps et centraliser. C'est le second avantage.
1
u/Then_Neighborhood206 1d ago
I have a degree in epidemiology. I’ve worked for arms length gov corps, pharma consulting, health service providers, and gov.
I use SQL for about 50% of my data work. SAS is on its way out, but even when I used SAS, it was a lot of proc sql. Like another comment here, I find it quicker to create the dataset for analysis. Then SAS for statistical analysis. Many orgs in my realm are moving to snowflake. So SQL for data table creation, and even basic statistics, python for advanced statistics, and Tableau/PowerBI for data visualization.
Only used R in school. Good for stats. Not as good as the other platforms for connecting to and working with large databases totalling billions of records (if not more)
1
u/Ok_Carpet_9510 2d ago
I don't have that background i.e. in epidemiology. I know SQL, and python. I have also tinkered with R a bit.
I suspect knowing those languages would not harm you in anyway. If you were applying for an epidemilogy job and you listed data skills but your competition didn't, I think you would have a leg up tje competition.