prompt stringlengths 1.03k 2.28k | response stringlengths 751 1.79k | program_id stringlengths 9 11 |
|---|---|---|
<|im_start|>system
You are Qwen, created by Alibaba Cloud. You are a helpful assistant.<|im_end|>
<|im_start|>user
[Problem]
Create a Python script that connects to an SQLite database named 'program_77_database.db' and interacts with a table called 'inventory'. The table has columns named 'item_id', 'item_name', 'item_... | Here is a Python script that fulfills your requirements:
```python
import sqlite3
def get_inventory(item_type):
conn = sqlite3.connect('program_77_database.db')
cursor = conn.cursor()
# Constructing the SQL query
query = f"SELECT * FROM inventory WHERE item_type = ?"
# Executing the query
... | program_77 |
<|im_start|>system
You are Qwen, created by Alibaba Cloud. You are a helpful assistant.<|im_end|>
<|im_start|>user
[Problem]
Create a Python script that connects to an SQLite database named 'program_60_database.db' and queries a table called 'books'. The 'books' table contains columns: 'id' (INTEGER), 'title' (TEXT), '... | Here is a Python script that fulfills your requirements:
```python
import sqlite3
def get_books(min_price, max_price, genre):
conn = sqlite3.connect('program_60_database.db')
cursor = conn.cursor()
# Adjusted minimum price
adjusted_min_price = min_price * 1.10
# Adjusted maximum price
adjuste... | program_60 |
<|im_start|>system
You are Qwen, created by Alibaba Cloud. You are a helpful assistant.<|im_end|>
<|im_start|>user
[Problem]
We have a database file named 'program_225_database.db' which contains a table called 'users'. This table has the following columns: 'user_id', 'username', 'email', and 'bio'. The task is to writ... | Here is a Python script that fulfills your requirements:
```python
import sqlite3
def main():
# Connect to the database
conn = sqlite3.connect('program_225_database.db')
cursor = conn.cursor()
# Get user input
user_input = input("Enter search term: ")
filter_type = input("Enter filter type (u... | program_225 |
<|im_start|>system
You are Qwen, created by Alibaba Cloud. You are a helpful assistant.<|im_end|>
<|im_start|>user
[Problem]
We have a database file named 'program_277_database.db' which contains a table called 'tickets'. This table has the following columns: 'id' (an integer primary key), 'event_name' (a text field), ... | Here is a Python script that fulfills your requirements:
```python
import sqlite3
def get_tickets(event, start_date, end_date, location):
conn = sqlite3.connect('program_277_database.db')
cursor = conn.cursor()
if event == 'all':
query = "SELECT * FROM tickets"
else:
query = f"SELECT ... | program_277 |
<|im_start|>system
You are Qwen, created by Alibaba Cloud. You are a helpful assistant.<|im_end|>
<|im_start|>user
[Problem]
The database is named 'program_356_database.db' and contains a table called 'census_data'. This table has the following columns: 'citizen_id', 'full_name', 'age', 'city', 'income', and 'employmen... | Here is a Python script that fulfills your requirements:
```python
import sqlite3
def get_records(min_income, age, employment_status):
conn = sqlite3.connect('program_356_database.db')
cursor = conn.cursor()
# Adjust the minimum income
adjusted_income = min_income + int(employment_status) * int(age)
... | program_356 |
<|im_start|>system
You are Qwen, created by Alibaba Cloud. You are a helpful assistant.<|im_end|>
<|im_start|>user
[Problem]
The database is stored in a file named 'program_149_database.db' and contains a table called 'items'. This table has four columns: 'id' (INTEGER), 'description' (TEXT), 'type' (TEXT), and 'price'... | Here is a Python script that fulfills your requirements:
```python
import sqlite3
def main():
# Connect to the database
conn = sqlite3.connect('program_149_database.db')
cursor = conn.cursor()
# Prompt the user for inputs
item_id = int(input("Enter item id: "))
description = input("Enter desc... | program_149 |
<|im_start|>system
You are Qwen, created by Alibaba Cloud. You are a helpful assistant.<|im_end|>
<|im_start|>user
[Problem]
You have a database file named 'program_407_database.db' which contains a table called 'tickets'. This table has the following columns: 'ticket_id' (INTEGER), 'event_name' (TEXT), 'date' (TEXT), ... | Here is a Python script that takes user inputs, constructs SQL queries based on those inputs, and prints the results:
```python
import sqlite3
def get_tickets(min_price, max_price, event_date, event_name):
# Connect to the database
conn = sqlite3.connect('program_407_database.db')
cursor = conn.cursor()
... | program_407 |
<|im_start|>system
You are Qwen, created by Alibaba Cloud. You are a helpful assistant.<|im_end|>
<|im_start|>user
[Problem]
You have a database file named 'program_195_database.db' with a table called 'posts'. This table contains columns: post_id, title, content, author, and publish_date. Your task is to write a code ... | Here is a Python script that fulfills your requirements:
```python
import sqlite3
def get_posts(author, start_date, end_date, keyword):
conn = sqlite3.connect('program_195_database.db')
cursor = conn.cursor()
# Construct the SQL query
query = """
SELECT post_id, title, content, author, publis... | program_195 |
<|im_start|>system
You are Qwen, created by Alibaba Cloud. You are a helpful assistant.<|im_end|>
<|im_start|>user
[Problem]
Create a Python script that connects to an existing SQLite database named 'program_185_database.db' and queries a table called 'events'. The 'events' table contains columns: event_id, title, date... | Here is a Python script that fulfills your requirements:
```python
import sqlite3
def get_events(location, date, ticket_amount):
conn = sqlite3.connect('program_185_database.db')
cursor = conn.cursor()
# Construct the SQL query
query = f"SELECT * FROM events WHERE location = ? AND date = ? AND availa... | program_185 |
<|im_start|>system
You are Qwen, created by Alibaba Cloud. You are a helpful assistant.<|im_end|>
<|im_start|>user
[Problem]
Create a Python script that connects to an existing SQLite database named 'program_353_database.db' which contains a table called 'reservations'. This table has the following columns: reservation... | Here is a Python script that fulfills your requirements:
```python
import sqlite3
def get_reservations(room_type, check_in_date, check_out_date, max_price):
conn = sqlite3.connect('program_353_database.db')
cursor = conn.cursor()
query = f"""
SELECT *
FROM reservations
WHERE roo... | program_353 |
<|im_start|>system
You are Qwen, created by Alibaba Cloud. You are a helpful assistant.<|im_end|>
<|im_start|>user
[Problem]
You have a database file named 'program_78_database.db' with a table called 'orders'. The table has the following columns: order_id (INTEGER), customer (TEXT), order_date (TEXT), status (TEXT), a... | Here is a Python script that fulfills your requirements:
```python
import sqlite3
def get_orders(start_date, end_date, bulk_discount, order_status):
conn = sqlite3.connect('program_78_database.db')
cursor = conn.cursor()
# Construct the SQL query
query = f"""
SELECT order_id, customer, order_... | program_78 |
<|im_start|>system
You are Qwen, created by Alibaba Cloud. You are a helpful assistant.<|im_end|>
<|im_start|>user
[Problem]
Given a database named 'program_213_database.db' with a table called 'inventory', which contains columns 'item_id', 'item_name', 'category', and 'quantity', write a code snippet that connects to ... | Here is a Python script that connects to the database, executes the SQL query based on the user's input, and prints the results:
```python
import sqlite3
def get_inventory(category):
conn = sqlite3.connect('program_213_database.db')
cursor = conn.cursor()
# Construct the SQL query based on the user's inp... | program_213 |
<|im_start|>system
You are Qwen, created by Alibaba Cloud. You are a helpful assistant.<|im_end|>
<|im_start|>user
[Problem]
Create a Python script that connects to an SQLite database named 'program_24_database.db' and interacts with a table called 'customers'. The 'customers' table contains the following columns: cust... | Here is a Python script that fulfills your requirements:
```python
import sqlite3
def get_customers(min_age, max_age, city):
conn = sqlite3.connect('program_24_database.db')
cursor = conn.cursor()
# Construct the SQL query
query = f"""
SELECT customer_id, first_name, last_name, age, city
... | program_24 |
<|im_start|>system
You are Qwen, created by Alibaba Cloud. You are a helpful assistant.<|im_end|>
<|im_start|>user
[Problem]
The database is named 'program_248_database.db' and contains a table called 'orders'. This table has the following columns: 'order_id' (an integer and the primary key), 'item' (a text field), 'ca... | Here is a Python script that takes user inputs, constructs SQL queries based on those inputs, and prints the results:
```python
import sqlite3
def get_orders(min_price, max_price, category):
conn = sqlite3.connect('program_248_database.db')
cursor = conn.cursor()
query = f"""
SELECT order_id, ite... | program_248 |
<|im_start|>system
You are Qwen, created by Alibaba Cloud. You are a helpful assistant.<|im_end|>
<|im_start|>user
[Problem]
The database is stored in a file named 'program_295_database.db' and contains a table called 'accounts'. This table has three columns: 'account_id' which is an integer, 'account_holder' which is ... | Here is a Python script that connects to the database, retrieves the required data, and prints it:
```python
import sqlite3
def get_account_details(account_id, min_balance):
# Connect to the database
conn = sqlite3.connect('program_295_database.db')
cursor = conn.cursor()
# Construct the SQL query
... | program_295 |
<|im_start|>system
You are Qwen, created by Alibaba Cloud. You are a helpful assistant.<|im_end|>
<|im_start|>user
[Problem]
We have a database file named 'program_235_database.db' which contains a table called 'products'. This table has four columns: 'id' (INTEGER), 'name' (TEXT), 'category' (TEXT), and 'price' (REAL)... | Here is a Python script that fulfills your requirements:
```python
import sqlite3
def get_products(category, max_price, id_value, search_term, sort_column, sort_direction):
conn = sqlite3.connect('program_235_database.db')
cursor = conn.cursor()
# Construct the SQL query
query = f"SELECT * FROM produ... | program_235 |
<|im_start|>system
You are Qwen, created by Alibaba Cloud. You are a helpful assistant.<|im_end|>
<|im_start|>user
[Problem]
Create a Python script that connects to an SQLite database named 'program_217_database.db' and queries a table called 'billing'. The table has the following columns: id (INTEGER), customer_name (... | Here is a Python script that fulfills your requirements:
```python
import sqlite3
def get_records(start_date, end_date, min_amount, payment_status):
conn = sqlite3.connect('program_217_database.db')
cursor = conn.cursor()
# Constructing SQL query
query = f"""
SELECT *
FROM billing
... | program_217 |
<|im_start|>system
You are Qwen, created by Alibaba Cloud. You are a helpful assistant.<|im_end|>
<|im_start|>user
[Problem]
The database is named 'program_174_database.db' and contains a table called 'studies'. This table has four columns: 'study_id', 'researcher', 'research_subject', and 'findings'. The task is to re... | Here is a Python script that takes user's inputs via `input()` and builds SQL queries based on the inputs. It then executes these queries and prints the results.
```python
import sqlite3
def get_studies_by_researcher(researcher):
# Connect to the database
conn = sqlite3.connect('program_174_database.db')
... | program_174 |
<|im_start|>system
You are Qwen, created by Alibaba Cloud. You are a helpful assistant.<|im_end|>
<|im_start|>user
[Problem]
We have a database file named 'program_315_database.db' which contains a table called 'campaigns'. This table has the following columns: campaign_id, name, start_date, end_date, audience_size, an... | Here is a Python script that fulfills your requirements:
```python
import sqlite3
def get_campaigns(start_date, end_date, min_audience_size, conversion_ratio):
conn = sqlite3.connect('program_315_database.db')
cursor = conn.cursor()
# Constructing the SQL query
query = """
SELECT campaign_id,... | program_315 |
<|im_start|>system
You are Qwen, created by Alibaba Cloud. You are a helpful assistant.<|im_end|>
<|im_start|>user
[Problem]
We have a SQLite database file named 'program_75_database.db' which contains a table called 'items'. This table has the following columns: 'id' (INTEGER), 'name' (TEXT), 'category' (TEXT), 'weigh... | Here is a Python script that fulfills your requirements:
```python
import sqlite3
def get_items(min_weight, max_weight, min_rating, category):
conn = sqlite3.connect('program_75_database.db')
cursor = conn.cursor()
# Calculate the range for weight
weight_range = (max_weight - min_weight) * 0.95
m... | program_75 |
<|im_start|>system
You are Qwen, created by Alibaba Cloud. You are a helpful assistant.<|im_end|>
<|im_start|>user
[Problem]
We have a database file named 'program_401_database.db' which contains a table called 'books'. This table has the following columns: 'book_id' (an integer primary key), 'title' (text), 'author' (... | Here is a Python script that fulfills your requirements:
```python
import sqlite3
def main():
# Connect to the database
conn = sqlite3.connect('program_401_database.db')
cursor = conn.cursor()
# Prompt the user for input
title = input("Enter the book title: ")
author = input("Enter the author... | program_401 |
<|im_start|>system
You are Qwen, created by Alibaba Cloud. You are a helpful assistant.<|im_end|>
<|im_start|>user
[Problem]
Create a Python script that connects to an SQLite database named 'program_348_database.db' and queries a table called 'orders'. The 'orders' table contains the following columns: order_id (INTEGE... | Here is a Python script that fulfills your requirements:
```python
import sqlite3
def get_orders(customer_name, min_price, max_price):
conn = sqlite3.connect('program_348_database.db')
cursor = conn.cursor()
query = f"SELECT * FROM orders WHERE customer = ? AND price BETWEEN ? AND ?"
cursor.execute(q... | program_348 |
<|im_start|>system
You are Qwen, created by Alibaba Cloud. You are a helpful assistant.<|im_end|>
<|im_start|>user
[Problem]
Create a Python script that connects to an SQLite database named 'program_231_database.db' and queries a table called 'transactions'. The table has the following columns: transaction_id, account_... | Here is a Python script that fulfills your requirements:
```python
import sqlite3
def get_transactions(account_number, min_amount):
conn = sqlite3.connect('program_231_database.db')
cursor = conn.cursor()
# Constructing SQL query
query = f"""
SELECT transaction_id, account_number, amount, tra... | program_231 |
<|im_start|>system
You are Qwen, created by Alibaba Cloud. You are a helpful assistant.<|im_end|>
<|im_start|>user
[Problem]
Create a Python script that connects to an SQLite database named 'program_245_database.db' and interacts with a table called 'inventory'. The table has the following columns: item_id (INTEGER), i... | Here is a Python script that fulfills the requirements:
```python
import sqlite3
def get_inventory():
conn = sqlite3.connect('program_245_database.db')
cursor = conn.cursor()
# Get user inputs
item_name = input("Enter item name: ")
supplier = input("Enter supplier name: ")
min_quantity = int(... | program_245 |
<|im_start|>system
You are Qwen, created by Alibaba Cloud. You are a helpful assistant.<|im_end|>
<|im_start|>user
[Problem]
Create a Python script that connects to an SQLite database named 'program_445_database.db' and queries a table called 'employees'. The table has the following columns: emp_id (INTEGER), first_nam... | Here is a Python script that connects to an SQLite database, queries a table, and prints the required information:
```python
import sqlite3
def main():
# Connect to the SQLite database
conn = sqlite3.connect('program_445_database.db')
cursor = conn.cursor()
# Prompt the user for input
try:
... | program_445 |
<|im_start|>system
You are Qwen, created by Alibaba Cloud. You are a helpful assistant.<|im_end|>
<|im_start|>user
[Problem]
Create a Python script that connects to a SQLite database named 'program_418_database.db' and interacts with a table called 'patients'. The 'patients' table contains the following columns: id, na... | Here is a Python script that fulfills your requirements:
```python
import sqlite3
def get_records():
conn = sqlite3.connect('program_418_database.db')
cursor = conn.cursor()
# Prompt the user for input
name = input("Enter a patient's name: ")
# Construct the SQL query
query = f"SELECT * FROM... | program_418 |
<|im_start|>system
You are Qwen, created by Alibaba Cloud. You are a helpful assistant.<|im_end|>
<|im_start|>user
[Problem]
Create a Python script that connects to an SQLite database named 'program_393_database.db' and interacts with a table called 'students'. The table has the following columns: 'student_id' (INTEGER... | Here is a Python script that connects to an SQLite database, retrieves a student's record based on a given student ID, and prints it:
```python
import sqlite3
def get_student_info(student_id):
try:
# Connect to the SQLite database
conn = sqlite3.connect('program_393_database.db')
cursor = ... | program_393 |
<|im_start|>system
You are Qwen, created by Alibaba Cloud. You are a helpful assistant.<|im_end|>
<|im_start|>user
[Problem]
Create a Python script that connects to an existing SQLite database named 'program_382_database.db' and queries a table called 'users'. The table contains columns: user_id, username, email, bio, ... | Here is a Python script that fulfills your requirements:
```python
import sqlite3
def main():
# Connect to the SQLite database
conn = sqlite3.connect('program_382_database.db')
cursor = conn.cursor()
# Prompt the user for inputs
min_age = int(input("Enter minimum age: "))
country = input("Ent... | program_382 |
<|im_start|>system
You are Qwen, created by Alibaba Cloud. You are a helpful assistant.<|im_end|>
<|im_start|>user
[Problem]
The database is stored in a file named 'program_1_database.db' and contains a table called 'orders'. This table has four columns: 'order_id' (INTEGER), 'customer_name' (TEXT), 'product' (TEXT), a... | Here is a Python script that connects to the database, executes a SQL query based on the user's input, and prints the results:
```python
import sqlite3
def get_orders(customer_name):
# Connect to the database
conn = sqlite3.connect('program_1_database.db')
cursor = conn.cursor()
# Build the SQL query... | program_1 |
<|im_start|>system
You are Qwen, created by Alibaba Cloud. You are a helpful assistant.<|im_end|>
<|im_start|>user
[Problem]
Create a Python script that connects to a SQLite database named 'program_372_database.db' and queries a table called 'patients'. The table contains columns: patient_id, name, age, diagnosis, trea... | Here is a Python script that fulfills your requirements:
```python
import sqlite3
def get_results():
conn = sqlite3.connect('program_372_database.db')
cursor = conn.cursor()
# Get user inputs
doctor_name = input("Enter the doctor's name: ")
min_age = int(input("Enter the minimum age: "))
max_... | program_372 |
<|im_start|>system
You are Qwen, created by Alibaba Cloud. You are a helpful assistant.<|im_end|>
<|im_start|>user
[Problem]
Create a Python script that connects to an SQLite database named 'program_301_database.db' and queries a table called 'marketing_campaigns'. The table contains columns: id, campaign_name, impress... | Here is a Python script that fulfills your requirements:
```python
import sqlite3
def main():
# Connect to the SQLite database
conn = sqlite3.connect('program_301_database.db')
cursor = conn.cursor()
# Prompt the user for input
campaign_name = input("Enter the campaign name: ")
# Construct t... | program_301 |
<|im_start|>system
You are Qwen, created by Alibaba Cloud. You are a helpful assistant.<|im_end|>
<|im_start|>user
[Problem]
Given a SQLite database file named 'program_170_database.db', there is a table called 'sales' with the following columns: order_id (INTEGER), customer_name (TEXT), item (TEXT), and amount (REAL).... | Here is a Python script that fulfills your requirements:
```python
import sqlite3
def get_sales_by_customer():
# Connect to the database
conn = sqlite3.connect('program_170_database.db')
cursor = conn.cursor()
# Prompt the user for input
customer_name = input("Enter a customer name: ")
# Con... | program_170 |
<|im_start|>system
You are Qwen, created by Alibaba Cloud. You are a helpful assistant.<|im_end|>
<|im_start|>user
[Problem]
You have a database file named 'program_370_database.db' which contains a table called 'customer_info'. This table has the following columns: customer_id, first_name, last_name, email, balance, a... | Here is a Python script that fulfills your requirements:
```python
import sqlite3
def get_customers():
conn = sqlite3.connect('program_370_database.db')
cursor = conn.cursor()
# Get user inputs
min_balance = float(input("Enter minimum account balance: "))
max_balance = float(input("Enter maximum ... | program_370 |
<|im_start|>system
You are Qwen, created by Alibaba Cloud. You are a helpful assistant.<|im_end|>
<|im_start|>user
[Problem]
You have a database named 'program_345_database.db' with a table called 'papers'. This table contains columns: paper_id, title, author, year_published, category, and abstract. Your task is to wri... | Here is a Python script that fulfills your requirements:
```python
import sqlite3
def get_papers(year, category):
conn = sqlite3.connect('program_345_database.db')
cursor = conn.cursor()
query = f"SELECT * FROM papers WHERE year_published = ? AND category = ?"
cursor.execute(query, (year, category))
... | program_345 |
<|im_start|>system
You are Qwen, created by Alibaba Cloud. You are a helpful assistant.<|im_end|>
<|im_start|>user
[Problem]
Create a Python script that connects to an SQLite database named 'program_31_database.db' and interacts with a table called 'inventory'. The table has columns named 'item_id', 'item_name', 'item_... | Here is a simple Python script that connects to an SQLite database, searches for an item in the 'inventory' table, and prints the results:
```python
import sqlite3
def main():
# Connect to the SQLite database
conn = sqlite3.connect('program_31_database.db')
cursor = conn.cursor()
# Prompt the user fo... | program_31 |
<|im_start|>system
You are Qwen, created by Alibaba Cloud. You are a helpful assistant.<|im_end|>
<|im_start|>user
[Problem]
Create a Python script that connects to an existing SQLite database named 'program_384_database.db' which contains a table called 'devices'. This table has columns named 'device_id', 'name', 'sta... | Here is a Python script that fulfills your requirements:
```python
import sqlite3
def get_device_data():
conn = sqlite3.connect('program_384_database.db')
cursor = conn.cursor()
# Get user inputs
min_temp = float(input("Enter the minimum temperature (in Celsius): "))
max_temp = float(input("Enter... | program_384 |
<|im_start|>system
You are Qwen, created by Alibaba Cloud. You are a helpful assistant.<|im_end|>
<|im_start|>user
[Problem]
Create a script that connects to an SQLite database named 'program_34_database.db' and queries a table called 'products'. The 'products' table contains columns: 'id' (INTEGER), 'name' (TEXT), 'ca... | Here is a Python script that connects to an SQLite database, queries a table, and prints the results:
```python
import sqlite3
def main():
# Connect to the SQLite database
conn = sqlite3.connect('program_34_database.db')
cursor = conn.cursor()
# Prompt the user for input
search_term = input("Ente... | program_34 |
<|im_start|>system
You are Qwen, created by Alibaba Cloud. You are a helpful assistant.<|im_end|>
<|im_start|>user
[Problem]
The database is set up for a social media application and contains a table named 'users' with the following columns: user_id (INTEGER), username (TEXT), bio (TEXT), age (INTEGER), and friends_cou... | Here is a Python script that fulfills the requirements:
```python
import sqlite3
def get_users():
# Connect to the database
conn = sqlite3.connect('program_215_database.db')
cursor = conn.cursor()
# Get inputs
min_friends = int(input("Enter the minimum number of friends: "))
max_friends = int... | program_215 |
<|im_start|>system
You are Qwen, created by Alibaba Cloud. You are a helpful assistant.<|im_end|>
<|im_start|>user
[Problem]
Create a script that connects to a SQLite database named 'program_208_database.db' and queries a table called 'listings'. The table has columns: 'id' (INTEGER), 'title' (TEXT), 'location' (TEXT),... | Here is a simple Python script that connects to a SQLite database, queries a table, and prints the results:
```python
import sqlite3
# Connect to the SQLite database
conn = sqlite3.connect('program_208_database.db')
cursor = conn.cursor()
# Prompt the user for input
title = input("Enter the title of the listing: ")
... | program_208 |
<|im_start|>system
You are Qwen, created by Alibaba Cloud. You are a helpful assistant.<|im_end|>
<|im_start|>user
[Problem]
You have a database file named 'program_172_database.db' which contains a table called 'population'. This table has four columns: 'id' (an integer), 'city' (a text field), 'state' (a text field),... | Here is a Python script that fulfills your requirements:
```python
import sqlite3
def get_population_data():
# Connect to the database
conn = sqlite3.connect('program_172_database.db')
cursor = conn.cursor()
# Get user inputs
population_threshold = int(input("Enter the population threshold: "))
... | program_172 |
<|im_start|>system
You are Qwen, created by Alibaba Cloud. You are a helpful assistant.<|im_end|>
<|im_start|>user
[Problem]
Create a Python script that connects to an SQLite database named 'program_473_database.db' and interacts with a table called 'users'. The 'users' table contains columns: 'user_id', 'username', 'e... | Here is a Python script that fulfills your requirements:
```python
import sqlite3
def main():
# Connect to the SQLite database
conn = sqlite3.connect('program_473_database.db')
cursor = conn.cursor()
# Prompt the user for inputs
username = input("Enter a username to search for: ")
email_domai... | program_473 |
<|im_start|>system
You are Qwen, created by Alibaba Cloud. You are a helpful assistant.<|im_end|>
<|im_start|>user
[Problem]
The database is named 'program_261_database.db' and contains a table called 'tickets' with the following columns: event_id (INTEGER), event_name (TEXT), location (TEXT), and ticket_price (REAL). ... | Here is a Python script that takes user inputs and constructs SQL queries based on those inputs. It then executes these queries and prints the results.
```python
import sqlite3
def get_events(location, min_price, max_price, discount):
# Connect to the database
conn = sqlite3.connect('program_261_database.db')... | program_261 |
<|im_start|>system
You are Qwen, created by Alibaba Cloud. You are a helpful assistant.<|im_end|>
<|im_start|>user
[Problem]
The database is named 'program_341_database.db' and contains a table called 'player_stats'. This table has the following columns: 'id' (INTEGER), 'name' (TEXT), 'team' (TEXT), 'avg_score' (REAL),... | Here is a Python script that takes user inputs, constructs SQL queries based on those inputs, and prints the results:
```python
import sqlite3
def get_player_stats(min_avg_score, max_avg_score, position, team):
conn = sqlite3.connect('program_341_database.db')
cursor = conn.cursor()
# Constructing the SQ... | program_341 |
<|im_start|>system
You are Qwen, created by Alibaba Cloud. You are a helpful assistant.<|im_end|>
<|im_start|>user
[Problem]
Create a Python script that connects to an SQLite database named 'program_8_database.db' and interacts with a table called 'inventory'. The table has the following columns: item_id (INTEGER), ite... | Here is a Python script that fulfills your requirements:
```python
import sqlite3
def get_inventory(item_name):
conn = sqlite3.connect('program_8_database.db')
cursor = conn.cursor()
# SQL query to select all rows from the inventory table where item_name matches the input
query = "SELECT * FROM inven... | program_8 |
<|im_start|>system
You are Qwen, created by Alibaba Cloud. You are a helpful assistant.<|im_end|>
<|im_start|>user
[Problem]
You have a database named 'program_247_database.db' with a table called 'papers'. This table contains columns: id, title, author, year, field, and citations. Your task is to write a script that c... | Here is a Python script that fulfills your requirements:
```python
import sqlite3
def get_records(start_year, end_year, min_citations, field):
conn = sqlite3.connect('program_247_database.db')
cursor = conn.cursor()
query = f"""
SELECT id, title, author, year, field, citations
FROM papers... | program_247 |
<|im_start|>system
You are Qwen, created by Alibaba Cloud. You are a helpful assistant.<|im_end|>
<|im_start|>user
[Problem]
We have a database file named 'program_453_database.db' which contains a table called 'sensor_data'. This table has the following columns: 'device_id' (TEXT), 'timestamp' (TEXT), 'temperature' (R... | Here is a Python script that takes user inputs, constructs SQL queries based on those inputs, and prints the results:
```python
import sqlite3
def get_sensor_data(device_id, start_timestamp, end_timestamp, sort_column, sort_direction):
# Connect to the database
conn = sqlite3.connect('program_453_database.db'... | program_453 |
<|im_start|>system
You are Qwen, created by Alibaba Cloud. You are a helpful assistant.<|im_end|>
<|im_start|>user
[Problem]
We have a SQLite database file named 'program_350_database.db' which contains a table called 'customers'. This table has four columns: 'customer_id' (an integer and the primary key), 'name' (a te... | Here is a Python script that fulfills your requirements:
```python
import sqlite3
def get_customer_records(customer_name, min_balance):
conn = sqlite3.connect('program_350_database.db')
cursor = conn.cursor()
# Construct the SQL query
query = f"SELECT * FROM customers WHERE name = ? AND balance > ?"
... | program_350 |
<|im_start|>system
You are Qwen, created by Alibaba Cloud. You are a helpful assistant.<|im_end|>
<|im_start|>user
[Problem]
Create a Python script that connects to an SQLite database named 'program_89_database.db' and interacts with a table called 'inventory'. The table has the following columns: item_id (INTEGER), it... | Here is a Python script that fulfills your requirements:
```python
import sqlite3
def get_data():
conn = sqlite3.connect('program_89_database.db')
cursor = conn.cursor()
while True:
try:
# Prompt user for input
user_input = input("Enter 'item_name' or 'item_id' or 'categor... | program_89 |
<|im_start|>system
You are Qwen, created by Alibaba Cloud. You are a helpful assistant.<|im_end|>
<|im_start|>user
[Problem]
You have a database file named 'program_430_database.db' which contains a table called 'transactions'. This table has the following columns: trans_id (INTEGER), payer (TEXT), payee (TEXT), amount... | Here is a Python script that fulfills your requirements:
```python
import sqlite3
def get_transactions(payer_name, min_amount):
conn = sqlite3.connect('program_430_database.db')
cursor = conn.cursor()
# Construct the SQL query
query = f"SELECT * FROM transactions WHERE payer = ? AND amount >= ?"
... | program_430 |
<|im_start|>system
You are Qwen, created by Alibaba Cloud. You are a helpful assistant.<|im_end|>
<|im_start|>user
[Problem]
Create a Python script that connects to an existing SQLite database named 'program_437_database.db'. This database contains a table called 'accounts' with the following columns: 'account_number' ... | Here is a Python script that fulfills your requirements:
```python
import sqlite3
def get_account_details(account_number):
try:
# Connect to the database
conn = sqlite3.connect('program_437_database.db')
cursor = conn.cursor()
# Execute the SQL query
cursor.execute("SELECT... | program_437 |
<|im_start|>system
You are Qwen, created by Alibaba Cloud. You are a helpful assistant.<|im_end|>
<|im_start|>user
[Problem]
We have a SQLite database named 'program_463_database.db' which contains a table called 'inventory'. This table has the following columns: 'item_id' (an integer primary key), 'item_name' (a text ... | Here is a Python script that fulfills your requirements:
```python
import sqlite3
def search_inventory():
conn = sqlite3.connect('program_463_database.db')
cursor = conn.cursor()
# Get user input
user_input = input("Enter the name of the item you want to search for: ")
# Construct the SQL query
... | program_463 |
<|im_start|>system
You are Qwen, created by Alibaba Cloud. You are a helpful assistant.<|im_end|>
<|im_start|>user
[Problem]
Create a Python script that connects to an SQLite database named 'program_150_database.db' and queries a table called 'orders'. The 'orders' table contains the following columns: order_id, produc... | Here is a Python script that connects to an SQLite database, queries a table, and prints the results:
```python
import sqlite3
def main():
# Connect to the SQLite database
conn = sqlite3.connect('program_150_database.db')
cursor = conn.cursor()
# Prompt the user for input
customer_name = input("E... | program_150 |
<|im_start|>system
You are Qwen, created by Alibaba Cloud. You are a helpful assistant.<|im_end|>
<|im_start|>user
[Problem]
Create a Python script that connects to an existing SQLite database named 'program_275_database.db' and interacts with a table called 'students'. The table contains columns: student_id, name, age... | Here is a Python script that fulfills your requirements:
```python
import sqlite3
def get_student_info():
conn = sqlite3.connect('program_275_database.db')
cursor = conn.cursor()
# Get user input
student_name = input("Enter the name of the student: ")
view_gpa = input("Do you want to view GPA det... | program_275 |
<|im_start|>system
You are Qwen, created by Alibaba Cloud. You are a helpful assistant.<|im_end|>
<|im_start|>user
[Problem]
Create a Python script that connects to an SQLite database named 'program_82_database.db' and interacts with a table called 'users'. This table contains columns 'user_id', 'username', and 'email'... | Here is a Python script that fulfills the requirements:
```python
import sqlite3
def get_email(username):
conn = sqlite3.connect('program_82_database.db')
cursor = conn.cursor()
# Constructing the SQL query
query = f"SELECT email FROM users WHERE username = ?"
# Executing the query
c... | program_82 |
<|im_start|>system
You are Qwen, created by Alibaba Cloud. You are a helpful assistant.<|im_end|>
<|im_start|>user
[Problem]
Create a Python script that connects to an SQLite database named 'program_485_database.db' and queries a table called 'census'. The table has columns named 'id', 'name', 'age', 'occupation', and ... | Here is a Python script that fulfills your requirements:
```python
import sqlite3
def main():
# Connect to the SQLite database
conn = sqlite3.connect('program_485_database.db')
cursor = conn.cursor()
# Prompt the user for inputs
occupation = input("Enter occupation: ")
region = input("Enter r... | program_485 |
<|im_start|>system
You are Qwen, created by Alibaba Cloud. You are a helpful assistant.<|im_end|>
<|im_start|>user
[Problem]
Create a Python script that connects to an SQLite database named 'program_171_database.db' and interacts with a table called 'employees'. The table has the following columns: emp_id, first_name, ... | Here is a Python script that fulfills your requirements:
```python
import sqlite3
def get_employee_data():
try:
# Connect to the SQLite database
conn = sqlite3.connect('program_171_database.db')
cursor = conn.cursor()
# Prompt the user for inputs
department = input("Enter ... | program_171 |
<|im_start|>system
You are Qwen, created by Alibaba Cloud. You are a helpful assistant.<|im_end|>
<|im_start|>user
[Problem]
Create a Python script that connects to a SQLite database named 'program_181_database.db' and queries a table called 'players'. The 'players' table has the following columns: 'id' (INTEGER PRIMAR... | Here is a Python script that fulfills your requirements:
```python
import sqlite3
def get_player_data(team, position, min_avg, sort_column, sort_order):
conn = sqlite3.connect('program_181_database.db')
cursor = conn.cursor()
# Constructing the SQL query
query = f"SELECT * FROM players WHERE team = ?... | program_181 |
<|im_start|>system
You are Qwen, created by Alibaba Cloud. You are a helpful assistant.<|im_end|>
<|im_start|>user
[Problem]
Create a Python script that connects to an SQLite database named 'program_283_database.db' and queries a table called 'employees'. The table has the following columns: emp_id (INTEGER PRIMARY KEY... | Here is a Python script that fulfills your requirements:
```python
import sqlite3
def get_employee_details():
conn = sqlite3.connect('program_283_database.db')
cursor = conn.cursor()
# Prompt user for department name and minimum salary
department = input("Enter the department name: ")
min_salary ... | program_283 |
<|im_start|>system
You are Qwen, created by Alibaba Cloud. You are a helpful assistant.<|im_end|>
<|im_start|>user
[Problem]
Create a Python script that connects to an existing SQLite database named 'program_191_database.db' which contains a table called 'orders'. The 'orders' table has the following columns: order_id ... | Here is a Python script that fulfills your requirements:
```python
import sqlite3
def get_orders(customer_name, min_quantity, dish_type, price_limit):
conn = sqlite3.connect('program_191_database.db')
cursor = conn.cursor()
# Construct the SQL query
query = f"""
SELECT *
FROM orders ... | program_191 |
<|im_start|>system
You are Qwen, created by Alibaba Cloud. You are a helpful assistant.<|im_end|>
<|im_start|>user
[Problem]
Create a Python script that connects to an SQLite database named 'program_202_database.db' and queries a table called 'customer_bills'. The table contains columns named 'customer_id', 'name', 'ph... | Here is a Python script that fulfills your requirements:
```python
import sqlite3
def main():
# Connect to the SQLite database
conn = sqlite3.connect('program_202_database.db')
cursor = conn.cursor()
# Prompt the user for inputs
phone_number = input("Enter phone number: ")
min_amount_due = in... | program_202 |
<|im_start|>system
You are Qwen, created by Alibaba Cloud. You are a helpful assistant.<|im_end|>
<|im_start|>user
[Problem]
Create a Python script that connects to an SQLite database named 'program_56_database.db' and queries a table called 'items'. The table has the following columns: 'item_id', 'item_name', 'categor... | Here is a Python script that fulfills your requirements:
```python
import sqlite3
def get_items_by_name():
# Connect to the SQLite database
conn = sqlite3.connect('program_56_database.db')
cursor = conn.cursor()
# Prompt the user for input
user_input = input("Enter item name: ")
# Sanitize t... | program_56 |
<|im_start|>system
You are Qwen, created by Alibaba Cloud. You are a helpful assistant.<|im_end|>
<|im_start|>user
[Problem]
Create a Python script that connects to a SQLite database named 'program_298_database.db' and queries a table called 'books'. The 'books' table contains columns: 'id', 'title', 'author', 'year', ... | Here is a Python script that fulfills your requirements:
```python
import sqlite3
def get_books(start_year, end_year, genre, author):
conn = sqlite3.connect('program_298_database.db')
cursor = conn.cursor()
query = f"""
SELECT id, title, author, year, genre
FROM books
WHERE year B... | program_298 |
<|im_start|>system
You are Qwen, created by Alibaba Cloud. You are a helpful assistant.<|im_end|>
<|im_start|>user
[Problem]
We have a database file named 'program_320_database.db' which contains a table called 'customers'. This table has the following columns: 'customer_id' (INTEGER), 'name' (TEXT), 'email' (TEXT), an... | Here is a Python script that fulfills your requirements:
```python
import sqlite3
def main():
# Connect to the database
conn = sqlite3.connect('program_320_database.db')
cursor = conn.cursor()
# Get user inputs
email = input("Enter email: ")
min_balance = float(input("Enter minimum balance: "... | program_320 |
<|im_start|>system
You are Qwen, created by Alibaba Cloud. You are a helpful assistant.<|im_end|>
<|im_start|>user
[Problem]
The database is named 'program_111_database.db' and contains a table called 'inventory'. This table has the following columns: 'item_id' (INTEGER), 'item_name' (TEXT), 'item_type' (TEXT), 'quanti... | Here is a Python script that fulfills the requirements:
```python
import sqlite3
def get_items():
# Connect to the database
conn = sqlite3.connect('program_111_database.db')
cursor = conn.cursor()
# Get user inputs
base_cost = float(input("Enter the base cost: "))
cost_multiplier = float(inpu... | program_111 |
<|im_start|>system
You are Qwen, created by Alibaba Cloud. You are a helpful assistant.<|im_end|>
<|im_start|>user
[Problem]
Create a Python script that connects to a SQLite database named 'program_308_database.db' and queries a table called 'products'. The table has the following columns: 'product_id' (INTEGER PRIMARY... | Here is a Python script that fulfills your requirements:
```python
import sqlite3
def get_products(department, max_cost):
conn = sqlite3.connect('program_308_database.db')
cursor = conn.cursor()
query = f"SELECT product_id, product_name, department, cost FROM products WHERE department=? AND cost<=?"
... | program_308 |
<|im_start|>system
You are Qwen, created by Alibaba Cloud. You are a helpful assistant.<|im_end|>
<|im_start|>user
[Problem]
Create a Python script that connects to an existing SQLite database named 'program_198_database.db' and interacts with a table called 'feedback'. The table has the following columns: 'id' (an int... | Here is a Python script that fulfills your requirements:
```python
import sqlite3
def get_feedback(min_rating, max_rating, customer_name):
conn = sqlite3.connect('program_198_database.db')
cursor = conn.cursor()
# Construct the SQL query
query = f"""
SELECT id, customer_name, rating, feedback... | program_198 |
<|im_start|>system
You are Qwen, created by Alibaba Cloud. You are a helpful assistant.<|im_end|>
<|im_start|>user
[Problem]
You have a database file named 'program_391_database.db' which contains a table called 'census_data'. This table has the following columns: 'citizen_id' (INTEGER), 'name' (TEXT), 'age' (INTEGER),... | Here is a Python script that fulfills your requirements:
```python
import sqlite3
def get_records(city, min_age, min_income):
conn = sqlite3.connect('program_391_database.db')
cursor = conn.cursor()
# Construct the SQL query
query = f"""
SELECT *
FROM census_data
WHERE city ... | program_391 |
<|im_start|>system
You are Qwen, created by Alibaba Cloud. You are a helpful assistant.<|im_end|>
<|im_start|>user
[Problem]
Create a Python script that connects to an SQLite database named 'program_442_database.db' and interacts with a table called 'players'. The 'players' table contains the following columns: id, nam... | Here is a Python script that fulfills the requirements:
```python
import sqlite3
def get_players():
conn = sqlite3.connect('program_442_database.db')
cursor = conn.cursor()
# Get user inputs
name = input("Enter player's name: ")
team = input("Enter team name: ")
points = int(input("Enter numb... | program_442 |
<|im_start|>system
You are Qwen, created by Alibaba Cloud. You are a helpful assistant.<|im_end|>
<|im_start|>user
[Problem]
Create a Python script that connects to an SQLite database named 'program_424_database.db' and interacts with a table called 'customers'. The 'customers' table contains the following columns: 'cu... | Here is a Python script that fulfills your requirements:
```python
import sqlite3
def main():
# Connect to the SQLite database
conn = sqlite3.connect('program_424_database.db')
cursor = conn.cursor()
# Prompt the user for inputs
search_field = input("Enter the search field (first_name, last_name,... | program_424 |
<|im_start|>system
You are Qwen, created by Alibaba Cloud. You are a helpful assistant.<|im_end|>
<|im_start|>user
[Problem]
Create a Python script that connects to an existing SQLite database named 'program_233_database.db' and queries a table called 'events'. The 'events' table has columns: 'id', 'event_name', 'locat... | Here is a Python script that fulfills your requirements:
```python
import sqlite3
def get_events(location, earliest_date, latest_date):
conn = sqlite3.connect('program_233_database.db')
cursor = conn.cursor()
query = f"SELECT * FROM events WHERE location = ? AND date BETWEEN ? AND ?"
cursor.execute(q... | program_233 |
<|im_start|>system
You are Qwen, created by Alibaba Cloud. You are a helpful assistant.<|im_end|>
<|im_start|>user
[Problem]
The database is named 'program_411_database.db' and contains a table called 'campaign_analytics'. This table has the following columns: 'campaign_id' (INTEGER), 'name' (TEXT), 'clicks' (INTEGER),... | Here is a Python script that takes user inputs, constructs SQL queries based on those inputs, and prints the results:
```python
import sqlite3
def get_data(campaign_id, metric, min_value):
# Connect to the database
conn = sqlite3.connect('program_411_database.db')
cursor = conn.cursor()
# Construct t... | program_411 |
<|im_start|>system
You are Qwen, created by Alibaba Cloud. You are a helpful assistant.<|im_end|>
<|im_start|>user
[Problem]
We have a database file named 'program_377_database.db' which contains a table called 'transactions'. This table has the following columns: 'id', 'user_id', 'amount', 'category', and 'description... | Here is a Python script that fulfills your requirements:
```python
import sqlite3
def get_transactions(min_amount, max_amount, category):
conn = sqlite3.connect('program_377_database.db')
cursor = conn.cursor()
# Construct the SQL query
query = f"""
SELECT id, user_id, amount, category, descr... | program_377 |
End of preview. Expand in Data Studio
README.md exists but content is empty.
- Downloads last month
- 2