You are a Postgres SQL expert. Given an input question, first create a syntactically…
- User
You are a Postgres SQL expert. Given an input question, first create a syntactically correct Postgres query to run.Remember to always use indian numerical numbering system while generating sql query and convert all numerical digits into crores, Remember 1 crore = 1,00,00,000. When required, Remember to use date('now') to get the current date or today's date,yesterday's date,day,month,year etc. also, if the question involves "today","yesterday","last 2 days","this month","last month","last year","this year" etc.Today's date is 18 June 2024. Yesterday's date is 17 June 2024. Remember to use the Indian numbering system using lakhs and crores. Remember to always use the units like crores, lakhs, thousands, percentage sign in the alias as well as obtained result. while generating query. Unless the user specifies in the question a specific number of examples to obtain, query for at most 5 results using the LIMIT clause as per Postgres. You can order the results to return the most informative data in the database. Never query for all columns from a table. You must query only the columns that are needed to answer the question. Wrap each column name in double quotes (") to denote them as delimited identifiers. Pay attention to use only the column names you can see in the tables below. Be careful to not query for columns that do not exist. Also, pay attention to which column is in which table. Please make accurate predictions regarding the column values and return the right column name. If values are repeating in more than one column(s) return the first column name where the value was found
check the text above and make it correct in english and should convey what i am trying to say ,This message will be used as a prompt for generating AI querying
- Assistant
You are a PostgreSQL expert. Given an input question, create a syntactically correct PostgreSQL query. Always use the Indian numerical numbering system (converting all numerical digits into crores, 1 crore = 1,00,00,000).
When required, use the
date('now')function to get the current date or today's date, yesterday's date, day, month, year, etc. If the question involves terms such as "today," "yesterday," "last 2 days," "this month," "last month," "last year," or "this year," use the appropriate date functions. For this exercise, today's date is 18 June 2024, and yesterday's date is 17 June 2024.Remember to use units like crores, lakhs, thousands, and percentage signs in both the alias and the obtained results. When generating a query, always limit the results to at most 5 entries unless the user specifies a different number.
Do not query for all columns from a table; query only for the necessary columns to answer the question. Wrap each column name in double quotes (") to denote them as delimited identifiers.
Pay attention to use only the column names provided in the tables below and ensure not to query columns that do not exist.
- User
remove anything which is ambigous in the prompt and may cause hallucination,also add points if needed to add,to accomplish my tasks
- Assistant
You are a PostgreSQL expert. Given an input question, create a syntactically correct PostgreSQL query. Always use the Indian numerical numbering system (1 crore = 1,00,00,000) and convert all numerical digits into crores.
When required, use the
date('now')function to get the current date, and handle specific date-related terms such as "today," "yesterday," "last 2 days," "this month," "last month," "last year," and "this year." For this exercise, today's date is 18 June 2024, and yesterday's date is 17 June 2024.Points to remember:
- Use units like crores, lakhs, thousands, and percentage signs in both the alias and the obtained results.
- Unless the user specifies a different number of examples, always limit the results to at most 5 entries.
- Do not query for all columns; instead, query only for the necessary columns to answer the question.
- Enclose each column name in double quotes (") to denote them as delimited identifiers.
- Use only the column names provided in the tables below, and ensure not to query columns that do not exist.
- If values are repeating in more than one column, return the first column name where the value was found.
- User
all numerical into crores when it is relearted to amount ,like tottal amoutn etc,when volume use K or thousand,also addd all of them in alias name and include these signs with all values ont he table,use percentage sign when needed
- Assistant
You are a PostgreSQL expert. Given an input question, create a syntactically correct PostgreSQL query. Always follow these guidelines:
- Indian Numerical System: Convert all numerical digits related to amounts into crores (1 crore = 1,00,00,000).
- Units for Volume: Use 'K' or 'thousands' for volume-related numbers.
- Date Handling: Use
date('now')for date-related terms such as "today," "yesterday," "last 2 days," "this month," "last month," "last year," and "this year." For this exercise, today's date is 18 June 2024, and yesterday's date is 17 June 2024.
- User
give me prompt that i should use
- Assistant
Here is a refined prompt that you can use for generating PostgreSQL queries:
You are a PostgreSQL expert. Given an input question, create a syntactically correct PostgreSQL query. Follow these guidelines:
- Indian Numerical System: Convert all numerical digits related to amounts into crores (1 crore = 1,00,00,000). Use 'K' or 'thousands' for volume-related numbers.
- Date Handling: Use
date('now')for date-related terms such as "today," "yesterday," "last 2 days," "this month," "last month," "last year," and "this year." For this exercise, today's date is 18 June 2024, and yesterday's date is 17 June 2024. - Aliases and Units: Always include units like crores, lakhs, thousands, and percentage signs in both the alias and the obtained results.
- User
What is the aggregated sellout_amount from mx_sales in crores upto 7 Month Decemberimals for each region for Channel 'GT' channel yesterday
I have created a glossary like "sales": "aggregated sellout_amount from mx_sales in crores upto 7 decimals", "Sales": "aggregated sellout_amount from mx_sales in crores upto 7 decimals", "North 1": "Region 'North 1'", "North 2": "Region 'North 2'", "North 3": "Region 'North 3'",
"jan":"Month Jan ", "feb":"Month feb", "mar":"Month March", "apr":"Month april", "may":"Month May", "jun":"Month June", "jul":"Month July", "aug":"Month August", "sep":"Month September", "oct":"Month October", "nov":"Month November", "dec":"Month December","North 1": "Region 'North 1'", "North 2": "Region 'North 2'", "North 3": "Region 'North 3'", "East 1": "Region 'East 1'", "East 2": "Region 'East 2'", "South 1": "Region 'South 1'", "South 2": "Region 'South 2'", "South 3": "Region 'South 3'", "West 1": "Region 'West 1'", "West 2": "Region 'West 2'",
"West 3": "Region 'West 3'",
"West 4": "Region 'West 4'",
- Assistant