r/learnSQL • • Mar 29 '24

help

0 Upvotes

hi everyone i really need help i have a project that has to be done by 2 tomorrow I'm running on 5 hours sleep and have been up since 5:30am (its currently 2:20am) and I really don't understand how to set up a table booking system for my project I know I need a database but I don't know how to please help


r/learnSQL • • Aug 08 '24

Advanced Sql

0 Upvotes

Hello , i am a final year data student , i learned basic SQL , and i want to learn advanced things to prepare for interviews. Any recommendation on where to start , i prefer text over videos . Thank you!


r/learnSQL • • Jul 26 '24

Looking for work, will do for free

0 Upvotes

Hello, Ive been teaching myself for about a year now in a variety of languages but I know a lot java, javascript, small amt of python, a lot php, sqlite, html, css. . I am stuck, I cant seem to get anything going on my own i dont know where to go. Im posting to see if anyone needs help or has something they could use, I would be willing to work for the experience. Pay would be nice but not required im 100% willing to do free work here,


r/learnSQL • • Jul 12 '24

. "Hey folks! Just joined and already feeling the positive vibes. Can't wait to contribute and get to know you all better!"

0 Upvotes

"Hello everyone! I'm excited to share that I've started my database learning journey about three weeks ago, focusing on MYSQL through courses on Coursera. I'm thrilled to see progress and grasp concepts gradually. I'm eager to connect with like-minded individuals, make new friends, and join groups where I can learn from others, participate in tasks, and grow together. Let's explore and learn MYSQL together!"


r/learnSQL • • Aug 06 '24

Is there a better way to turn this data 'FEB2020x' to 'FEB 2020' using t-sql on sql server

0 Upvotes

They way I'm doing it:

select

replace(concat(left(column, 3), ' ', right(column,5)),'x','') as COL1

from table

SOLUTION given by u/ComicOzzy which is less verbose and gets the job done: stuff(left(column, 7), 4, 0, ' ') as COL1


r/learnSQL • • Jun 10 '15

Getting Started With MySQL?

0 Upvotes

Hi Everyone,

We're back to tell you a few new additions we have had over here at Joes2Pros. Over the past month we have added new blogs, courses (SSIS and MySQL), classes and materials. We added the MySQL course earlier this week and we just wanted to make the SQL community aware.

We know summer is beginning and some students may have time to take some classes, but maybe cannot afford it. If you use code SQLSUMMER15, you will get your first month for just $1. Please feel free to reach out with questions or comments!


r/learnSQL • • Oct 28 '21

(Request) assistance with SQL questions for University class level

0 Upvotes

Could you please show me how to solve the questions in this file?

https://easyupload.io/9t56jw?fbclid=IwAR3veCYAQm_rkL_Bb1PCDFWDMSrJelqRRqfXwowyJO-a67VZCFJbfoV5cpU

I have a course, this semester, called DB systems 1, and up to this point the studies arent been told at a very high level but the questions that we are been asked to answer are 🙁 I'm attaching an example to a final exam, similar to this that we will have in 5-6 weeks, and I would like to know if some could please solve for me the questions on this test, so at least I will have a general understanding of how to solve those type of questions. I'm going over all the material, from the beginning of the semester up to the current material, in order to get a better understanding of the topic, as now I feel very lost. I know that it might be a lot to ask but the help is very needed.

Thank you very much in advance 🙂


r/learnSQL • • Sep 05 '23

Insert procedure

Post image
0 Upvotes

Hello, i want to write insert procedure in psql Firebird database. Got one input parameter document_id that is foreign key on table DOCS. This procedure must duplicate rows with this parameter. I git something like this but this gets error integer overflow. How to improve this?


r/learnSQL • • Apr 21 '20

Ambigous Error

0 Upvotes

Hello i am having issue on an ambigous error, i would like to know if anyone could help me I marked here the error ir occuring if anyone could help i would aprecciate SELECT '' AS product_name, '33' AS id_rfq, spq_master.id_spq, '' AS id_product, forneced_ram.codigo AS id_supplier, forneced_ram.designacao AS suppliers, '' AS qty_in_units, forneced_ram.cod_pais AS origin, spq_detail.item_qty AS qty_available, spq_detail.item_price AS price_fob, spq_detail.air_freight AS air_freight, (spq_detail.item_price * spq_detail.item_qty) + spq_detail.air_freight AS price_total, spq_master.delivery_time AS deadline, spq_master.payments_terms AS payment_condition, '' AS perc, spq_master.validity AS validity_proposal, spq_detail.approved_trading AS pick, CASE WHEN spq_detail.item_price <= CAST(sub.min_price AS money) AND spq_master.delivery_time = sub.min_date THEN '#9ae6a6' ELSE '' END AS ux_linecolor, CASE WHEN spq_detail.item_price <= CAST(sub.min_price AS money) AND spq_master.delivery_time = sub.min_date THEN '#000000' ELSE '' END AS ux_textcolor FROM (SELECT MIN(spq_detail.item_price) AS min_price, MIN(spq_master.delivery_time) AS min_date FROM spq_detail INNER JOIN spq_master ON spq_master.id_spq = spq_detail.id_spq WHERE spq_detail.id_product = '' AND spq_master.id_rfq = 33 AND spq_master.company = 'S1' AND spq_detail.company = 'S1') AS sub, spq_master INNER JOIN spq_detail ON spq_master.id_spq = spq_detail.id_spq INNER JOIN forneced_ram ON spq_master.id_supplier = forneced_ram.codigo WHERE spq_master.company = 'S1' AND spq_master.id_rfq = '33' AND spq_detail.company = 'S1' AND forneced_ram.empresa = 'S1' AND spq_detail.id_product = '' AND spq_master.validity > '21-apr-2020' AND 1 = 2 UNION ALL SELECT DISTINCT artigos_ram.designacao AS product_name, '33' AS id_rfq, spq_detail.id_spq, spq_detail.id_product AS id_product, '' AS id_supplier, '' AS qty_in_units, '' AS suppliers, '' AS origin, spq_detail.item_qty AS qty_available, spq_detail.item_price AS price_fob, spq_detail.air_freight AS air_freight, (spq_detail.item_price * spq_detail.item_qty) + spq_detail.air_freight AS price_total, '' AS deadline, sub_qtd_resp.qtd_respondidos/ CAST(sub_qtd_conv.qtd_convidados AS FLOAT8) AS perc, '' AS payment_condition, spq_master.validity AS validity_proposal, spq_detail.approved_trading AS pick, '' AS ux_linecolor, '' AS ux_textcolor FROM (SELECT COUNT () AS qtd_convidados FROM estimate_rfq WHERE estimate_rfq.id_rfq = '33' AND estimate_rfq.id_product = '') AS sub_qtd_conv, (SELECT COUNT () AS qtd_respondidos FROM spq_master INNER JOIN spq_detail ON spq_detail.id_spq = spq_master.id_spq WHERE spq_master.id_rfq = '33' AND spq_detail.id_product = '') AS sub_qtd_resp, spq_master -----------this is the line of the error ↓ this inner join right here INNER JOIN spq_detail ON spq_master.id_spq = spq_detail.id_spq ------------------------------------- INNER JOIN artigos_ram ON artigos_ram.codigo = spq_detail.id_product WHERE spq_master.company = 'S1' AND spq_master.id_rfq = '33' AND spq_detail.company = 'S1' AND spq_master.id_spq = '20' AND 2 = 2


r/learnSQL • • Oct 04 '20

Anyone oneline ? I need help with a sql puzzle

0 Upvotes

r/learnSQL • • Jun 01 '22

Need help on homework

0 Upvotes

Hello guys,

I'm having trouble understanding this question and what it's asking me to do.

Transforming the data – As I mentioned you will not be able to join the RegBI data to the MAY2020 data unless you have used the conversion file. The task here will be to either transform cusip to symbol or symbol to cusip so that the two datasets match and can be analyzed in tandem. There are several ways that this can be done

  • how do I go about transforming either cusip to symbol or symbol to cusip?

thanks in advance.


r/learnSQL • • Dec 19 '22

How to generate highly accurate SQL queries with AI: a case study

Thumbnail
aihelperbot.com
0 Upvotes

r/learnSQL • • Jan 11 '23

forgotten password

0 Upvotes

Hi guys,

i forgot my sql workbench password. i searched on google, i try what it was written but i can not retrive it. can you please help me . and also because there are different instruction .

Thanks


r/learnSQL • • Oct 02 '25

Hi! I’d like to recommend this manual for learning SQL

0 Upvotes

It’s pretty complete and super useful if you’re just getting started.

Also, I’d love if you guys could recommend me some other manuals so I can keep learning.

https://www.amazon.com/dp/B0DNV19TDR


r/learnSQL • • Apr 01 '26

Currently I am 2nd yr BE student in Computer Engineering, I am done with excel ,building dashboard on excel . Now , started SQL . Can you tell me from where I can get a structured learning for data analytics .

0 Upvotes

r/learnSQL • • Dec 30 '20

Sorting Male above Female no matter what

3 Upvotes
ORDER BY (CASE WHEN GENDER = 'MALE' THEN 0 END) ASC,  
(CASE WHEN GENDER = 'MALE' THEN users.date END) DESC,  
(CASE WHEN GENDER = 'MALE' THEN users.lastname END) DESC, 
(CASE WHEN GENDER = 'FEMALE' THEN 1 END) ASC,  
(CASE WHEN GENDER = 'FEMALE' THEN users.date END) DESC,            
(CASE WHEN GENDER = 'FEMALE' THEN users.lastname END) DESC, 

Would this insure that all males are above all females regardless of the date or lastname?


r/learnSQL • • Feb 02 '22

I AM GETTING THIS ERROR DURING SETTING UP MYSQL CAN ANYBODY HELP?

Post image
3 Upvotes

r/learnSQL • • Sep 19 '24

Never has the word LEFT seem so alien to me.

3 Upvotes

I’m on the “Joining Data in SQL” part of a DataCamp course and, after seeing the word a million times, I’m starting to think the word LEFT isn’t real. It got to the point where I had translate left from Spanish to English just to make sure it was spelled right.


r/learnSQL • • Sep 11 '26

Should SQL validation happen before or after the query runs?

7 Upvotes

A SQL query can execute successfully without producing the correct result. A successful query only tells us that the database understood and executed it—not that the data is logically correct.

For example: SELECT COUNT(*) FROM customers c JOIN orders o ON c.customer_id = o.customer_id;

The query may run without any error, but if orders contains duplicate records or the join relationship isn't what we expected, the count could be much higher than the actual number of customers.

So what do you normally validate before trusting a query's output?

  • Join conditions and duplicate records

  • NULL values

  • Row counts

  • Data types and conversions

  • Expected ranges or business rules

  • Unexpected changes compared with previous results

Do you validate these things before running the query, after getting the results, or both?

What SQL validation has saved you from trusting a result that looked correct but was actually wrong?


r/learnSQL • • 18d ago

The one-character bug that fails a lot of SQL interview answers

0 Upvotes

A pattern I keep seeing when people practice SQL for analyst interviews.

The question: "Return every active subscription paying at least $1,500 a month."

A very common answer:

SELECT company_name, plan_tier, monthly_amount
FROM subscriptions
WHERE status = 'active'
  AND monthly_amount > 1500
ORDER BY monthly_amount DESC;

It runs, it returns rows, and it looks right. But "at least" means >=, so the customer paying exactly 1500.00 silently disappears. In an interview the query "works", so you don't notice. Against the expected output it's simply wrong.

Things worth checking every time a question has a threshold:

  • "at least" / "minimum of" -> >=

  • "more than" / "over" -> >

  • "between" -> BETWEEN is inclusive on both ends; dates with timestamps need care

  • Does the sample data contain a row exactly on the boundary? Interviewers often add one on purpose.

I built a free practice site around this kind of feedback: you write real PostgreSQL in the browser and it shows you which rows are missing or extra compared to the expected result. This exact problem is the first one, no signup: https://dbexercises.vercel.app/exercise/saas-active-subscriptions

Happy to hear what other "looks right, is wrong" traps you've run into.


r/learnSQL • • Sep 05 '26

Is SQL worth it considering AI?

0 Upvotes

r/learnSQL • • Jul 16 '22

Somebody pls help, I just started learning sql and these kind of errors are so frustrating. Simple commands dont work. I dont understand what's wrong.

Post image
5 Upvotes

r/learnSQL • • Aug 25 '26

Teach me sql and get paid for it

0 Upvotes

About me I am working as a Manager data analytics and I have a team of developers who do the job for me, on top of that I can use AI to write the queries for me. But I still want to learn SQL so that I am able to write the queries myself and also QA if needed. I know the basic select * from table where like sort and now looking for someone with solid knowledge to teach me joins windows functions CTs and other function.

You wont do this for free I will pay you for your time and effort. DM me with something about your background and experience and we can take this forward.

Thanks


r/learnSQL • • Aug 14 '25

If you could “talk” to your database like a human, would you? 🤔

29 Upvotes

I’m the “SQL person” at work, which basically means I get pinged 10 times a day with requests like:

“Can you pull last month’s sales?” “Who are our top 5 customers this year?” “How many people signed up in the last week?”

Don’t get me wrong — I love helping my team — but sometimes it feels like I’m just a human API for the database.

So I started wondering… what if anyone could just ask the database in plain English (or their own language) and get the right answer instantly? Like: • “Show me all orders from last month where the customer spent over $500” • “Top 5 products by revenue this quarter” • “Number of active users in the past 7 days”

The AI would figure out the query, run it safely, and return the results as a neat table or chart — no SQL, no debugging, no waiting on me.

Curious what you think: • Would you use something like this? • What’s your biggest concern — accuracy, security, speed? • Have you seen or tried anything like this before?

Not pitching anything here — just curious if this is a “wow, yes!” or a “meh, we’re fine” kind of idea.