Home

>

Prompts Database

>

SQL Query Execution
SQL Generation
avatar
Buffy Summers
Share
Leave a comment
623 days ago

Prompt type:

SQL Query - Data Retrieval

Category:

SQL Query Execution

Media type:

Use with AI:

ChatGPT from OpenAI
View Full Output

Example output

To generate an SQL query to discover Elon Musk's tweets from 2023, I'll assume you have a table named tweets with columns username, tweet_content, and tweet_date, where tweet_date is in a format that allows filtering by year (e.g., YYYY-MM-DD). Here's the SQL query:

SELECT tweet_content FROM tweets WHERE username = 'ElonMusk' AND tweet_date >= '2023-01-01' AND tweet_date < '2024-01-01';

This query will select the tweet_content from the tweets table where the username is 'ElonMusk' and the tweet_date is within the year 2023. Adjust the table and column names according to your actual database schema.

Description or instructions

SQL Generation

Prompt

This prompt involves creating SQL code based on specified criteria.