4 ms·
BTW I tried it with ChatGPT 3.5 - with a prompt that roughly described the database schema and a question "I need to know the manufacturer for the vehicle with
by wizofaus 3y ago
BTW I tried it with ChatGPT 3.5 - with a prompt that roughly described the database schema and a question "I need to know the manufacturer for the vehicle with VIN X7820-A and to confirm whether it has the feature 'rear camera' installed", it came back with
SELECT TVehicles.Make,
CASE
WHEN TVehFeatures.FName = 'rear camera' THEN 'Installed'
ELSE 'Not Installed'
END AS RearCameraStatus
FROM TVehicles
JOIN TVehFeatures ON TVehicles.TV_ID = TVehFeatures.TV_ID
WHERE TVehicles.VIN = 'X7820-A';
One interesting thing to note - I didn't tell it that "Make" and "Manufacturer" are the same thing.
I even went the next level and asked it to write me code to execute the query and generate appropriate HTML output from the results. It didn't quite manage it to handle any possible SQL query (remembering that the query itself has been dynamically generated), but wasn't far off. My description of how the output should look was simply "sleek and modern", and it came up with CSS that could be reasonably said to fill that brief.