Dataset Viewer
Auto-converted to Parquet Duplicate
prompt
stringlengths
1.03k
2.28k
response
stringlengths
438
1.7k
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 enter an item type item_type = input("Enter an item type: ") # Execute the SQL query query = "SELECT * FROM inventory WHERE item_type=?" cursor.execute(query, (item_t...
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() # Get user input min_price = float(input("Enter minimum price: ")) max_price = float(input("Enter maximum price: ")) genre = input("Enter genre: ") # Adjust prices adjusted_min_price = mi...
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 SQLite database conn = sqlite3.connect('program_225_database.db') cursor = conn.cursor() # Get user inputs search_term = input().strip() filter_type = input().strip() # Build SQL query based on user inputs query = f"SELECT * FROM users WHERE {filter_type} LIKE ?" params = (f...
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 SQLite database conn = sqlite3.connect('program_277_database.db') cursor = conn.cursor() # Get user inputs event_name = input("Enter the event name or 'all': ") start_date = input("Enter the start date (YYYY-MM-DD): ") end_date = input("Enter the end date (YYYY-MM-DD): ") loc...
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 = float(input()) age = int(input()) employment_status = input() adjustment_factor = float(input()) # Adjust the minimum income adjusted_min_income = min_income + ad...
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 simple Python script that uses SQLite3 library to connect to the database and fetch the required data: ```python import sqlite3 # Connect to the database conn = sqlite3.connect('program_149_database.db') c = conn.cursor() # Get user inputs item_id = input("Enter item ID: ") description = input("Enter descr...
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 SQLite 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_substring = input().strip() # Remove leading/trailing whitespaces # Construct the...
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 from datetime import datetime # Connect to the SQLite database conn = sqlite3.connect('program_195_database.db') cursor = conn.cursor() # Get user inputs author_name = input("Enter author's name: ") start_date_str = input("Enter start publish date (YYYY-MM-DD): ") end_date_str = input("Enter ...
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 accomplishes this task: ```python import sqlite3 # Connect to the SQLite database conn = sqlite3.connect('program_185_database.db') cursor = conn.cursor() # Get user inputs location = input("Enter location: ") date = input("Enter date: ") ticket_amount = int(input("Enter ticket amount: "...
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() # Get user 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): ") max_pric...
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 SQLite 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): ") bulk_discount = float(input("Enter bulk discount percentage: ")) o...
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 SQLite database conn = sqlite3.connect('program_213_database.db') cursor = conn.cursor() # Get user input for the category category_input = input("Enter the category you're interested in: ") # Create SQL query string query_string = "SELECT * FROM inventory WHERE category=?" ...
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 the requirements: ```python import sqlite3 # Connect to the SQLite database conn = sqlite3.connect('program_24_database.db') cursor = conn.cursor() # Get user inputs min_age = int(input("Enter minimum age: ")) max_age = int(input("Enter maximum age: ")) city = input("Enter targe...
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 uses SQLite3 library to interact with the database: ```python import sqlite3 # Connect to the database conn = sqlite3.connect('program_248_database.db') cursor = conn.cursor() # Get user input min_price = float(input()) max_price = float(input()) category = input() # Build SQL query que...
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 uses SQLite3 library to interact with the database: ```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 = "SELECT * FR...
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 SQLite database conn = sqlite3.connect('program_235_database.db') cursor = conn.cursor() # Get user input category = input().strip() max_price = float(input()) id_value = int(input()) search_term = input().strip() sort_column = input().strip() sort_direction = input().strip()...
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() # Get user input 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: ")) payment_st...
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 simple Python script that uses SQLite3 library to connect to the database and execute SQL queries: ```python import sqlite3 # Connect to the database conn = sqlite3.connect('program_174_database.db') cursor = conn.cursor() # Get the researcher's name from the user researcher_name = input("Enter the researc...
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 SQLite 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: ")) c...
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()) category = input().strip("'") # Adjust the weights and ratings according to the probl...
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 SQLite database conn = sqlite3.connect('program_401_database.db') cursor = conn.cursor() # Get user inputs title = input("Enter book title: ") author = input("Enter author name: ") # Construct the SQL query query = "SELECT * FROM books WHERE title=? AND author=?" # Execute ...
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 accomplishes this task: ```python import sqlite3 # Connect to the SQLite database conn = sqlite3.connect('program_348_database.db') cursor = conn.cursor() # Get user input customer_name = input("Enter customer name: ") min_price = float(input("Enter minimum price: ")) max_price = float(i...
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() # Get user inputs account_number = input("Enter Account Number: ") min_amount = float(input("Enter Minimum Transaction Amount: ")) # Build SQL query query = """ SELECT * FROM transaction...
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 connect_to_db(): conn = sqlite3.connect('program_245_database.db') return conn def close_connection(conn): conn.close() def get_inventory_items(item_name=None, supplier=None, min_quantity=None): conn = connect_to_db() cursor = conn.cursor() query = "SELECT * ...
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 accomplishes this task: ```python import sqlite3 # Connect to the SQLite database conn = sqlite3.connect('program_445_database.db') cursor = conn.cursor() # Prompt the user for an employee ID emp_id = int(input("Enter an employee ID: ")) # Build the SQL query query = "SELECT * FROM empl...
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...
Here is a Python script that fulfills the requirements: ```python import sqlite3 def get_student_record(): try: conn = sqlite3.connect('program_393_database.db') cursor = conn.cursor() student_id = input("Enter student ID: ") if not student_id.strip(): # Check for empty input ...
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() # Get user inputs min_age = int(input("Enter minimum age: ")) country = input("Enter country: ") keyword = input("Enter keyword: ") # Construct the SQL query query = "SELECT * FROM users...
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 SQLite database conn = sqlite3.connect('program_1_database.db') cursor = conn.cursor() # Get user input customer_name = input("Enter customer name: ") # Create SQL query query = "SELECT * FROM orders WHERE customer_name=?" cursor.execute(query, (customer_name,)) # Fetch and...
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 the requirements: ```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("En...
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 a campaign name: ") # Query the database query = "SELECT * FROM marketing_campaigns WHERE campaign_name=?" cursor.execute(query, ...
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') cursor = conn.cursor() # Prompt the user to enter a customer name customer_name = input("Enter customer name: ") # Execute the SQL query to retrieve all orders for the specified customer query = "SELECT * FROM...
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 SQLite 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...
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 SQLite database conn = sqlite3.connect('program_345_database.db') cursor = conn.cursor() # Get user input year_published = input("Enter the publication year: ") category = input("Enter the research category: ") # Build SQL query query = "SELECT * FROM papers WHERE year_publi...
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 uses sqlite3 module to connect to the SQLite database and execute the required operations: ```python import sqlite3 # Connect to the SQLite database conn = sqlite3.connect('program_31_database.db') cursor = conn.cursor() # Get user input item_name = input("Enter the item name to s...
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 the requirements: ```python import sqlite3 # Connect to the SQLite database conn = sqlite3.connect('program_384_database.db') cursor = conn.cursor() # Get user inputs min_temp = float(input("Enter minimum temperature: ")) max_temp = float(input("Enter maximum temperature: ")) lo...
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 = "SELECT * FROM products WHERE name=?" params = (search_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...
Here is a Python script that uses SQLite3 library to interact with the database: ```python import sqlite3 # Connect to the database conn = sqlite3.connect('program_215_database.db') cursor = conn.cursor() # Get user input min_friends = int(input()) max_friends = int(input()) age_preference = int(input()) keyword = i...
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 uses sqlite3 module to connect to a SQLite database and query data: ```python import sqlite3 # Connect to the SQLite database conn = sqlite3.connect('program_208_database.db') # Create a cursor object cursor = conn.cursor() # Get user input title = input("Enter the title of the l...
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 SQLite database conn = sqlite3.connect('program_172_database.db') cursor = conn.cursor() # Get user input for population threshold and state abbreviation pop_threshold = int(input("Enter population threshold: ")) state_abbr = input("Enter state abbreviation: ") # Build SQL q...
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 the requirements: ```python import sqlite3 # Connect to the SQLite database conn = sqlite3.connect('program_473_database.db') cursor = conn.cursor() # Get user inputs username_search = input("Enter a username to search for: ") email_domain = input("Enter an email domain to searc...
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 uses SQLite3 library to interact with the database: ```python import sqlite3 # Connect to the database conn = sqlite3.connect('program_261_database.db') c = conn.cursor() # Get user input min_price = float(input()) max_price = float(input()) discount_percentage = float(input()) / 100 loc...
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 SQLite database conn = sqlite3.connect('program_341_database.db') cursor = conn.cursor() # Get user input min_avg_score = float(input()) max_avg_score = float(input()) desired_position = input() excluded_team = input() # Build SQL query query = """ SELECT * FROM player_stats...
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() # Get the item name from the user item_name = input("Enter the item name to search for: ") # Create the SQL query query = "SELECT * FROM inventory WHERE item_name=?" values = (item_name, )...
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') 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(input("Enter the minimum numbe...
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 SQLite 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 time in format YYYY-MM-DD HH:MM:SS: ") end_time = input("Enter end time in format YYYY-MM-DD HH:MM...
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() # Get user inputs name_input = input("Enter customer name: ") min_balance_input = float(input("Enter minimum balance: ")) # Create the SQL query query = """ SELECT * FROM customers WHERE...
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 the requirements: ```python import sqlite3 # Connect to the SQLite database conn = sqlite3.connect('program_89_database.db') cursor = conn.cursor() try: # Get user input field = input("Enter the field to search by (item_id, item_name, category): ") value = input(f"En...
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 SQLite database conn = sqlite3.connect('program_430_database.db') cursor = conn.cursor() # Get user inputs payer_name = input("Enter the payer's name: ") min_amount = float(input("Enter the minimum amount: ")) # Build SQL query query = """ SELECT * FROM transactions WHERE p...
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 to fetch the data cursor.execute("SELECT holder_name, balance FRO...
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() # Get the item name from the user item_name = input("Enter the name of the item you want to search for: ") # Create the SQL query query = "SELECT * FROM inventory WHERE item_name=?" curs...
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 simple Python script that uses sqlite3 module to connect to the SQLite database and execute SQL queries: ```python import sqlite3 # Connect to the SQLite database conn = sqlite3.connect('program_150_database.db') # Create a cursor object cursor = conn.cursor() # Prompt the user for a customer name custome...
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 the requirements: ```python import sqlite3 # Connect to the SQLite database conn = sqlite3.connect('program_275_database.db') cursor = conn.cursor() # Get user input name = input("Enter student's name: ") view_gpa = input("Do you want to view GPA details? (yes/no): ") # Constru...
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 to find the email based on the provided username cursor.execute("SELECT email FROM users WH...
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 simple Python script that accomplishes this task: ```python import sqlite3 # Connect to the SQLite database conn = sqlite3.connect('program_485_database.db') cursor = conn.cursor() # Get user inputs occupation = input("Enter occupation: ") region = input("Enter region: ") # Construct and execute the SQL q...
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 the requirements: ```python import sqlite3 # Connect to the SQLite database conn = sqlite3.connect('program_171_database.db') cursor = conn.cursor() try: # Get user input dept = input("Enter department name: ") col = input("Enter column name to order by: ") order...
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 the requirements: ```python import sqlite3 # Connect to the SQLite database conn = sqlite3.connect('program_181_database.db') cursor = conn.cursor() # Get user input team_name = input("Enter team name: ") player_position = input("Enter player position: ") min_average = float(inp...
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 accomplishes this task: ```python import sqlite3 # Connect to the SQLite database conn = sqlite3.connect('program_283_database.db') cursor = conn.cursor() # Get user input department = input("Enter department name: ") min_salary = float(input("Enter minimum salary: ")) # Construct and e...
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 accomplishes this task: ```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_preferenc...
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 accomplishes this task: ```python import sqlite3 # Connect to the SQLite database conn = sqlite3.connect('program_202_database.db') cursor = conn.cursor() # Get user inputs phone_number = input("Enter phone number: ") min_amount_due = float(input("Enter minimum amount due: ")) # Constru...
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 accomplishes this task: ```python import sqlite3 import re # Connect to the SQLite database conn = sqlite3.connect('program_56_database.db') cursor = conn.cursor() # Get user input user_input = input("Enter item name to search: ") # Sanitize user input sanitized_input = re.sub(r'[^\w\s]...
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 the requirements: ```python import sqlite3 # Connect to the SQLite database conn = sqlite3.connect('program_298_database.db') cursor = conn.cursor() # Get user input start_year = int(input("Enter the starting publication year: ")) end_year = int(input("Enter the ending publicati...
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 uses SQLite3 library to connect to the database and execute SQL queries: ```python import sqlite3 # Connect to the database conn = sqlite3.connect('program_320_database.db') c = conn.cursor() # Get user inputs email = input("Enter email address (leave blank if not needed): ") min_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 connects to the SQLite database and retrieves the required data: ```python import sqlite3 # Connect to the database conn = sqlite3.connect('program_111_database.db') cursor = conn.cursor() # Get user input base_cost = float(input()) cost_multiplier = float(input()) min_quantity_threshold...
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 accomplishes this task: ```python import sqlite3 # Connect to the SQLite database conn = sqlite3.connect('program_308_database.db') cursor = conn.cursor() # Get user inputs department = input("Enter the department name: ") max_cost = float(input("Enter the maximum cost: ")) # Build SQL ...
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() # Get user inputs min_rating = int(input("Enter minimum acceptable rating: ")) max_rating = int(input("Enter maximum acceptable rating: ")) customer_name = input("Enter customer name: ") ...
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 city name: ") min_age = int(input("Enter minimum age: ")) min_income = float(input("Enter minimum income: ")) # Build SQL query query = """ SELECT * FROM c...
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 # 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 number of poin...
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 the requirements: ```python import sqlite3 # Connect to the SQLite database conn = sqlite3.connect('program_424_database.db') cursor = conn.cursor() # Get user input search_field = input("Enter the search field (first_name, last_name, email, phone): ") search_value = input(f"Ent...
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 accomplishes this task: ```python import sqlite3 # Connect to the SQLite database conn = sqlite3.connect('program_233_database.db') cursor = conn.cursor() # Get user inputs location = input("Enter event location: ") earliest_date = input("Enter earliest date (YYYY-MM-DD): ") latest_date ...
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 SQLite database conn = sqlite3.connect('program_411_database.db') cursor = conn.cursor() # Get user inputs campaign_id = int(input("Enter Campaign ID: ")) metric = input("Enter Metric (clicks/impressions/conversion_rate): ") min_value = float(input("Enter Minimum Value: ")) ...
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 SQLite database conn = sqlite3.connect('program_377_database.db') cursor = conn.cursor() # Get user 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...
Here is a Python script that accomplishes the task: ```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...
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,...
Here is a Python script that accomplishes this task: ```python import sqlite3 import re # Connect to the SQLite3 database conn = sqlite3.connect('program_106_database.db') cursor = conn.cursor() while True: # Prompt the user to enter a last name last_name = input("Enter a last name: ") # Sanitize the in...
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_...
Here is a Python script that accomplishes the task: ```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 min...
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...
Here is a simple Python script that uses SQLite3 library to connect to the database and execute SQL queries: ```python import sqlite3 # Connect to the database conn = sqlite3.connect('program_154_database.db') cursor = conn.cursor() # Get user input location = input("Enter location: ") # Create SQL query query = "S...
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 a category name category_input = input("Enter a category name: ") # Sanitize the input by replacing single quotes with two single quotes and removing semicolons sani...
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...
Here is a Python script that fulfills the requirements: ```python import sqlite3 # Connect to the SQLite database conn = sqlite3.connect('program_412_database.db') cursor = conn.cursor() # Get user inputs category_name = input("Enter the category name: ") min_price = float(input("Enter the minimum price: ")) max_pri...
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 SQLite database conn = sqlite3.connect('program_469_database.db') cursor = conn.cursor() # Get user input item_name = input("Enter the item name to search for: ") # Create SQL query query = "SELECT * FROM orders WHERE item_name=?" cursor.execute(query, (item_name,)) # Fetch...
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 start and end dates start_date = input("Enter start date (YYYY-MM-DD): ") end_date = input("Enter end date (YYYY-MM-DD): ") # Construct the SQL query query = "SELEC...
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'...
Here is a Python script that accomplishes the task: ```python import sqlite3 # Connect to the SQLite database conn = sqlite3.connect('program_18_database.db') cursor = conn.cursor() # Get user input salary_multiplier = float(input("Enter salary multiplier: ")) bonus_amount = float(input("Enter bonus amount: ")) depa...
program_18
End of preview. Expand in Data Studio
README.md exists but content is empty.
Downloads last month
6