Dataset Viewer
Auto-converted to Parquet Duplicate
db_id
stringlengths
22
75
question
stringlengths
45
1.68k
gold_sql
stringlengths
43
4.71k
source
stringclasses
1 value
evidence
stringlengths
0
828
schema_text
stringlengths
352
10.4k
climate_data_analysis_and_prediction
What are the names of the top 5 regions with the highest average rainfall anomalies over the past 5 years and the names of the top 5 users who have accessed records from these regions the most?
WITH RainfallAnomalies AS ( SELECT c.region_id, c.rainfall_mm FROM climate_data c WHERE c.anomaly_rainfall = 1 AND c.year >= (SELECT MAX(year) - 5 FROM climate_data) ), TopRegions AS ( SELECT r.region_id, r.region_name, AVG(ra.rainfall_mm) AS avg_rainfall ...
synsql
【DB_ID】 climate_data_analysis_and_prediction # Table: climate_data [ (record_id:INTEGER, PK, examples=[0, 1]), (anomaly_rainfall:INTEGER, examples=[1, 0]), (area:INTEGER, examples=[1]), (day:INTEGER, examples=[1]), (fcg:INTEGER, examples=[1]), (fatalities:INTEGER, examples=[1, 0]), (latitude:REAL, example...
healthcare_and_medication_management
What is the most commonly prescribed medication among all patients?
SELECT m.medication_name, COUNT(p.prescription_id) AS prescription_count FROM medications m JOIN prescriptions p ON m.medication_id = p.medication_id GROUP BY m.medication_name ORDER BY prescription_count DESC LIMIT 1;
synsql
- The term "most commonly prescribed" refers to the medication with the highest number of prescription records in the database; - The query considers all patients and all prescriptions to determine this information.
【DB_ID】 healthcare_and_medication_management # Table: patients [ (patient_id:INTEGER, PK, examples=[0, 1]), (first_name:TEXT, examples=['John', 'Jane']), (last_name:TEXT, examples=['Doe', 'Smith']), (date_of_birth:TEXT, examples=['1990-01-01', '1992-02-02']), (contact_email:TEXT, examples=['john.doe@example.c...
financial_product_performance_and_barrier_event_analysis
Hey! Could you give me a list of all the products with a high risk level? I need their names, how many times their barriers have been hit, their average barrier hit ratio, and the latest value they had. I want to see this sorted by the number of barrier hits, from the most to the least.
WITH HighRiskProducts AS ( SELECT p.product_id, p.product_name FROM products p JOIN risk_assessments ra ON p.product_id = ra.product_id WHERE ra.risk_level = 'High' ), BarrierHits AS ( SELECT product_id, COUNT(event_id) AS barrier_hit_count FROM barrier_events GROUP BY produ...
synsql
【DB_ID】 financial_product_performance_and_barrier_event_analysis # Table: products [ (product_id:INTEGER, PK, examples=[0, 1]), (product_name:TEXT, examples=['Bonus Certificates', 'Bonus Classic']), (product_type_id:INTEGER, examples=[0]), (issuance_date:TEXT, examples=['2020-01-01']), (maturity_date:TEXT, ex...
conference_session_management_and_scheduling
**User**: I want to get details about sessions. **Assistant**: What type of sessions are you interested in? **User**: Sessions where speakers have expertise in Cloud architecture. **Assistant**: Do you need any specific information about the speakers? **User**: Just their roles and areas of expertise. **Assistant**: Wh...
WITH SpeakerSessionCTE AS ( SELECT s.session_id, s.title, s.date, s.location_id, GROUP_CONCAT(sp.session_role, ', ') AS speaker_roles, GROUP_CONCAT(sp.expertise, ', ') AS speaker_expertises FROM sessions s INNER JOIN speakers sp ON s.session_id = sp.session_i...
synsql
【DB_ID】 conference_session_management_and_scheduling # Table: sessions [ (session_id:INTEGER, PK, examples=[0, 1]), (title:TEXT, examples=['Registration', 'Enabling Cloud Adoption with a Business Enablement Platform']), (date:TEXT, examples=['2022-08-01']), (start_time:TEXT, examples=['07:00:00', '11:00:00']), ...
technology_trends_and_mentions_analytics
Could you please provide a yearly summary of technology trends, including the technology name, year, total mentions, average sentiment score, average reliability score, current rank, last year's rank, and the change in rank, ordered by year and rank?
WITH YearlyTechStats AS ( SELECT t.tech_id, t.tech_name, m.year, SUM(m.mentions_count) AS total_mentions, AVG(m.sentiment_score) AS average_sentiment, AVG(ms.reliability_score) AS average_reliability, RANK() OVER (PARTITION BY m.year ORDER BY SUM(m.mentions_c...
synsql
【DB_ID】 technology_trends_and_mentions_analytics # Table: technologies [ (tech_id:INTEGER, PK, examples=[0, 1]), (tech_name:TEXT, examples=['Pandas', 'Grafana']), (description:TEXT, examples=['Data manipulation and analysis library for Python.', 'Open-source platform for monitoring and observability.']), (categ...
healthcare_data_management_and_analysis_330858
Which are the top 5 hospitals with the highest readmission rates and what are their average total charges, readmission rates, readmission ranks, discharge counts, average patient ages, average education levels, average income levels, and male to female patient ratios?
WITH DischargeStats AS ( SELECT d.provider_id, h.provider_name, AVG(d.average_total_payments) AS avg_total_charges, SUM(CASE WHEN d.readmission_flag = 'Yes' THEN 1 ELSE 0 END) * 1.0 / COUNT(*) AS readmission_rate, COUNT(*) AS discharge_count FROM discharge_data d ...
synsql
; Readmission rate is a measure of the percentage of patients who return to the hospital within a certain time period after being discharged; A higher readmission rate may indicate lower quality of care; Average total charges and discharge counts can provide insight into the financial burden and volume of patients for ...
【DB_ID】 healthcare_data_management_and_analysis_330858 # Table: hospitals [ (provider_id:INTEGER, PK, examples=[0, 1]), (provider_name:TEXT, examples=['Baylor Medical Center at Waxahachie', 'Methodist Hospital']), (street_address:TEXT, examples=['1405 W Jefferson St', '7700 Floyd Curl Dr']), (city:TEXT, example...
early_childhood_education_and_care_planning
Find the total required hours of early education for 3-year-olds in each area, along with the area's name, and return the results in descending order of the required hours.
SELECT a.area_name, p.three_year_old_places * r.required_hours AS total_three_year_old_hours_required FROM areas a JOIN dwellings d ON a.area_id = d.area_id JOIN pupil_projections p ON d.dwelling_id = p.dwelling_id JOIN education_requirements r ON p.requirement_id = r.requirement_id WHERE ...
synsql
【DB_ID】 early_childhood_education_and_care_planning # Table: dwellings [ (dwelling_id:INTEGER, PK, examples=[0, 1]), (area_id:INTEGER, examples=[1]), (num_dwellings:INTEGER, examples=[100, 120]), (population_density:REAL, examples=[1500.0, 1800.0]), (average_family_size:REAL, examples=[3.5, 4.0]), (year_bui...
e_commerce_shipping_cost_estimation_and_management
What are the average shipping costs for customer with ID 0 in Switzerland, grouped by order value ranges?
WITH CustomerOrders AS ( SELECT o.order_id, o.order_value, o.shipping_cost, sc.order_value_min, sc.order_value_max, sc.cost FROM orders o JOIN shipping_options so ON o.shipping_id = so.shipping_id JOIN shipping_costs sc ON o.shipping_id = sc.shipping_id ...
synsql
【DB_ID】 e_commerce_shipping_cost_estimation_and_management # Table: shipping_options [ (shipping_id:INTEGER, PK, examples=[0, 1]), (region:TEXT, examples=['Switzerland']), (option_name:TEXT, examples=['Priority', 'Economy']), (description:TEXT, examples=['Priority shipping within Switzerland', 'Economy shipping...
medical_imaging_and_abnormality_detection
Find the latest abnormality for each patient, along with the pathology classification and the total number of comments for that abnormality, ordered by the total number of comments in descending order and then by the patient's name.
WITH RankedAbnormalities AS ( SELECT a.abnormality_id, a.patient_id, p.first_name || ' ' || p.last_name AS patient_name, a.pathology, a.detection_date, ROW_NUMBER() OVER (PARTITION BY a.patient_id ORDER BY a.detection_date DESC) AS rn FROM abnormalities a JOI...
synsql
【DB_ID】 medical_imaging_and_abnormality_detection # Table: patients [ (patient_id:TEXT, PK, examples=['0', '1']), (first_name:TEXT, examples=['Jane', 'John']), (last_name:TEXT, examples=['Doe', 'Smith']), (date_of_birth:TEXT, examples=['1975-06-15', '1980-10-20']), (gender:TEXT, examples=['Female', 'Male']), ...
flight_data_and_delay_management
Could you calculate the percentage of flights that have the highest claim amount?
WITH MaxClaimAmount AS ( SELECT MAX(claim_amount) AS max_claim_amount FROM claims ), FlightsWithMaxClaim AS ( SELECT f.flight_id FROM flights f JOIN claims c ON f.flight_id = c.flight_id WHERE c.claim_amount = (SELECT max_claim_amount FROM MaxClaimAmount) ) SELECT CAST(COUNT(fwm.flight_id) AS R...
synsql
【DB_ID】 flight_data_and_delay_management # Table: flights [ (flight_id:INTEGER, PK, examples=[0, 1]), (flight_no:TEXT, examples=['UO686', 'CI7868']), (airline_id:INTEGER, examples=[0]), (departure_airport_id:INTEGER, examples=[0, 1]), (arrival_airport_id:INTEGER, examples=[1, 0]), (std_hour:INTEGER, example...
fashion_and_apparel_sizing_119386
Find the top-ranked size categories based on customer recommendations, along with corresponding product names, total stock levels, and brand performance; ordered by the number of recommendations and available stock.
WITH SizeRecommendations AS ( SELECT s.size_name, s.size_code, p.product_name, COUNT(*) AS recommendation_count FROM customer_fit_recommendations r JOIN products p ON r.product_id = p.product_id JOIN sizes s ON p.size_id = s.size_id GROUP BY ...
synsql
; This question assumes that 'top-ranked' refers to the highest cumulative recommendation count; The brand performance is measured by the cumulative recommendation count for each size and brand combination; The query also implies that the available stock is an important factor in determining the rank of size categories...
【DB_ID】 fashion_and_apparel_sizing_119386 # Table: sizes [ (size_id:INTEGER, PK, examples=[0, 1]), (size_name:TEXT, examples=['Small', 'Medium']), (size_code:TEXT, examples=['S', 'M']), (brand_id:INTEGER, examples=[0, 1]), (description:TEXT, examples=['Standard small size for Brand A', 'Standard medium size f...
employee_management_and_hr_database
**User**: I want to see some information about our company's departments. **Assistant**: Sure, what specific information about the departments are you interested in? **User**: I am looking for the names of the departments along with the number of employees in each department. **Assistant**: Got it. Do you also want to ...
SELECT d.department_name, COUNT(e.employee_id) AS employee_count, RANK() OVER (ORDER BY COUNT(e.employee_id) DESC) AS department_rank FROM employees e JOIN departments d ON e.department_id = d.department_id GROUP BY d.department_id, d.department_name ORDER BY employee_count DESC;
synsql
【DB_ID】 employee_management_and_hr_database # Table: employees [ (employee_id:INTEGER, PK, examples=[0, 1]), (name:TEXT, examples=['Tiger Nixon', 'Garrett Winters']), (position:TEXT, examples=['0']), (office:TEXT, examples=['0', '1']), (age:INTEGER, examples=[61, 63]), (start_date:TEXT, examples=['2011-04-2...
e_commerce_sales_and_inventory_management_958357
Could you please identify the top-performing product in each category based on total sales, and also provide the average sales for each category? I need the category ID, category name, product name, total sales, and the average sales of the category.
WITH ProductSales AS ( SELECT p.product_id, p.product_name, p.category_id, SUM(o.sales) AS total_sales FROM orders o JOIN products p ON o.product_id = p.product_id GROUP BY p.product_id, p.product_name, p.category_id ), CategoryAvgSales AS ( SELECT p.cate...
synsql
【DB_ID】 e_commerce_sales_and_inventory_management_958357 # Table: orders [ (order_id:INTEGER, PK, examples=[0, 1]), (customer_id:INTEGER, examples=[1, 2]), (product_id:INTEGER, examples=[1]), (quantity:INTEGER, examples=[1, 3]), (sales:REAL, examples=[2.12, 2.97]), (discount:REAL, examples=[0.0]), (cost_o...
audio_filter_configuration_and_management
What are the names of the projects, and how do they compare in terms of the total number of configurations, the number of active configurations, the average frequency of configurations, and the number of distinct creators?
WITH TotalConfigs AS ( SELECT p.project_id, COUNT(fc.config_id) AS total_configs FROM projects p LEFT JOIN filter_configurations fc ON p.project_id = fc.project_id GROUP BY p.project_id ), ActiveConfigs AS ( SELECT p.project_id, COUNT(fc.config_id) AS active_configs...
synsql
- Active configurations are those where `is_active` is set to 1; - The frequency value represents how often a configuration is used; - Distinct creators are unique user IDs who have created at least one filter configuration.
【DB_ID】 audio_filter_configuration_and_management # Table: filters [ (filter_id:INTEGER, PK, examples=[0, 1]), (type:TEXT, examples=['lowpass', 'highpass']), (description:TEXT, examples=['Standard second-order resonant lowpass filter with 12dB/octave rolloff. Frequencies below the cutoff pass through; frequencies...
television_series_episode_cast_and_characters
Could you please provide the titles, average ratings, and total views for each episode, sorted by the episode titles in alphabetical order? I would like to know these details for analysis purposes.
SELECT e.episode_title, COALESCE(er.average_rating, 0) AS average_rating, COALESCE(COUNT(al.access_id), 0) AS total_views FROM episodes e LEFT JOIN episode_ratings er ON e.episode_id = er.episode_id LEFT JOIN access_logs al ON e.episode_id = al.episode_id AND al.access_type = 'view' GROUP BY...
synsql
【DB_ID】 television_series_episode_cast_and_characters # Table: tv_series [ (series_id:INTEGER, PK, examples=[0, 1]), (series_title:TEXT, examples=['Jericho', 'Supernatural']), (start_year:INTEGER, examples=[2006, 2005]), (end_year:INTEGER, examples=[2008, 2020]), (genre:TEXT, examples=['Science Fiction', 'Fan...
demographic_and_economic_data_for_us_counties_159057
Could you provide a list of counties where the percentage of high school graduates is over 80% and the validation score is greater than 90, including the county name, the percentage of high school graduates, the data sources used, the validation score, and the total population, and order the results by the percentage o...
WITH HighSchoolGraduates AS ( SELECT c.county_id, c.county_name, c.total_population, e.high_school_graduates FROM counties c JOIN education_data e ON c.county_id = e.county_id ), DataSources AS ( SELECT c.county_id, GROUP_CONCAT(s.source_name...
synsql
【DB_ID】 demographic_and_economic_data_for_us_counties_159057 # Table: counties [ (county_id:INTEGER, PK, examples=[0, 1]), (state:TEXT, examples=['Alabama']), (county_name:TEXT, examples=['Autauga County', 'Baldwin County']), (total_population:INTEGER, examples=[55036, 203360]), (men_population:INTEGER, examp...
financial_reporting_and_asset_management
**User**: I need to calculate some financial ratios for my company. **Assistant**: Sure, which financial ratios are you interested in? **User**: I want to calculate the current ratio. **Assistant**: To calculate the current ratio, we need to know the total current assets and total current liabilities. Do you have the d...
WITH CurrentAssets AS ( SELECT SUM( CASE WHEN a.is_current = 1 THEN i.amount ELSE 0 END ) AS total_current_assets FROM investment_details i INNER JOIN asset_types a ON i.investment_type = a.asset_type_name UNION ALL SELECT ...
synsql
【DB_ID】 financial_reporting_and_asset_management # Table: currencies [ (currency_id:INTEGER, PK, examples=[]), (currency_code:TEXT, examples=[]), (currency_name:TEXT, examples=[]), (exchange_rate:REAL, examples=[]), ] # Table: asset_types [ (asset_type_id:INTEGER, PK, examples=[]), (asset_type_name:TEXT, ex...
stock_market_data_and_analysis_293794
Which sectors, including the 'Energy' sector, have a cumulative total closing price of their stocks that exceeds the average cumulative total closing price across all sectors?
WITH StockTotalCloses AS ( SELECT s.stock_id, s.sector_id, SUM(sp.close) AS total_close FROM stocks s INNER JOIN stock_prices sp ON s.stock_id = sp.stock_id GROUP BY s.stock_id, s.sector_id ), SectorTotals AS ( SELECT s.sector_id, SUM(stc.total_close) AS cumul...
synsql
【DB_ID】 stock_market_data_and_analysis_293794 # Table: stocks [ (stock_id:INTEGER, PK, examples=[0, 1]), (stock_name:TEXT, examples=['KEX Stock', 'ABC Stock']), (stock_symbol:TEXT, examples=['KEX', 'ABC']), (exchange_id:INTEGER, examples=[1, 0]), (sector_id:INTEGER, examples=[0]), (industry_id:INTEGER, exam...
drone_control_and_telemetry_data_management
What are the drone IDs, models, and operational statuses of the top 10 active drones with the most flights, most completed flights, lowest maintenance costs, and highest average performance metrics, along with their total flights, completed flights, total maintenance activities, total maintenance costs, and average per...
WITH ActiveDrones AS ( SELECT d.drone_id, d.drone_model, d.operational_status, COUNT(f.flight_id) AS total_flights, COUNT(CASE WHEN f.status = 'completed' THEN f.flight_id ELSE NULL END) AS completed_flights FROM drones d LEFT JOIN flights f ON d.drone_id = f.drone_id...
synsql
【DB_ID】 drone_control_and_telemetry_data_management # Table: drones [ (drone_id:INTEGER, PK, examples=[0, 1]), (drone_model:TEXT, examples=['D1000']), (drone_serial_number:TEXT, examples=['D1000-001', 'D1000-002']), (fleet_id:INTEGER, examples=[1]), (calibration_status:INTEGER, examples=[1]), (last_calibrat...
network_packet_logging_and_analysis
Could you tell me which packet has the highest threshold value, and provide details including its direction, transmission protocol, transmission statistics (total transmissions, error count, average, maximum, and minimum response times), versioning information (version number and modified time), total packet size per d...
WITH MaxThresholdPacket AS ( SELECT packet_id FROM thresholds ORDER BY threshold_value DESC LIMIT 1 ), AggregatedValues AS ( SELECT p.direction, SUM(p.packet_size) AS total_size_per_direction, p.transmission_protocol, AVG(p.packet_size) AS avg_size_per_protocol ...
synsql
【DB_ID】 network_packet_logging_and_analysis # Table: packets [ (packet_id:INTEGER, PK, examples=[0, 1]), (timestamp:REAL, examples=[2.08898]), (address:TEXT, examples=['0', '1']), (data:TEXT, examples=['0', '1']), (direction:TEXT, examples=['1', '0']), (ack_status:TEXT, examples=['0']), (packet_size:INTEG...
machine_learning_model_performance_metrics_887470
What are the names of the datasets used by the top-performing models that have been most recently accessed?
WITH TopPerformingModels AS ( SELECT model_id, AVG(precision + recall + f1_score) / 3 AS average_performance FROM model_performance WHERE is_active = 1 GROUP BY model_id ORDER BY average_performance DESC LIMIT 10 ), RecentAccessLogs AS ( SELECT model_id, dat...
synsql
Top-performing models refer to those with high average precision, recall, and F1 scores; 'recently accessed' means the most recent access log for each model.
【DB_ID】 machine_learning_model_performance_metrics_887470 # Table: models [ (model_id:INTEGER, PK, examples=[0, 1]), (model_name:TEXT, examples=['Model 1', 'Model 2']), (model_type:TEXT, examples=['XGB', 'RF']), (description:TEXT, examples=['A sample XGB model', 'A sample RF model']), (created_at:TEXT, exampl...
weather_data_collection_and_analysis_540041
What is the landscape of active weather stations, including their names, locations, the count of anomalies detected, and the count of quality checks performed, all viewed through the lens of a seasoned meteorologist's eye?
-- Step 1: Identify active weather stations WITH ActiveStations AS ( SELECT station_id, station_name, location FROM weather_stations WHERE status = 'active' ), -- Step 2: Count anomalies per station AnomalyCounts AS ( SELECT data_id, COUNT(*) AS anomaly_count FROM data_anomalies GROUP BY data_i...
synsql
- 'Active weather stations' refers to stations with a status of 'active' in the `weather_stations` table. - 'Anomalies detected' refers to the number of anomalies recorded in the `data_anomalies` table. - 'Quality checks performed' refers to the number of quality checks recorded in the `data_quality` table. - 'Seasoned...
【DB_ID】 weather_data_collection_and_analysis_540041 # Table: weather_stations [ (station_id:INTEGER, PK, examples=[0]), (station_name:TEXT, examples=['Station A']), (location:TEXT, examples=['City X, Country Y']), (contact_email:TEXT, examples=['stationa@example.com']), (latitude:REAL, examples=[40.7128]), ...
environmental_monitoring_and_energy_consumption
I want to know the adjusted total energy consumption for January 11, 2016, taking into account the external weather conditions and indoor temperature and humidity, where the total energy consumption is adjusted based on the external temperature, and the results are ordered by date.
WITH ExternalWeatherConditions AS ( SELECT ew.date, ew.T_out, ew.weather_description, CASE WHEN ew.weather_description IN ('rain', 'thunderstorm') THEN ew.T_out + 1.5 ELSE ew.T_out END AS adjusted_T_out FROM external_weather ew WHERE...
synsql
【DB_ID】 environmental_monitoring_and_energy_consumption # Table: energy_consumption [ (id:INTEGER, PK, examples=[0, 1]), (date:TEXT, examples=['2016-01-11 17:00:00', '2016-01-11 17:10:00']), (appliances:INTEGER, examples=[60]), (lights:INTEGER, examples=[30]), (heating:INTEGER, examples=[10]), (cooling:INTE...
plant_physiology_and_environmental_monitoring
Hey, could you help me get a list of the latest sensor and plant readings from each location, along with how many times users of different roles have accessed the data? I need the sensor ID, location name, ambient temperature, and the access count, all sorted by the sensor ID.
WITH LatestSensorReadings AS ( SELECT sensor_id, MAX(timestamp) AS latest_timestamp FROM sensor_readings GROUP BY sensor_id ), LatestPlantReadings AS ( SELECT plant_id, MAX(timestamp) AS latest_timestamp FROM plant_readings GROUP BY plant_id ), SensorReadingsCom...
synsql
【DB_ID】 plant_physiology_and_environmental_monitoring # Table: sensors [ (sensor_id:INTEGER, PK, examples=[0, 1]), (sensor_type:TEXT, examples=['Temperature', 'Humidity']), (description:TEXT, examples=['Ambient temperature sensor', 'Ambient humidity sensor']), (location_id:INTEGER, examples=[0]), (installatio...
university_course_enrollment_and_management_939913
How many courses are listed under the realm of computer-related studies?
SELECT COUNT(c.course_id) FROM courses c INNER JOIN departments d ON c.department_id = d.department_id WHERE d.department_name = 'Computer Science';
synsql
'Realm of computer-related studies' refers to the department named 'Computer Science'. The count is based on unique course identifiers within this department.
【DB_ID】 university_course_enrollment_and_management_939913 # Table: courses [ (course_id:INTEGER, PK, examples=[0, 1]), (course_title:TEXT, examples=['AESTHINT 13', 'AESTHINT 16']), (course_name:TEXT, examples=['Cultural Agents', 'The Illuminated Manuscript']), (section_code:TEXT, examples=['001']), (departme...
genomic_experiment_management_and_analysis
**User**: I need to find out how many experiments have more than one sequence associated with them. **Assistant**: Sure, I can help with that. Do you want to know any additional details about these experiments, such as the user who created them or the experiment type? **User**: No, I just need the count of such experim...
SELECT COUNT(*) AS experiment_count FROM ( SELECT exp_id FROM experiment_sequence GROUP BY exp_id HAVING COUNT(seq_id) > 1 ) AS experiment_with_multiple_sequences;
synsql
【DB_ID】 genomic_experiment_management_and_analysis # Table: experiments [ (exp_id:INTEGER, PK, examples=[0, 1]), (user_id:TEXT, examples=['1', '0']), (description:TEXT, examples=['dominant feces, united states of america, black rhinoceros, diceros bicornis, captive, zoological garden', 'experiment description']),...
stock_market_data_and_analysis_795899
Return the portfolio ID, ticker symbol, total quantity, average purchase price, maximum market capitalization, access count, last access date, first access date, date, close price, and daily change percent for each portfolio holding, ordered by portfolio ID and access count in descending order.
WITH PortfolioHOLDINGS AS ( SELECT ph.portfolio_id, ph.ticker, SUM(ph.quantity) AS total_quantity, AVG(ph.purchase_price) AS avg_purchase_price, MAX(s.market_cap) AS max_market_cap FROM portfolio_holdings ph JOIN stocks s ON ph.ticker = s.ticker GROUP BY ph.portf...
synsql
【DB_ID】 stock_market_data_and_analysis_795899 # Table: stocks [ (ticker:TEXT, PK, examples=['0', '1']), (company_name:TEXT, examples=['International Consolidated Group', 'Apple Inc.']), (exchange:TEXT, examples=['NYSE', 'NASDAQ']), (sector:TEXT, examples=['Financial Services', 'Technology']), (industry:TEXT, ...
fantasy_role_playing_game_character_classes
What are the names of the character classes and their average base attack and defense values, along with the cumulative experience points rewarded by high-level quests?
WITH ClassStats AS ( SELECT cc.class_name, AVG(eq.base_attack) AS avg_base_attack, AVG(eq.base_defense) AS avg_base_defense FROM character_classes cc JOIN equipment eq ON cc.class_id = eq.class_id GROUP BY cc.class_name ), HighLevelQuests AS ( SELE...
synsql
High-level quests are considered those with an average required level greater than 20; Cumulative experience points refer to the running total of experience points rewarded as the classes are ordered alphabetically.
【DB_ID】 fantasy_role_playing_game_character_classes # Table: character_classes [ (class_id:INTEGER, PK, examples=[0, 1, 2]), (class_name:TEXT, examples=['None', 'Warrior', 'Wizard']), (description:TEXT, examples=['Default character class', 'A melee-focused character class', 'A magic-focused character class']), ...
project_funding_and_success_rate_analysis
Hey! Could you help me find out which projects have surpassed their success rate based on the funding they've received compared to their funding goal? I'd like to know the names and funding categories of these projects, and I want them sorted by funding category and then by project name.
WITH ProjectFundingStatus AS ( SELECT p.project_id, p.name, p.funding_goal, COALESCE(SUM(fd.amount), 0) AS total_funding, CASE WHEN p.funding_goal <= 1000 THEN 'Low' WHEN p.funding_goal <= 5000 THEN 'Medium' ELSE 'High' END AS fund...
synsql
【DB_ID】 project_funding_and_success_rate_analysis # Table: projects [ (project_id:INTEGER, PK, examples=[0, 1]), (goal_id:INTEGER, examples=[1]), (name:TEXT, examples=['Project 1', 'Project 2']), (description:TEXT, examples=['Description 1', 'Description 2']), (funding_goal:REAL, examples=[1000.0, 5000.0]), ...
educational_assessment_and_student_sentiment_analysis
Students in class 1, return their IDs and average positive feelings towards math, sorted from highest to lowest.
SELECT s.student_id, AVG(CASE WHEN r.math_feeling = ':)' THEN 1 ELSE 0 END) AS average_positive_feeling FROM students s JOIN responses r ON s.student_id = r.student_id WHERE s.class_id = 1 GROUP BY s.student_id ORDER BY average_positive_feeling DESC;
synsql
【DB_ID】 educational_assessment_and_student_sentiment_analysis # Table: students [ (student_id:INTEGER, PK, examples=[0, 1]), (first_name:TEXT, examples=['John', 'Jane']), (last_name:TEXT, examples=['Doe', 'Smith']), (class_id:INTEGER, examples=[0, 1]), (enrollment_date:TEXT, examples=['2018-01-10', '2018-01-1...
End of preview. Expand in Data Studio
README.md exists but content is empty.
Downloads last month
63