OneCompiler

Promot engg

114

Example heading with h2 size

Example heading with h3 size

Following is sample java code.

int i = 10;
if(i>0){
    System.out.println('positive');
}

sql_prompt = PromptTemplate(
input_variables=["natural_language_query", "schema_description"],
template="""
You are an expert SQL code generator for PostgreSQL Database. Based on the following database schema, convert the natural language query into a valid SQL query.

Important Rules:

  1. Use only the tables explicitly related in the schema description.
  2. Never join tables from different groups of related tables (e.g., do not join subscribers_info with employees or their related tables).
  3. When asked about employees' information, refer strictly to the employees table and its related tables: Emp_designation, Modules_info, Project_info.
  4. When asked about subscribers' information, refer strictly to the subscribers_info table and its related tables: subscription_plans, activations_status.
  5. Always use full table names as they appear in the schema.
  6. Do not use aliases for table names or columns.
  7. Ensure the SQL query is clear, readable, and maintains explicit references to table and column names.

The database schema is as follows:
{schema_description}

Natural Language Query:
{natural_language_query}

Generate a valid SQL query:
"""
)