prompt stringlengths 1.03k 2.28k | response stringlengths 437 999 | 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_... | ```python
import sqlite3
# Connect to the SQLite database
conn = sqlite3.connect('program_77_database.db')
cursor = conn.cursor()
# Prompt the user to input an item type
item_type = input("Enter an item type: ")
# Execute the SQL query
cursor.execute("SELECT * FROM inventory WHERE item_type=?", (item_type,))
# Fetc... | 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), '... | ```python
import sqlite3
# Connect to the SQLite database
conn = sqlite3.connect('program_60_database.db')
cursor = conn.cursor()
# Prompt the user for inputs
min_price = float(input("Enter the minimum price: "))
max_price = float(input("Enter the maximum price: "))
genre = input("Enter the genre: ")
# Adjust the pr... | 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... | ```python
import sqlite3
# Connect to the database
conn = sqlite3.connect('program_225_database.db')
cursor = conn.cursor()
# Get user input
search_term = input("Enter the search term: ")
filter_type = input("Enter the filter type (username/email): ")
# Build SQL query
query = f"SELECT * FROM users WHERE {filter_typ... | 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), ... | ```python
import sqlite3
# Connect to the database
conn = sqlite3.connect('program_277_database.db')
cursor = conn.cursor()
# Get user inputs
event_name = input("Enter the event name (or 'all' for any event): ")
start_date = input("Enter the start date (YYYY-MM-DD): ")
end_date = input("Enter the end date (YYYY-MM-DD... | 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... | ```python
import sqlite3
# Connect to the database
conn = sqlite3.connect('program_356_database.db')
cursor = conn.cursor()
# Get user inputs
min_income = int(input("Enter the minimum income threshold: "))
age = int(input("Enter the age: "))
employment_status = input("Enter the employment status: ")
adjustment_factor... | 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'... | ```python
import sqlite3
# Connect to the database
conn = sqlite3.connect('program_149_database.db')
cursor = conn.cursor()
# Get user inputs
item_id = int(input("Enter item id: "))
description = input("Enter description: ")
# Construct and execute the SQL query
query = f"SELECT * FROM items WHERE id=? OR descriptio... | 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), ... | ```python
import sqlite3
# Connect to the database
conn = sqlite3.connect('program_407_database.db')
cursor = conn.cursor()
# Get user inputs
min_price = float(input())
max_price = float(input())
event_date = input()
event_name = input()
# Construct the SQL query
query = f"SELECT * FROM tickets WHERE price BETWEEN {... | 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 ... | ```python
import sqlite3
# Connect to the database
conn = sqlite3.connect('program_195_database.db')
cursor = conn.cursor()
# Get user inputs
author = input("Enter author's name: ")
start_date = input("Enter start publish date (YYYY-MM-DD): ")
end_date = input("Enter end publish date (YYYY-MM-DD): ")
keyword = input(... | 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... | ```python
import sqlite3
# Connect to the SQLite database
conn = sqlite3.connect('program_185_database.db')
cursor = conn.cursor()
# Prompt the user for inputs
location = input("Enter the location: ")
date = input("Enter the date: ")
ticket_amount = int(input("Enter the ticket amount: "))
# Construct and execute the... | 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... | ```python
import sqlite3
# Connect to the SQLite database
conn = sqlite3.connect('program_353_database.db')
cursor = conn.cursor()
# Prompt user for inputs
room_type = input("Enter room type: ")
check_in_date = input("Enter check-in date (YYYY-MM-DD): ")
check_out_date = input("Enter check-out date (YYYY-MM-DD): ")
m... | 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... | ```python
import sqlite3
# Connect to the database
conn = sqlite3.connect('program_78_database.db')
cursor = conn.cursor()
# Get user inputs
start_date = input("Enter start date (YYYY-MM-DD): ")
end_date = input("Enter end date (YYYY-MM-DD): ")
discount_percentage = float(input("Enter bulk discount percentage: "))
st... | 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 ... | ```python
import sqlite3
# Connect to the database
conn = sqlite3.connect('program_213_database.db')
# Create a cursor object
cursor = conn.cursor()
# Get user input
category = input("Enter the category: ")
# Build SQL query
query = f"SELECT * FROM inventory WHERE category = ?"
# Execute the query
cursor.execute(q... | 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... | ```python
import sqlite3
# Connect to the SQLite database
conn = sqlite3.connect('program_24_database.db')
cursor = conn.cursor()
# Prompt the user for input
min_age = int(input("Enter the minimum age: "))
max_age = int(input("Enter the maximum age: "))
city = input("Enter the city: ")
include_younger = input("Do you... | 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... | ```python
import sqlite3
# Connect to the database
conn = sqlite3.connect('program_248_database.db')
cursor = conn.cursor()
# Get user inputs
min_price = float(input())
max_price = float(input())
category = input()
# Build SQL query
query = f"SELECT * FROM orders WHERE price BETWEEN {min_price} AND {max_price} AND c... | 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 ... | ```python
import sqlite3
# Connect to the database
conn = sqlite3.connect('program_295_database.db')
cursor = conn.cursor()
# Get user inputs
account_id = int(input())
min_balance = float(input())
# Build SQL query
query = f"SELECT * FROM accounts WHERE account_id = ? AND balance >= ?"
# Execute the query
cursor.ex... | 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)... | ```python
import sqlite3
# Connect to the database
conn = sqlite3.connect('program_235_database.db')
cursor = conn.cursor()
# Get user inputs
category = input("Enter the category: ")
max_price = float(input("Enter the maximum price: "))
id_value = int(input("Enter the ID value: "))
search_term = input("Enter the sear... | 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 (... | ```python
import sqlite3
# Connect to the SQLite database
conn = sqlite3.connect('program_217_database.db')
cursor = conn.cursor()
# Prompt the user for inputs
start_date = input("Enter start date (YYYY-MM-DD): ")
end_date = input("Enter end date (YYYY-MM-DD): ")
min_amount = float(input("Enter minimum amount due: ")... | 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... | ```python
import sqlite3
# Connect to the database
conn = sqlite3.connect('program_174_database.db')
# Create a cursor object
cursor = conn.cursor()
# Get the researcher's name from the user
researcher_name = input("Enter the researcher's name: ")
# Build the SQL query
query = f"SELECT * FROM studies WHERE research... | 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... | ```python
import sqlite3
# Connect to the database
conn = sqlite3.connect('program_315_database.db')
cursor = conn.cursor()
# Get user inputs
start_date = input("Enter start date (YYYY-MM-DD): ")
end_date = input("Enter end date (YYYY-MM-DD): ")
min_audience_size = int(input("Enter minimum audience size: "))
conversi... | 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... | ```python
import sqlite3
# Connect to the SQLite database
conn = sqlite3.connect('program_75_database.db')
cursor = conn.cursor()
# Get user inputs
min_weight = float(input())
max_weight = float(input())
min_rating = float(input()) + 0.3
category = input()
# Adjust the weight range
min_weight *= 0.95
max_weight *= 1... | 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' (... | ```python
import sqlite3
# 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 name: ")
# Construct the SQL query
query = f"SELECT * FROM books WHERE title=? AND 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... | ```python
import sqlite3
# Connect to the SQLite database
conn = sqlite3.connect('program_348_database.db')
cursor = conn.cursor()
# Prompt the user for inputs
customer_name = input("Enter customer name: ")
min_price = float(input("Enter minimum price: "))
max_price = float(input("Enter maximum price: "))
# Build th... | 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_... | ```python
import sqlite3
# Connect to the SQLite database
conn = sqlite3.connect('program_231_database.db')
cursor = conn.cursor()
# Prompt the user for inputs
account_number = input("Enter account number: ")
min_amount = float(input("Enter minimum transaction amount: "))
# Build the SQL query
query = f"SELECT * FRO... | 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... | ```python
import sqlite3
def display_all_items():
conn = sqlite3.connect('program_245_database.db')
cursor = conn.cursor()
cursor.execute("SELECT * FROM inventory")
rows = cursor.fetchall()
for row in rows:
print(row)
conn.close()
def search_inventory(item_name, supplier, min_quantity)... | 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... | ```python
import sqlite3
# Connect to the SQLite database
conn = sqlite3.connect('program_445_database.db')
# Create a cursor object using the cursor() method
cursor = conn.cursor()
# Prompt the user for an employee ID
emp_id = int(input("Enter an employee ID: "))
# Prepare the SQL query
query = f"SELECT * FROM emp... | 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... | ```python
import sqlite3
# Connect to the SQLite database
conn = sqlite3.connect('program_418_database.db')
cursor = conn.cursor()
# Prompt the user for a patient's name
name = input("Enter a patient's name: ")
# Execute the SQL query
cursor.execute("SELECT * FROM patients WHERE name=?", (name,))
records = cursor.fe... | 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... | ```python
import sqlite3
# Connect to the SQLite database
conn = sqlite3.connect('program_393_database.db')
cursor = conn.cursor()
# Prompt the user for input
student_id = input("Enter a student ID: ")
# Check if the input is empty
if not student_id:
print("An error occurred: incomplete input")
else:
# Execu... | 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, ... | ```python
import sqlite3
# Connect to the SQLite database
conn = sqlite3.connect('program_382_database.db')
cursor = conn.cursor()
# Prompt user for inputs
min_age = int(input("Enter minimum age: "))
country = input("Enter country: ")
keyword = input("Enter keyword: ")
# Construct SQL query
query = f"SELECT * FROM u... | 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... | ```python
import sqlite3
# Connect to the database
conn = sqlite3.connect('program_1_database.db')
cursor = conn.cursor()
# Get user input
customer_name = input("Enter customer name: ")
# Build SQL query
query = f"SELECT * FROM orders WHERE customer_name = ?"
# Execute the query
cursor.execute(query, (customer_name... | 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... | ```python
import sqlite3
# Connect to the SQLite database
conn = sqlite3.connect('program_372_database.db')
cursor = conn.cursor()
# Get user inputs
doctor_name = input("Enter doctor's name: ")
min_age = int(input("Enter minimum age: "))
max_age = int(input("Enter maximum age: "))
search_field = input("Enter search f... | 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... | ```python
import sqlite3
# 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: ")
# Build the SQL query
query = f"SELECT * FROM marketing_campaigns WHERE campaign_name LIKE ?"
# Execute th... | 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).... | ```python
import sqlite3
# Connect to the SQLite database
conn = sqlite3.connect('program_170_database.db')
# Create a cursor object using the cursor() method
cursor = conn.cursor()
# Prompt the user to enter a customer name
customer_name = input("Enter a customer name: ")
# Execute a SQL query to retrieve all orde... | 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... | ```python
import sqlite3
# Connect to the database
conn = sqlite3.connect('program_370_database.db')
cursor = conn.cursor()
# Get user inputs
min_balance = float(input())
max_balance = float(input())
bonus_percentage = float(input())
membership_level = input()
# Calculate effective balance range
effective_min_balanc... | 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... | ```python
import sqlite3
# Connect to the database
conn = sqlite3.connect('program_345_database.db')
# Create a cursor object
cursor = conn.cursor()
# Prompt the user for inputs
year = input("Enter the publication year: ")
category = input("Enter the research category: ")
# Build the SQL query
query = f"SELECT * FR... | 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_... | ```python
import sqlite3
# Connect to the SQLite database
conn = sqlite3.connect('program_31_database.db')
cursor = conn.cursor()
# Prompt the user to input an item name
item_name = input("Enter the item name to search for: ")
# Build the SQL query
query = f"SELECT * FROM inventory WHERE item_name LIKE ?"
# Execute... | 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... | ```python
import sqlite3
# Connect to the SQLite database
conn = sqlite3.connect('program_384_database.db')
cursor = conn.cursor()
# Prompt user for inputs
min_temp = float(input("Enter minimum temperature: "))
max_temp = float(input("Enter maximum temperature: "))
location = input("Enter location: ")
status = input(... | 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... | ```python
import sqlite3
# Connect to the SQLite database
conn = sqlite3.connect('program_34_database.db')
cursor = conn.cursor()
# Prompt the user to enter a search term
search_term = input("Enter a product name to search for: ")
# Build the SQL query
query = f"SELECT * FROM products WHERE name LIKE ?"
# Execute t... | 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... | ```python
import sqlite3
# Connect to the database
conn = sqlite3.connect('program_215_database.db')
cursor = conn.cursor()
# Get user inputs
min_friends = int(input())
max_friends = int(input())
age_pref = int(input())
keyword = input()
# Adjust the friends_count range
min_friends -= 10
max_friends += 10
# Build t... | 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),... | ```python
import sqlite3
# Connect to the SQLite database
conn = sqlite3.connect('program_208_database.db')
cursor = conn.cursor()
# Prompt the user for the title
title = input("Enter the title of the listing: ")
# Build the SQL query
query = f"SELECT * FROM listings WHERE title = ?"
# Execute the query
cursor.exec... | 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),... | ```python
import sqlite3
# Connect to the database
conn = sqlite3.connect('program_172_database.db')
cursor = conn.cursor()
# Get user input
threshold = int(input("Enter the population threshold: "))
state = input("Enter the state abbreviation: ")
# Build SQL query
query = f"SELECT * FROM population WHERE population... | 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... | ```python
import sqlite3
# Connect to the SQLite database
conn = sqlite3.connect('program_473_database.db')
cursor = conn.cursor()
# Get user inputs
username = input("Enter a username: ")
email_domain = input("Enter an email domain: ")
order_column = input("Enter a column to order by (username, email, bio): ")
order_... | 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). ... | ```python
import sqlite3
# Connect to the database
conn = sqlite3.connect('program_261_database.db')
cursor = conn.cursor()
# Get user inputs
min_price = float(input())
max_price = float(input())
discount = float(input())
location = input()
# Calculate the adjusted price range
adjusted_min_price = min_price * (1 - d... | 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),... | ```python
import sqlite3
# Connect to the database
conn = sqlite3.connect('program_341_database.db')
cursor = conn.cursor()
# Get user inputs
min_avg_score = float(input())
max_avg_score = float(input())
position = input()
exclude_team = input()
# Build SQL query
query = f"SELECT * FROM player_stats WHERE avg_score ... | 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... | ```python
import sqlite3
# Connect to the SQLite database
conn = sqlite3.connect('program_8_database.db')
cursor = conn.cursor()
# Prompt the user to enter an item name
item_name = input("Enter the item name: ")
# Build the SQL query
query = "SELECT * FROM inventory WHERE item_name=?"
cursor.execute(query, (item_nam... | 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... | ```python
import sqlite3
# Connect to the database
conn = sqlite3.connect('program_247_database.db')
# Create a cursor object
cursor = conn.cursor()
# Get user inputs
start_year = int(input("Enter the start year of publication: "))
end_year = int(input("Enter the end year of publication: "))
min_citations = int(inpu... | 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... | ```python
import sqlite3
# Connect to the database
conn = sqlite3.connect('program_453_database.db')
cursor = conn.cursor()
# Get user inputs
device_id = input("Enter device id: ")
start_time = input("Enter start timestamp: ")
end_time = input("Enter end timestamp: ")
sort_column = input("Enter column to sort by (tem... | 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... | ```python
import sqlite3
# Connect to the SQLite database
conn = sqlite3.connect('program_350_database.db')
cursor = conn.cursor()
# Prompt the user for input
customer_name = input("Enter customer name: ")
min_balance = float(input("Enter minimum balance: "))
# Build the SQL query
query = f"SELECT * FROM customers W... | 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... | ```python
import sqlite3
# Connect to the SQLite database
conn = sqlite3.connect('program_89_database.db')
cursor = conn.cursor()
# Prompt the user to input a field to search by
field = input("Enter a field to search by (item_id, item_name, category): ")
# Prompt the user to input a value to search for
value = input... | 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... | ```python
import sqlite3
# Connect to the database
conn = sqlite3.connect('program_430_database.db')
cursor = conn.cursor()
# Prompt the user for input
payer_name = input("Enter the payer's name: ")
min_amount = float(input("Enter the minimum amount: "))
# Build the SQL query
query = f"SELECT * FROM transactions WHE... | 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' ... | ```python
import sqlite3
# Connect to the SQLite database
conn = sqlite3.connect('program_437_database.db')
cursor = conn.cursor()
# Prompt the user for an account number
account_number = int(input("Enter an account number: "))
# Execute the SQL query
cursor.execute("SELECT holder_name, balance FROM accounts WHERE a... | 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 ... | ```python
import sqlite3
# Connect to the SQLite database
conn = sqlite3.connect('program_463_database.db')
cursor = conn.cursor()
# Ask the user for the item name
item_name = input("Enter the name of the item you want to search for: ")
# Execute the SQL query
cursor.execute("SELECT * FROM inventory WHERE item_name=... | 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... | ```python
import sqlite3
# Connect to the SQLite database
conn = sqlite3.connect('program_150_database.db')
cursor = conn.cursor()
# Prompt the user for a customer name
customer_name = input("Enter a customer name: ")
# Build the SQL query
query = f"SELECT * FROM orders WHERE customer = ?"
# Execute the query
curso... | 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... | ```python
import sqlite3
# Connect to the SQLite database
conn = sqlite3.connect('program_275_database.db')
cursor = conn.cursor()
# Ask user for input
student_name = input("Enter the name of the student: ")
gpa_check = input("Do you want to view GPA details? (yes/no): ")
# Construct the SQL query
if gpa_check.lower... | 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'... | ```python
import sqlite3
# Connect to the SQLite database
conn = sqlite3.connect('program_82_database.db')
cursor = conn.cursor()
# Prompt the user for a username
username = input("Enter a username: ")
# Execute the SQL query
cursor.execute("SELECT email FROM users WHERE username=?", (username,))
result = cursor.fet... | 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 ... | ```python
import sqlite3
# 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 region: ")
# Construct and execute the SQL query
query = f"SELECT * FROM census WHERE occupati... | 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, ... | ```python
import sqlite3
# Connect to the SQLite database
conn = sqlite3.connect('program_171_database.db')
cursor = conn.cursor()
# Prompt the user for inputs
department = input("Enter department name: ")
column = input("Enter column name: ")
direction = input("Enter order direction (ASC/DESC): ")
# Build the SQL q... | 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... | ```python
import sqlite3
# Connect to the SQLite database
conn = sqlite3.connect('program_181_database.db')
cursor = conn.cursor()
# Prompt the user for inputs
team = input("Enter team name: ")
position = input("Enter player position: ")
min_average = float(input("Enter minimum average: "))
sort_column = input("Enter... | 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... | ```python
import sqlite3
# Connect to the SQLite database
conn = sqlite3.connect('program_283_database.db')
cursor = conn.cursor()
# Prompt the user for inputs
department = input("Enter department: ")
min_salary = float(input("Enter minimum salary: "))
# Construct and execute the SQL query
query = f"SELECT * FROM em... | 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 ... | ```python
import sqlite3
# Connect to the SQLite database
conn = sqlite3.connect('program_191_database.db')
cursor = conn.cursor()
# Get user inputs
customer_name = input("Enter customer name: ")
min_quantity = int(input("Enter minimum quantity: "))
dish_preference = input("Enter dish preference: ")
price_limit = flo... | 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... | ```python
import sqlite3
# Connect to the SQLite database
conn = sqlite3.connect('program_202_database.db')
cursor = conn.cursor()
# Prompt the user for inputs
phone_number = input("Enter a phone number: ")
min_amount_due = float(input("Enter a minimum amount due: "))
# Construct and execute the SQL query
query = f"... | 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... | ```python
import sqlite3
import re
# 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 the input
sanitized_input = re.sub(r'[^\w\s]', '', user_input)
# Execute the query
cursor.execute... | 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', ... | ```python
import sqlite3
# Connect to the SQLite database
conn = sqlite3.connect('program_298_database.db')
cursor = conn.cursor()
# Prompt the user for inputs
start_year = int(input("Enter the starting publication year: "))
end_year = int(input("Enter the ending publication year: "))
genre = input("Enter the genre: ... | 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... | ```python
import sqlite3
# Connect to the database
conn = sqlite3.connect('program_320_database.db')
cursor = conn.cursor()
# Get user inputs
email = input("Enter email (leave blank if not needed): ")
min_balance = float(input("Enter minimum balance: "))
max_balance = float(input("Enter maximum balance: "))
# Build ... | 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... | ```python
import sqlite3
# Connect to the database
conn = sqlite3.connect('program_111_database.db')
cursor = conn.cursor()
# Get user inputs
base_cost = float(input())
cost_multiplier = float(input())
min_quantity = int(input()) + 5
item_type = input()
# Calculate adjusted cost and quantity check
adjusted_cost = ba... | 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... | ```python
import sqlite3
# Connect to the SQLite database
conn = sqlite3.connect('program_308_database.db')
cursor = conn.cursor()
# Prompt the user for inputs
department = input("Enter the department: ")
max_cost = float(input("Enter the maximum cost: "))
# Build the SQL query
query = f"SELECT * FROM products WHERE... | 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... | ```python
import sqlite3
# Connect to the SQLite database
conn = sqlite3.connect('program_198_database.db')
cursor = conn.cursor()
# Prompt the user for inputs
min_rating = int(input("Enter the minimum acceptable rating: "))
max_rating = int(input("Enter the maximum acceptable rating: "))
customer_name = input("Enter... | 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),... | ```python
import sqlite3
# Connect to the database
conn = sqlite3.connect('program_391_database.db')
cursor = conn.cursor()
# Get user inputs
city = input("Enter a city: ")
min_age = int(input("Enter a minimum age: "))
min_income = float(input("Enter a minimum income: "))
# Build SQL query
query = f"SELECT * FROM ce... | 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... | ```python
import sqlite3
# Connect to the SQLite database
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 points: "))
column = input("Enter column to display: ")
order = input("... | 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... | ```python
import sqlite3
# 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, email, phone): ")
search_value = input("Enter the search value: ")
sort_field = input("En... | 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... | ```python
import sqlite3
# Connect to the SQLite database
conn = sqlite3.connect('program_233_database.db')
cursor = conn.cursor()
# Prompt the user for inputs
location = input("Enter the event location: ")
earliest_date = input("Enter the earliest date (YYYY-MM-DD): ")
latest_date = input("Enter the latest date (YYY... | 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),... | ```python
import sqlite3
# Connect to the database
conn = sqlite3.connect('program_411_database.db')
cursor = conn.cursor()
# Get user inputs
campaign_id = int(input())
metric = input()
min_value = float(input())
# Construct the SQL query
query = f"SELECT name, {metric} FROM campaign_analytics WHERE campaign_id = ? ... | 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... | ```python
import sqlite3
# Connect to the database
conn = sqlite3.connect('program_377_database.db')
cursor = conn.cursor()
# Prompt user for inputs
min_amount = float(input("Enter minimum transaction amount: "))
max_amount = float(input("Enter maximum transaction amount: "))
category = input("Enter transaction categ... | program_377 |
<|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_269_database.db' and queries a table called 'inventory'. The table has columns: product_id, product_name, catego... | ```python
import sqlite3
# Connect to the SQLite database
conn = sqlite3.connect('program_269_database.db')
cursor = conn.cursor()
# Get user inputs
min_stock = int(input("Enter minimum stock threshold: "))
max_price = float(input("Enter maximum price: "))
category = input("Enter product category: ")
# Build SQL que... | program_269 |
<|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 SQLite3 database named 'program_106_database.db' and queries a table called 'employees'. The table contains columns: employee_id, first_name, last_name,... | ```python
import sqlite3
# Connect to the SQLite database
conn = sqlite3.connect('program_106_database.db')
cursor = conn.cursor()
# Prompt the user to enter a last name
last_name = input("Enter a last name: ")
# Sanitize the input to remove non-alphabetic characters
last_name = ''.join(e for e in last_name if e.isa... | program_106 |
<|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_69_database.db' and queries a table called 'orders'. The 'orders' table contains columns: 'order_id' (INTEGER), 'customer_... | ```python
import sqlite3
# Connect to the SQLite database
conn = sqlite3.connect('program_69_database.db')
cursor = conn.cursor()
# Get user inputs
customer_name = input("Enter customer name: ")
product = input("Enter product: ")
min_amount = float(input("Enter minimum amount: "))
# Construct the SQL query
query = f... | program_69 |
<|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_154_database.db' with a table called 'listings'. This table contains columns named 'listing_id', 'title', 'description', 'price', and 'location'. Your task is t... | ```python
import sqlite3
# Connect to the database
conn = sqlite3.connect('program_154_database.db')
# Create a cursor object
cursor = conn.cursor()
# Ask the user for the location
location = input("Enter the location: ")
# Build the SQL query
query = "SELECT * FROM listings WHERE location=?"
# Execute the query
c... | program_154 |
<|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_74_database.db' and queries a table called 'items'. The table has the following columns: item_id (INTEGER), item_name (TE... | ```python
import sqlite3
# Connect to the SQLite database
conn = sqlite3.connect('program_74_database.db')
cursor = conn.cursor()
# Prompt the user for input
category = input("Enter a category: ")
# Sanitize the input
category = category.replace("'", "''")
# Build the SQL query
query = f"SELECT * FROM items WHERE c... | program_74 |
<|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_412_database.db' and queries a table called 'products'. The 'products' table has the following columns: 'id' (INTEGER PRI... | ```python
import sqlite3
# Connect to the SQLite database
conn = sqlite3.connect('program_412_database.db')
cursor = conn.cursor()
# Prompt the user for input
category = input("Enter the category: ")
min_price = float(input("Enter the minimum price: "))
max_price = float(input("Enter the maximum price: "))
# Build t... | program_412 |
<|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 set up using SQLite with a file named 'program_469_database.db'. This database contains a table called 'orders' with the following columns: 'order_id' (an integer that auto-inc... | ```python
import sqlite3
# Connect to the database
conn = sqlite3.connect('program_469_database.db')
# Create a cursor object
cursor = conn.cursor()
# Ask the user for the item name
item_name = input("Enter the item name to search for: ")
# Build the SQL query
query = "SELECT * FROM orders WHERE item_name=?"
# Exe... | program_469 |
<|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_197_database.db' and queries a table called 'sales_data'. The table has the following columns: transaction_id (INTEGER PR... | ```python
import sqlite3
# Connect to the SQLite database
conn = sqlite3.connect('program_197_database.db')
cursor = conn.cursor()
# Prompt the user for input
start_date = input("Enter start date (YYYY-MM-DD): ")
end_date = input("Enter end date (YYYY-MM-DD): ")
# Construct and execute the SQL query
query = f"SELECT... | program_197 |
<|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_18_database.db' and interacts with a table called 'employees'. The 'employees' table contains the following columns: 'id'... | ```python
import sqlite3
# Connect to the SQLite database
conn = sqlite3.connect('program_18_database.db')
cursor = conn.cursor()
# Prompt the user for inputs
salary_multiplier = float(input("Enter a salary multiplier: "))
bonus_amount = int(input("Enter a bonus amount: "))
department_name = input("Enter a department... | program_18 |
<|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_271_database.db' and queries a table called 'patients'. The 'patients' table contains the following columns: patient_id, f... | ```python
import sqlite3
# Connect to the SQLite database
conn = sqlite3.connect('program_271_database.db')
cursor = conn.cursor()
# Get user inputs
min_age = int(input("Enter minimum age: "))
max_age = int(input("Enter maximum age: "))
ailment_filter = input("Enter ailment filter (or 'ANY' if none): ")
doctor_id_fil... | program_271 |
<|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_126_database.db' and contains a table called 'sales'. This table has the following columns: 'id' (INTEGER), 'item' (TEXT), 'category' (TEXT), 'quan... | ```python
import sqlite3
# Connect to the database
conn = sqlite3.connect('program_126_database.db')
cursor = conn.cursor()
# Get user inputs
upper_date = input("Enter the upper date bound in the format 'YYYY-MM-DD': ")
quantity_increase = int(input("Enter the quantity increase value as an integer: "))
category = inp... | program_126 |
<|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_324_database.db' and contains a table called 'students'. This table has four columns: 'id' which is an integer and the primary key, 'name' which is a text field and... | ```python
import sqlite3
# Connect to the database
conn = sqlite3.connect('program_324_database.db')
# Create a cursor object
cursor = conn.cursor()
# Get user input
student_id = int(input())
# Build SQL query
query = "SELECT * FROM students WHERE id=?"
# Execute the query
cursor.execute(query, (student_id,))
# F... | program_324 |
<|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_361_database.db' which contains a table called 'menu'. This table has columns named 'item_id', 'item_name', and 'price'. Your task is to write a code snippet th... | ```python
import sqlite3
# Connect to the database
conn = sqlite3.connect('program_361_database.db')
cursor = conn.cursor()
# Get user inputs
customer_name = input()
min_price = float(input())
max_price = float(input())
item_name = input()
# Calculate price range multiplier
multiplier = max_price - min_price
# Cons... | program_361 |
README.md exists but content is empty.
- Downloads last month
- 3