# Generating SQL code with the AI assistant (Qlik Answers)

[Preview](https://help.qlik.com/en-US/cloud-services/Subsystems/Hub/Content/Sense_Hub/Introduction/feature-preview-program-overview.htm)

Use a prompt to generate or refine SQL in supported SQL-editing contexts in Talend Studio.

## About this task

The AI assistant (Qlik Answers) can generate SQL wherever SQL can be edited, including tDBInput, tDBRow, and other supported components.

## Procedure

1. Open a supported SQL-editing context.
2. Open ![Qlik Answers](https://help.qlik.com/talend/en-US/studio-user-guide/Resources/images/qlik_answers.svg)Qlik Answers, and enter a prompt that describes the SQL code you need, or the query you want to refine. For example: Generate the SQL to join these tables together, and filter out films from before 1990.
3. Review the generated SQL and adapt it to your database and Job.

   ![Example of SQL code proposed by Qlik Answers in a Job.](https://help.qlik.com/talend/en-US/studio-user-guide/Resources/images/qlik-answers-sql-code.png)

## Results

The SQL-editing context contains SQL code proposed by the AI assistant.