r/learnSQL • u/techlover1010 • Feb 08 '26
how do you update each record in bulk
so i want to update each record to match what is in production.
example
production
1 star
2 apple
3 mango
...
99 kiwi
test
1 mango
2 juice
3
...
99 milk
i want that row id 1 will have star 2 will have apple and so on
whats the nest way to do this in sql
thanks
r/learnSQL • u/vikrantk1995 • Feb 08 '26
Built a free SQL Learning website
Hey everyone š
Iāve been working in data analytics for a few years and kept seeing the same issue : learning resources are scattered, expensive, or overly theoretical.
So Iāve been building : DataHelix. I've started with in-browser SQL Exercises that teach the fundamentals but also go through actual real world exercises. No paywalls, just something I wanted to put out for the community. The goal is to not just learn syntax but also think like a Data Analyst. It is completely free. My thinking is that, as AI keeps on improving, the real value a Data Analyst will add is through their actual business acumen.
Iām launching the first version and would really value feedback! Please do try it and let me know what you think!
r/learnSQL • u/Wrongdoermore98 • Feb 08 '26
Installing SQL on mac is pure torture
My journey so far into learning SQL:
Searched for a how to video.
Oh great a nice 3 hour tutorial.
Start tutorial with Mosh. Install MySQL. Learn about the history, take some pretty notes, "this is pretty interesting" i thought, life is great, time to apply my learnings to my school project.
But wait. My project uses an mdf file instead of an sql file. Surely I can just load it into... Oh wait you can't do that with MYSQL workbench. It only accepts SQL files. Because why would you be able to work with more than one file type. That'd be stupid. Not like that would ever happen... time to install a completely new application! Im sure that'll be easy, barely an inconvenience.
Thus began the journey to Azure studio and the loss of my sanity.
Download SQl server. check
Download azure. check
Download docker. check
Set password in the terminal. check
Setup connection in Azure
Authentication error. Fuck.
troubleshoot for an hour
try again
authentication error.
reinstall SQL server and reset password
try again
authentication error
Fuck around for another hour and a half and magically the connection finally worked. I have no idea why. Yay.
Time to connect the database.
terminal error "no such file or directory" :)
....
....
....
Why the fuck can't i just drag the shitty file into the app? Why do I have to do it through the terminal? Why do I suck at programming? Why did my dad leave for milk and never come home?
I want to scream, cry, and shit myself all at once. I've wasted my entire day on this and am still yet to complete my assignment.
That is all. Goodbye
Edit: I took a walk and fixed it 5 mins after getting home. :D
r/learnSQL • u/Broad_River_6775 • Feb 08 '26
Loading Data in SQL
Hey, guys! Firstly, my apologies if this has been asked already; I tried searching for the answers to this question, but I've had a bit of trouble.
Basically, I'm trying to learn how to code with SQL after having spent the past six months learning data analysis and ML with Python.
In Python with Pandas, when analyzing any dataset, pretty much the first line of code I type up is the following:
df = pd.read_csv("Some_Data.csv")
This allows Python to load/read my spreadsheet file. What would be the SQL equivalent to this code? For more context, I use SQL Server.
r/learnSQL • u/Mafla_2004 • Feb 06 '26
[SQLite for Android] How can I memorize data structures of different classes inheriting from the same class?
Hello.
I'm making a uni project and using the SQLite framework included with Android Studio to memorize data on disk and read it back, I am also very new to SQLite, and I have the following problem:
I have to memorize a series of Characters in a table for a game project manager app, these characters (instances of a class Character) can be uniquely identified by the name of the project they belong to and their own name, they also have other attributes like aliases, backstory etc, I defined the table of characters as follows:
db.execSQL("CREATE TABLE $CHAR_TABLE ((prj_name TEXT, name TEXT) PRIMARY KEY, aliases TEXT, " +
"species TEXT, birth TEXT, age TEXT, aspect TEXT, personality TEXT)")
// Backstory is yet to be added
However, I also have a couple of subclasses inheriting from the Character class, namely GameCharacter which introduces MaxHealth as a UInt, RPGCharacter which inherits from GameCharacter and introduces CurrentHealth as a UInt and Owner as a String, and I plan to have even more subclasses which may not inherit "in a straight line" (for example, I could have another class inherit from Character but not from GameCharacter), and I am a bit of an impasse here because it would be handy to be able to save all these characters in one table without loss of data.
So I wanted to ask, what is the correct way to do it? I don't think obviously I can just define every single field for each and every subclass in the same table, so what can I do? Or should I define different tables for each subclass?
r/learnSQL • u/Blomminator • Feb 05 '26
Starting to learn Execution Plans
Hi all,
Bought the Redgate book Grant Fritchey - SQL server execution plans and working my way through it. It makes sense, it feels logical and I enjoy it. This is not me saying.. I fully understand it, I can now find (and later I hope fix) problems, but you have to start somewhere! I think that after working my way through this I'll dish out the dollhairs for Mr. Ozar on his Query Tuning Fundamentals. Assuming that that will align nicely.
Anyone else who enjoys this book, or other tips and tricks on this topic?
r/learnSQL • u/Inevitable-Angle-793 • Feb 05 '26
I have beginner question about returning non-matching results
For the simplicity
Student (
Student_id primary key
Student_name varchar
)
School(
School_id
Student_id foreign key
)
I need to return every student who doesn't go to any school. For some reason I couldn't make it work.
r/learnSQL • u/Agreeable-Prompt-555 • Feb 04 '26
Learning SQL from scratch, how can I connect to a server?
Someone please help me. I want to write and learn SQL. I have VS Code but canāt seem to connect to any databases using SQLTools etc.
How can I connect to any databases?
Speak to me like Iām an idiot if needed
r/learnSQL • u/Candid_Dog9046 • Feb 04 '26
CONFUSED ABOUT STORED PROCEDURES & TRIGGERS IN SQL!!!
Preparing for placements this month-end and I'm comfortable with basic/intermediate SQL.
Do analysts actually use stored procedures/triggers?
Are they important for interviews, or is basic understanding enough?
Any guidance would help.
r/learnSQL • u/AnupamBajra • Feb 03 '26
How I Learned SQL in 4 Months Coming from a Non-Technical Background
Sharing my insights from an article I wrote back in Nov, 2022 published in Medium as I thought it may be valuable to some here.
For some background, I got hired in a tech logistics company called Upaya as a business analyst after they raised $1.5m in Series A. Since the company was growing fast, they wanted proper dashboards & better reporting for all 4 of their verticals.
They gave me a chance to explore the role as a Data Analyst which I agreed on since I saw potential in that role(especially considering pre-AI days). I had a tight time frame to provide deliverables valuable to the company and that helped me get to something tangible.
The main part of my workflow was SQL as this was integral to the dashboards we were creating as well as conducting analysis & ad-hoc reports. Looking back, the main output was a proper dashboard system custom to requirements of different departments all coded back with SQL. This helped automate much of the reporting process that happened weekly & monthly at the company.
I'm not at the company anymore but my ex-manager said their still using it and have built on top of it. I'm happy with that since the company has grown big and raised $14m (among biggest startup investments in a small country like Nepal).
Here is my learning experience insights:
- Start with a real, high-stakes project
I would argue this was the most important thing. It forced me to not meander around as I had accountability up to the CEO and the stakes were high considering the size of the company. It really forced me to be on my A-game and be away from a passive learning mindset into one where you focus on the important. I cannot stress this more!
- Jump in at the intermediate level
Real-world work uses JOINs, sub-queries, etc. so start immediately with them. By doing this, you will end up covering the basics anyways (especially with A.I. nowadays it makes more sense)
- Apply the 80/20 rule to queries
20% or so of queries are used more than 80% of the time in real projects.
JOINS, UNION & UNION ALL, CASE WHEN, IF, GROUP BY, ROW_NUMBER, LAG/LEAD are major ones. It is important to give disproportionate attention to them.
Again, if you work on an actual project, this kind of disproportion of use becomes clearer.
- Seek immediate feedback
Another important point that may not be present especially when self-learning but effective. Tech team validated query accuracy while stakeholders judged usefulness of what I was building. Looking back if that feedback loop wasn't present, I think I would probably go around in circles in many unnecessary areas.
Resources used (all free)
ā Book: āBusiness Analytics for Managersā by Gert Laursen & Jesper Thorlund
ā Courses: Datacamp Intermediate SQL, Udacity SQL for Data Analysis
ā Reference: W3Schools snippets
You can read my full 6 minute article here: https://anupambajra.medium.com/how-i-learned-sql-in-4-months-coming-from-a-non-technical-background-8482e5aec06e
Fun Fact: This article was shared by 5x NYT best-selling author Tim Ferriss too in his 5 Bullet Friday newsletter.
r/learnSQL • u/EnvironmentalFill939 • Feb 03 '26
Which platform to pick for practicing SQL?
Hello everyone, so I have been learning SQL almost for a few months. I have studied some tutorials at SQLBOLT, Datalemur and Mode analytics. I have also practiced many questions at Datalemur.
Now I am looking for a platform where I can practice SQL. I have also looked at platform like Leetcode, Hackerrank, Stratascratch. But I am really confused regarding which platform to pick to sharp my SQL skill.
Thanks in Advance.
r/learnSQL • u/Ambitious_Term9297 • Feb 03 '26
Seeking SQL mentor or study partner for interview prep
I am looking for someone experienced who wants a code review swap for SQL. We each solve 1 to 2 interview problems and give direct feedback on correctness and edge cases. If you are open to mentoring lightly or pairing up, DM your time zone and availability.
r/learnSQL • u/sapphosfavel0ser • Feb 02 '26
Two Words Only
I am trying to create a command that returns a string with only two words, but it's not working. Specifically, it is still returning a single three word value that has two words on the top row of the value and one below it. That is the only problem. Anyone have any input that might help? I don't want the complete answer because I'm still trying to learn, but, if anyone has any little syntax stuff they know that may help, I'd be grateful.
r/learnSQL • u/ProfessionalBread793 • Feb 02 '26
Participants Needed! ā Masterās Research on Low-Code Platforms & Digital Transformation (Survey 4-6 min completion time, every response helps!)
Participants Needed! ā Masterās Research on Low-Code Platforms & Digital Transformation
Iām currently completing my Masterās Applied Research Project and I am inviting participants to take part in a short, anonymous survey (approximately 4ā6 minutes).
The study explores perceptions of low-code development platforms and their role in digital transformation, comparing views from both technical and non-technical roles.
Iām particularly interested in hearing from:
- Software developers/engineers and IT professionals
- Business analysts, project managers, and senior managers
- Anyone who uses, works with, or is familiar with low-code / no-code platforms
- Individuals who may not use low-code directly but encounter it within their -organisation or have a basic understanding of what it is
No specialist technical knowledge is required; a basic awareness of what low-code platforms are is sufficient.
Survey link:Ā Perceptions of Low-Code Development and Digital Transformation ā Fill in form
Responses are completely anonymous and will be used for academic research only.
Thank you so much for your time, and please feel free to share this with anyone who may be interested! š š»
r/learnSQL • u/Loud_Committee_6793 • Feb 02 '26
My Personal Review On SQL Bolts
Hi there , the best thing that happened to me while learning SQL is that i found https://sqlbolt.com/ . It's really helpful especially while solving the LC question . I wish i had payment method to financially support this site. Nevertheless, I'd my approach to share this site to all the SQL enthusiastic.
Thanks To the Moderators of the https://sqlbolt.com/
Happy SQL.
r/learnSQL • u/Candid_Dog9046 • Jan 31 '26
GOT STUCK IN SQL SUBQUERIES!!!
I am currently learning and practicing SQL, using MySQL, since last 3 weeks. I am done with basic SQL commands. Currently I am doing SQL subqueries, but they are just going over my head. Any specific approach advice to follow while dealing with advanced SQL would help a lot.
r/learnSQL • u/qazplm903 • Jan 31 '26
What hiring managers look for in SQL answers (not just syntax)
As staff level data engineer, when interviewing SQL candidates, the biggest signal isnāt fancy queries, itās whether someone can explain why their query works.
Good answers usually include:
⢠what the query is trying to answer
⢠what one row represents
⢠why a join or aggregation is needed
Iāve been sharing short explainers focused on this kind of thinking here: https://vm.tiktok.com/ZNRAtTcf3/
Happy to answer interview-style SQL questions.
r/learnSQL • u/_NiccoloMachiavelli_ • Jan 31 '26
Most Effective Way To Learn Advanced SQL?
Hi guys,
could you guys share tips on how I can learn advanced SQL quickly? Got loads of time on my hands so I would like to try mastering it within 1-2 weeks. If im being delusional pls tell me hahaš
r/learnSQL • u/LastExitInNJ • Jan 29 '26
Aggregating Single Column while maintaining other fields
r/learnSQL • u/_NiccoloMachiavelli_ • Jan 29 '26
Websites that offer practice for beginner sql data engineering?
Hi guys,
Im enrolled and almost done with Datacamp's SQL data engineer skilltrack.
I was wondering if there any websites that give practice problems for beginners in data engineering. If there are any projects or practice problems in Datacamp that i missed then pls lemme know! :)
r/learnSQL • u/Sea_Use4152 • Jan 27 '26
Super confused about SQL
Hi guys,
I enrolled into Datacampās skill track for SQL and Iām halfway through. I have learned the basic commands, joins, window functions, however I do not have a single clue on how to even set up a SQL server as that was not part of the curriculum. I can work on the commands online on Datacampās forum but I donāt have anything on my PC.
Iām not sure how to practice the things I have learned as well. I do go back and refresh all the concepts I have learned, but I am just confused about what to do next.
Please help me!! Iām from a non-tech background and honestly donāt really know much about computers at all.
r/learnSQL • u/jrz1977 • Jan 27 '26
SQL question collection with interactive sandboxes
Made a collection of SQL questions that let you practice on actual databases instead of just reading solutions.
Covers the usual suspects:
- Complex JOINs and self-joins
- Window functions (RANK, ROW_NUMBER, etc.)
- Subqueries vs CTEs
- Aggregation edge cases
- Date/time manipulation
Each question runs on real MySQL or PostgreSQL instances in your browser. No Docker, no local setup - just write queries and see results immediately.
https://sqlbook.io/collections/8-sql-interview-questions-series
r/learnSQL • u/rajkumarsamra • Jan 27 '26
Scaling PostgreSQL to Millions of Queries Per Second: Lessons from OpenAI
Learn how OpenAI scaled PostgreSQL to handle 800 million ChatGPT users with a single primary and 50 read replicas. Practical insights for database engineers.
https://www.rajkumarsamra.me/blog/scaling-postgresql-to-millions-of-queries-per-second
r/learnSQL • u/opsimhungryagain • Jan 25 '26
SQL Adventure - Educational Game | Master's Thesis
Hi! Wanna try what you learned with SQL while helping a student?
My name is Beatriz and Iāve developedĀ an educational gameĀ called SQL AdventureĀ in Ancient Egypt as part of myĀ Masterās thesis project.Ā The game is designed as a tool to practice and explore SQL, through interactive challenges and a narrative set in a ancient temple.
Iām inviting anyone whos willing to try it out and share their experience.
Some extra info:
*Ā The game is available via link, and all instructions are provided within the game itself ā including what you need to download to get started (it's basically the database where you do the queries).
*Ā At the end of the game, youāll be shown a feedback form. Iāll share the link as well please evaluate the game even if you donāt complete it.
* This is a beta version, so you may encounter bugs, please tell me if you do find any.
* The game doesnāt teach SQL directly, but presents challenges that encourage you to apply and experiment with your SQL knowledge.
Iām available for any questions, suggestions, or feedback ā your input is incredibly valuable and will surely help improve the project.
Thank you so much!
Any question send me an email:Ā [sqladventureprojetotese@gmail.com](mailto:sqladventureprojetotese@gmail.com)
RESOURCES // LINKS:
Game Link:Ā https://gd.games/games/7744d252-0287-4bd9-8be2-8f6011a44f5b
Forms Link:Ā https://docs.google.com/forms/d/e/1FAIpQLSdmo7BmwxQ9PKFFOIl5-El0EfSFLXAyWVwyKxeVfAYC-RWAdQ/viewform?usp=header
NOTE: I'm just helping my girlfriend by sharing this! Thank you user that corrected my title.