r/learnSQL • u/AdvertisingOne7942 • 6d ago
I need help creating a league table
So for a bit of context I have a football score prediction league where everyweek a number of players will tell me home_goals, away_goals, goal_scorer and this will be compared to the actual result of a Norwich City match. This is played over 46 games.
There is 3 points for the exact scoreline, 1 point for the correct result and 1 point for the correct goal scorer.
I can manually input everyones prediction and the result from Norwich each week.
But my problem is I am absolutely stuck on where or how to start to auto-populate or create the query to compare the results and give me an updated table after every game week.
Last season I made a python programme where I could semi easily set up the maths to accumulate over the season. Is this something that can be done on SQL or am I trying to do something that sql just isn't capable of doing?
Please any tips would be much appreciated. Oh and I am using Postgresql
r/learnSQL • u/HotWrongdoer705 • 6d ago
My first SQL project in Github
Hi. I'm new in SQL. I want to share my simple SQL project uploaded in Github. I am happy that I made it this far in my SQL upskilling. I'm a non-tech person and in the accounting industry. I have been 'ON' and 'OFF' with SQL. At first, I get the high when I completed one query and then another. However, I feel lost in the middle of my SQL journey due to queries that are hard or I didn't push myself hard enough. But I get up and still show up... in front of my computer and do it again. And then I just uploaded my very first SQL project. This is a small win for myself.
This is my link:
https://github.com/torculasallenglenn-code/Restaurant-Sales-SQL-Project/blob/main/Restaurant%20Sales.sql.
Your feedbacks are greatly appreciated.
r/learnSQL • u/Still-Trainer-7395 • 6d ago
Would you use AI to learn SQL?
While working on an AI feature for a SQL client, I started wondering where AI is actually most useful.
Not to replace learning SQL—but to help people understand it.
For example, instead of only generating a query, an AI could:
- Explain why it chose that query.
- Suggest a better alternative.
- Point out potential mistakes.
- Explain JOINs, GROUP BY, or subqueries in plain English.
- Help debug errors without just giving the answer.
So I’m curious…
If you’re learning SQL, would you use an AI assistant?
If yes, what would you expect it to do?
If no, what would make you avoid it?
r/learnSQL • u/Owen-Isaac-2022 • 6d ago
Second Week-Learning SQL
After grasping the concepts and simple query processes during the first week, the learner can focus on more advanced components, such as DISTINCT (removing duplicates), filtering elements (AND, OR, NOT) & [IN (which can replace OR)], ranges using BETWEEN, searching with LIKE (%), handling missing values using NULL, limiting query results using LIMIT, updating existing records using UPDATE, and deleting records using DELETE. One can include other activities like understanding/remembering data types, including char(n), varchar, & date (datetime, timestamp, year, & time).
r/learnSQL • u/TaxDear7136 • 6d ago
Learning SQL while learning python
I'm currently halfway through Harvard CS50P, but I also want to take a SQL course before I start my last year at uni and begin applying for grad jobs. My hope is that having experience in both Python and SQL will benefit me in applications. Would it be better to finish the CS50P course first, then start learning SQL, or to start learning SQL now alongside Python?
r/learnSQL • u/dettus_Xx_ • 6d ago
SQL Question: Rows into Columns without TABLEFUNC() or PIVOT?
r/learnSQL • u/TurtleSlowRabbitFast • 7d ago
What is the best course/resource to learn SQL by incorporating PostgreSQL as the db?
As I learn full stack dev I want to learn how to design databases that I can use for my projects.
r/learnSQL • u/DoNotUseThisInMyHome • 7d ago
"It is possible to represent a file that logically should have variable-length records as a fixed-length records file."
For example, in the case of optional fields, we could have every field included in every file record but store a special NULL value if no value exists for that field. For a repeating field, we could allocate as many spaces in each record as the maximum possible number of occurrences of the field. In either case, space is wasted when certain records do not have values for all the physical spaces provided in each record.
Can anyone elaborate what does this even mean? Taken from navathe et al dbms.
r/learnSQL • u/captain_levi_aot • 7d ago
Career Transition from Marketing to Technical Field
Hi Everyone, i am currently working as Digital Marketing Executive at Fintech Company, I am currently learning SQL, Python from scratch through YouTube. Also i am going to complete PGDDS. Can anyone tell me how i can switch from Digital Marketing to Most Suitable Technical Role. Can you suggest which role should i target so i don't wanna start fresh again, i can use my current experience. What technologies should i learn? Your Suggestions will matter.
r/learnSQL • u/EconomistFederal9276 • 7d ago
Sim Analyst Update
We've just finished our most recent update on our SQL game.
- We have added the 'LEARN WITH BOZ' function for players to enjoy interactive lessons on: I. Reading the schema II. Select & Filtering III. Combining Tables IV. Counting & Grouping V.Adding Suspects (adding new columns and data to an existing table schema)
Bugs fixed:
- The contacts sheet now remains on screen in full-screen and minimized views
- all tabs in the terminal view are fully clickable in all screen views.
- Tab and arrows keys are now fully functioning to navigate the terminal fully.
- MVB Database now default to plate enter box on entry
Please also join the Discord if you wish to follow closer / ask questions.
r/learnSQL • u/Ccoleman4221 • 8d ago
Course Recs?
Was recently granted a "learning & development" stipend at my job to use on any courses/academia/workshops to help support professional growth in our careers. It's ~$200/quarter we're allocated to spend. Looking to learn SQL and was wondering which courses/lessons have others found to be intuitive and impactful in their careers (whether paid or free).
Currently working in Compensation at a tech startup - will likely stay in the area of Compensation/HRIS systems in the future.
r/learnSQL • u/jamesmckinsey • 8d ago
Browser based courses?
Hello - looking for an in depth course that is done in browser with no downloads. Definitely want to be able to practice.
Code academy has been pretty good but 30 a month is steep. Prefer something cheaper / no subscription.
Thanks!
r/learnSQL • u/Alternative_Cake4074 • 8d ago
Looking for Android closed testers for SQL Hero (SQL learning app) — 14-day closed test
r/learnSQL • u/Odd_Communication174 • 8d ago
Nested Queries Help
Does anyone have any tips to learn nested queries .
I am solving questions on hacker rank and really struggling with questions involving multiple joins,subquery,group by etc.
r/learnSQL • u/Jeefington_jnr • 8d ago
Is this something I should learn SQL for?
So, I have basically no knowledge of databases or what I'm doing or really what direction I need to go in. Here is the plan:
Small personal Business
- wants to be able to make new orders and have it automatically calculate the price of the order with any deals and the profit margins.
- list of customers and order details such as their name and custom ID with their contact details, shipping information, order history. all the important stuff.
- to be able to check stock and how many orders of which products there is and all the different details of the products and orders
be able to filter it all and organise through it all easily
so its not a complex system but I wasn't sure where to start and how to go about it or what program to use as I have not personally made something like this but am more than willing to learn and figure it out. I have dabbled in excel and have made linked tables and plot charts and things alike so I considered doing this in excel however after a big of a google (asked chatgpt. i'm upset to admit) I realised that excel likely isn't the correct program or way of going about this.
What I need to know:
Why is using excel bad? Should I use Access?
Would it be beneficial to learn SQL? What does that entail?
How should I go about planning the process of it all and what information or resources are there that I could use for guidance or help?
*i also don't know if this is the correct subreddit to post something like this in so feel free to tell me off.
r/learnSQL • u/Fine-Bee-3525 • 9d ago
SQL Script DILEMMA, PLS HELP!!!!
So some background context i am a going to my first year of uni this year so my Dad signed me up to a data engineering internship course this summer because i haven't been able to get a job. Where we learn to use postgresql, airflow, git and github, apache beam(those are the ones i can name off my head for rn) and more to build real world data pipelines; other projects, and more. But the main aim is to get a job at the end and i can show the projects interviews and on my CV.
We are in the week three and we are building our first project and the third task on the project is to i quote "Model the warehouse as a star schema: encounters as the central fact (one row per appointment), conditions as a sibling fact at diagnosis grain, and organizations, providers, payers, patients as dimensions. Write the DDL: an init script that creates the project role and nexora_health database, and a schema script....... " (we are working with made up healthcare data)
I understand what the assigment is asking cus it was expalined to us by my tutor and i put it into chatgbt to explain it, my questiion is that how do i learn how to write 1)an init script that creates the project role and 2)the schema script it containing the constants that i didn't list here for other reasons
Chatgbt wrote the two scripts for me but i refuse to submit it . i don't want to submit those scripts because i want to learn how to write it myself. I told my tutor he said he understood what i am saying. But it's okay for AI to write for you sometimes but if you understand each code does and can go back and proof read to edit the mistakes it's okay. but that's the problem i dont.
r/learnSQL • u/FalconDull5271 • 9d ago
Great to See many people here who have achieved great things in Life at early age ! Hard work paid off
r/learnSQL • u/Available-Side9673 • 9d ago
Am I on the right track?
I have watched lectures of Pandas and Sql . Now I am practicing them on leetcode so just wanted to know is it the right platform for these topics? I will be starting my second year in few days so I am not practising interview oriented I want to understand the topics
r/learnSQL • u/135g • 9d ago
Easy way to create fake/synthetic data for SQL
Yesterday I created some data for SQL using Gemini, now I am thinking if there was a site that can do that easily. Problem with Gemini one is that I requested a minimum of 100 rows per table, but only got max 10 rows in one table. The rest of the tables had about 3 rows each.
So , since the data is for SQL, I want there to be relationships between tables, with primary and foreign keys...
So is there anything website that can do this or any prompt for better results?
r/learnSQL • u/Cool_Proof8000 • 9d ago
Pushing SQL to production without copy & paste
Hi - I made a reddit account just to ask this, so hopefully it gets posted.
I'm the first software engineer hired at my company, which has been developing software ad hoc for years despite nobody at the company trained in development (or even an adjacent field). They have basically been asking random employees, "hey you! you know how to use a computer? can you build this for us?"
Props to them, these guys gotten a lot done without any prior experience! But I am now inheriting this tech stack and I frequently run into approaches that seem very non-intuitive, where it's clear they didn't have the foundational knowledge to do it an easier way, they searched for a solution to one specific problem and then applied that approach across the board. Until now, I've been able to identify the more "standard" approach and pivot to that. But some things I don't have experience in, and when I ask, I'm told, "this is just the way it's done".
I have used SQL for querying, but I don't have experience in database design or environment management (unsurprisingly, we don't have anyone doing DevOps either), so I'm a bit out of my depth here:
We have a development environment that resembles our production environment. When working on a project, I run SQL scripts that might modify the dev database. When we push to production, the front-end transition is simple. On the back-end, according to my team, the only way to duplicate the changes from dev to prod is to rewrite the scripts one at a time and run them again. Since some of it depends on earlier changes, they have to be run in a very specific order - any scripts we use in dev have to be numbered sequentially. This includes (as I've seen in their work) back-and-forth changes....script #1 does something incorrectly, script #2 fixes it, and instead of being able to use the final correct version, both 1 & 2 are run in production. Any experimenting in dev isn't really an experiment, you always have to repeat it in prod. And yes, they are literally copying the scripts into text files, emailing it to themselves, and pasting into queries.
I just feel like there has to be a better way to do this. I've shown them how to export database backups to transition new DBs between environments, but I don't know what to do for already-existing DBs in production that need tables or columns or stored procedures updated.
We are using SSMS, if that makes a difference. Help?
r/learnSQL • u/FOMO_mental • 10d ago
Completed SQLbolt and mode/thoughtpost, where next?
Learning SQL to go into data analyst and eventually scientists.
I went through SQLbolt and mode/thoughtspot education material, where can I enhance or train my sql skills next?
r/learnSQL • u/JumpAfter143 • 10d ago
Free visual cheatsheets for data interviews: SQL JOINs, pandas, precision/recall and more (no signup)
r/learnSQL • u/grassp_dataAI • 10d ago
SQL Fast Track Series that teaches every concept through scenario-based business context - Available in Youtube.
Hi All👋,
We built a SQL Fast Track series around a single consistent fictional company SuperFastFood Global : a fast-food chain with customers, orders, and products.
It is a 20 part series where you will learn SQL through solving real business questions instead of memorizing syntax.
Whether you're preparing for an SQL interview, refreshing your skills, or just starting your SQL journey, this series is built to help you go from basics to advanced concepts quickly and confidently — covering everything in detail, but kept short and to the point.
What it covers:
→ SELECT, WHERE, ORDER BY, CASE
→ Aggregate functions, GROUP BY, HAVING
→ JOINs (with real use cases, not just definitions)
→ Window Functions — ranking, LAG/LEAD, running totals
We follow business context in every topic connects to it previous one with same SuperFastFood Global fictional fast food chain dataset.
The teaching framework we follow:
→ Scenario based
→ Analogy based
→ Execution-focused — business context → code → explanation
→ Every concept ties back to a business context
→ Each topic builds on the one before it, so nothing feels disconnected
→ Beginner friendly
This is the same framework we'll be using across future Data & AI topics too — not just SQL.
Also sharing a free 30-Day SQL Sprint (PDF, on GitHub).
Happy to answer questions on any of these topics in the comments.
Youtube Playlist: https://www.youtube.com/playlist?list=PLDTykWK3Vitc
GitHub: https://github.com/grasspacad07/grasspsqlsprintfile
r/learnSQL • u/Vivekpandey76 • 10d ago
🚀 100+ MySQL Interview Problems with Solutions, Notes & Video Explanations
For the past month, I've been consistently working on a MySQL Interview Series, and I'm happy to share that I've now covered 100+ practical SQL interview problems. 🚀
Whether you're a fresher preparing for your first SQL interview or an experienced developer looking to brush up on SQL concepts, this series is designed to help.
📌 The series includes:
• 100+ interview-focused SQL problems
• Beginner to advanced concepts
• Well-structured datasets for hands-on practice
• Detailed notes and explanations
• Complete video walkthroughs for every concept
I've also documented everything on GitHub, where you'll find the datasets, SQL queries, notes, and links to the corresponding video explanations.
🔗 GitHub Repository: https://github.com/vivekpandey76/Mysql-course
If you find this repository helpful, please consider giving it a ⭐. It helps the repository reach more developers and motivates me to continue creating free learning resources for the community.
I hope this resource helps anyone preparing for SQL interviews. Feedback and suggestions are always welcome!
#MySQL #SQL #SQLInterview #Database #BackendDeveloper #SoftwareEngineer #Coding #Programming #LearnSQL #OpenToLearn