[LinuxSIG] ChatGPT to write code [was: Re: bash_httpd.sh]

Ron / BCLUG admin at bclug.ca
Sat Mar 2 12:36:25 PST 2024


Another instance where ChatGPT gave invaluable help in coding was with 
an SQL problem I was having with joining 3 tables.

I tried every combo of left join & right join, I tried CTEs, subqueries, 
and I just could not get it to work.


Hours were spent trying to get a solution and I was left questioning my 
SQL knowledge.


Interestingly, it took the table structure from this:

> The tables:
> 
> Table: Students
> 
> +---------------+---------+
> | Column Name   | Type    |
> +---------------+---------+
> | student_id    | int     |
> | student_name  | varchar |
> +---------------+---------+
> student_id is the primary key (column with unique values) for this table.
> Each row of this table contains the ID and the name of one student in the school.
 >
 > ...
 >



The solution it spat out used a cross join and worked perfectly.


A thousand online searches all lead to variations on basic "how to join 
3 tables", making them useless.



Again, incredibly impressed.



This was ChatGPT 3.5 from about a year ago.

rb



More information about the LinuxSIG mailing list