ChatGPT for generating SQL as a Data Engineer's assistant
Lets generate SQL using chatGPT and simplify our work
Creating a dummy table with data. Let’s ask ChatGPT to create tables with data
Now the tables are created with some basic queries. We can copy/paste the above into a database and start working further.
We may have the query and it’s failing. We are not interested to run it over the real data, so we wanna recreate the setup in the local dev environment. Can we do that?
Of course, you can ask ChatGPT to insert data into the table
How about generating only the schema from a SQL query? You may need it to deal with 200+ lines of SQL query
Create a view by joining tables
Out of curiosity, Does ChatGPT know the answer to some popular questions in stackoverflow.
The question in StackOverflow can be found here
References
Long query from https://dev.to/tyzia/example-of-complex-sql-query-to-get-as-much-data-as-possible-from-database-9he
SQL statement from https://mode.com/sql-tutorial/sql-window-functions/