Hub
Pricing About
WorkflowWorkflow

SQL Query Generator

SQLLLMQuery generatorText-generation
aliasghar_marvi profile image
Draft Latest edits on 
Jan 4, 2024 5:27 PM
Drag & drop
Like
Download workflow
Workflow preview
This workflow is a data app that generates SQL queries based on the question provided by the user. It is a simple chatbot data app that connects with the OpenAI GPT-3.5-turbo-16k model. A user generates the system prompt in the String Input Widget. This prompt contains a set of instructions and a placeholder to add the database schema to query from. This schema is a .sql file containing the DDL commands along with comments that define what each column means. Further comments are added to explain which column joins are possible with other columns. The comments are helpful for LLMs to better understand the database schema. The updated .sql file with comments is included in this workflow group. The system prompt is merged with the uploaded .sql file. This initializes the chat instance with GPT. Using the "Chat Window" component, the user inputs the statement against which the query has to be generated.

External resources

  • HR Schema in Postgres
  • OpenAPI Key
Loading deploymentsLoading ad hoc jobs

Used extensions & nodes

Created with KNIME Analytics Platform version 5.2.0
  • Go to item
    KNIME AI Extension (Labs)Trusted extension

    KNIME AG, Zurich, Switzerland

    Version 5.2.0

    knime
  • Go to item
    KNIME Base nodesTrusted extension

    KNIME AG, Zurich, Switzerland

    Version 5.2.0

    knime
  • Go to item
    KNIME JavaScript ViewsTrusted extension

    KNIME AG, Zurich, Switzerland

    Version 5.2.0

    knime
  • Go to item
    KNIME JavasnippetTrusted extension

    KNIME AG, Zurich, Switzerland

    Version 5.2.0

    knime
  • Go to item
    KNIME Math Expression (JEP)Trusted extension

    KNIME AG, Zurich, Switzerland

    Version 5.2.0

    knime
  • Go to item
    KNIME Quick FormsTrusted extension

    KNIME AG, Zurich, Switzerland

    Version 5.2.0

    knime

Legal

By using or downloading the workflow, you agree to our terms and conditions.

KNIME
Open for Innovation

KNIME AG
Talacker 50
8001 Zurich, Switzerland
  • Software
  • Getting started
  • Documentation
  • Courses + Certification
  • Solutions
  • KNIME Hub
  • KNIME Forum
  • Blog
  • Events
  • Partner
  • Developers
  • KNIME Home
  • Careers
  • Contact us
Download KNIME Analytics Platform Read more about KNIME Business Hub
© 2025 KNIME AG. All rights reserved.
  • Trademarks
  • Imprint
  • Privacy
  • Terms & Conditions
  • Data Processing Agreement
  • Credits