There Are Many Text To SQL Prompts Out There, But Most Are Having Issues To Write Queries To Join Tables, Write Nested Queries. This Prompt, Have Developed And Tested From My End To Address The Problem Of Nested Queries And Those Requiring Joins Of Different Tables On Foreign Keys.
There are many Text to SQL prompts out there, but most are having issues to write queries to join tables, write nested queries. This prompt, have developed and tested from my end to address the problem of nested queries and those requiring joins of different tables on foreign…Read full description ↓
You are an expert in converting English questions to SQL query! The SQL database has one table by name EMP and has the following columns - NAME, ID, TEAM, POSITION The SQL database has another table by name SALARY and has the following columns - ID, SALARY ID is the primary key in SALARY table and foreign key in EMP \n\nFor example,\nExample 1 - How many entries of records are present?, the SQL command will be something like this SELECT COUNT(*) FROM EMP ; \nExample 2 - Tell me all the employees Data Science team?, the SQL command will be something like this SELECT * FROM EMP where TEAM="Data Science"; \nExample 3 - Tell me all the Kunal's salary Data Science team?, the SQL command will be something like this SELECT salary FROM EMP left join SALARY on EMP.ID = SALARY.ID where NAME="Kunal"; also the sql code should not have ``` in beginning or end and sql word in output
{question}
Description
There are many Text to SQL prompts out there, but most are having issues to write queries to join tables, write nested queries. This prompt, have developed and tested from my end to address the problem of nested queries and those requiring joins of different tables on foreign keys.
How to Use
Use with LangChain: hub.pull("worldofanalytics/text_to_sql")
Related Prompts
More prompts in Coding & Development
This Prompt Ads Sequential Function Calling To Models Other Than GPT 0613
This prompt ads sequential function calling to models other than GPT-0613
Create a personalized workout routine
Tailor a workout routine specifically designed for individual fitness goals
GODMODE CHEATCODE
God Writes You a Letter Today. This is will help you find the perfect Bible Scripture that will guide you through a current problem you're facing.
Creating a Personal Finance Tracker with [Technology/Tool]
Learn to create a personal finance tracker using [Technology/Tool]. Get code samples and budgeting tips.
Build an entire application using bubble.io with ChatGPT4
Build an entire app with bubble.io, assisted by chatGPT4, that knows bubble very well and is accurate 95% of the time. This prompt will help you maximize the quality of chatGPT assistance. Having detailed and step-by-step instructions is essential to progress fast with Bubble. This initial prompt will help you get started on a good basis. Follow it because I will make it even better.
Become LawyerGPT
Are you in a legal bind? This prompt can help you gain knowledge about how to handle your legal proceedings. DISCLAIMER: Please meet with a real lawyer to discuss your options.