1sf/bird-sql-train-with-schema huggingface dataset:
Database: public_review_platform
Tables: Attributes, Categories, Compliments, Days, Years, Business_Attributes, Business_Categories, Business_Hours, Checkins, Elite, Reviews, Tips, Users_Compliments, Business, Users
Columns (table index, column name): -1, *, 0, attribute_id, 0, attribute_name, 1, category_id, 1, category_name, 2, compliment_id, 2, compliment_type, 3, day_id, 3, day_of_week, 4, year_id, 4, actual_year, 5, attribute_id, 5, business_id, 5, attribute_value, 6, business_id, 6, category_id, 7, business_id, 7, day_id, 7, opening_time, 7, closing_time, 8, business_id, 8, day_id, 8, label_time_0, 8, label_time_1, 8, label_time_2, 8, label_time_3, 8, label_time_4, 8, label_time_5, 8, label_time_6, 8, label_time_7, 8, label_time_8, 8, label_time_9, 8, label_time_10, 8, label_time_11, 8, label_time_12, 8, label_time_13, 8, label_time_14, 8, label_time_15, 8, label_time_16, 8, label_time_17, 8, label_time_18, 8, label_time_19, 8, label_time_20, 8, label_time_21, 8, label_time_22, 8, label_time_23, 9, user_id, 9, year_id, 10, business_id, 10, user_id, 10, review_stars, 10, review_votes_funny, 10, review_votes_useful, 10, review_votes_cool, 10, review_length, 11, business_id, 11, user_id, 11, likes, 11, tip_length, 12, compliment_id, 12, user_id, 12, number_of_compliments, 13, business_id, 13, active, 13, city, 13, state, 13, stars, 13, review_count, 14, user_id, 14, user_yelping_since_year, 14, user_average_stars, 14, user_votes_funny, 14, user_votes_useful, 14, user_votes_cool, 14, user_review_count, 14, user_fans
Question: What is the average number of review received by each business given that the user is an elite?
Evidence: average review = Divide(Count(user_id), Count(business_id))
SQL: SELECT CAST(COUNT(T1.user_id) AS REAL) / COUNT(DISTINCT T1.business_id) FROM Reviews AS T1 INNER JOIN Elite AS T2 ON T1.user_id = T2.user_id
Database: public_review_platform
Tables: Attributes, Categories, Compliments, Days, Years, Business_Attributes, Business_Categories, Business_Hours, Checkins, Elite, Reviews, Tips, Users_Compliments, Business, Users
Columns (table index, column name): -1, *, 0, attribute_id, 0, attribute_name, 1, category_id, 1, category_name, 2, compliment_id, 2, compliment_type, 3, day_id, 3, day_of_week, 4, year_id, 4, actual_year, 5, attribute_id, 5, business_id, 5, attribute_value, 6, business_id, 6, category_id, 7, business_id, 7, day_id, 7, opening_time, 7, closing_time, 8, business_id, 8, day_id, 8, label_time_0, 8, label_time_1, 8, label_time_2, 8, label_time_3, 8, label_time_4, 8, label_time_5, 8, label_time_6, 8, label_time_7, 8, label_time_8, 8, label_time_9, 8, label_time_10, 8, label_time_11, 8, label_time_12, 8, label_time_13, 8, label_time_14, 8, label_time_15, 8, label_time_16, 8, label_time_17, 8, label_time_18, 8, label_time_19, 8, label_time_20, 8, label_time_21, 8, label_time_22, 8, label_time_23, 9, user_id, 9, year_id, 10, business_id, 10, user_id, 10, review_stars, 10, review_votes_funny, 10, review_votes_useful, 10, review_votes_cool, 10, review_length, 11, business_id, 11, user_id, 11, likes, 11, tip_length, 12, compliment_id, 12, user_id, 12, number_of_compliments, 13, business_id, 13, active, 13, city, 13, state, 13, stars, 13, review_count, 14, user_id, 14, user_yelping_since_year, 14, user_average_stars, 14, user_votes_funny, 14, user_votes_useful, 14, user_votes_cool, 14, user_review_count, 14, user_fans
Question: List out the user who is an elite user for consecutively 5 years or more and what is the user average star? How many likes does this user gets?
Evidence: elite user for consecutively 5 years or more refers to user_id COUNT(year_id) > 5; Average star = AVG(likes)
SQL: SELECT T2.user_average_stars, COUNT(T3.likes) FROM Elite AS T1 INNER JOIN Users AS T2 ON T1.user_id = T2.user_id INNER JOIN Tips AS T3 ON T3.user_id = T2.user_id GROUP BY T1.user_id HAVING COUNT(T1.user_id) > 5
Database: public_review_platform
Tables: Attributes, Categories, Compliments, Days, Years, Business_Attributes, Business_Categories, Business_Hours, Checkins, Elite, Reviews, Tips, Users_Compliments, Business, Users
Columns (table index, column name): -1, *, 0, attribute_id, 0, attribute_name, 1, category_id, 1, category_name, 2, compliment_id, 2, compliment_type, 3, day_id, 3, day_of_week, 4, year_id, 4, actual_year, 5, attribute_id, 5, business_id, 5, attribute_value, 6, business_id, 6, category_id, 7, business_id, 7, day_id, 7, opening_time, 7, closing_time, 8, business_id, 8, day_id, 8, label_time_0, 8, label_time_1, 8, label_time_2, 8, label_time_3, 8, label_time_4, 8, label_time_5, 8, label_time_6, 8, label_time_7, 8, label_time_8, 8, label_time_9, 8, label_time_10, 8, label_time_11, 8, label_time_12, 8, label_time_13, 8, label_time_14, 8, label_time_15, 8, label_time_16, 8, label_time_17, 8, label_time_18, 8, label_time_19, 8, label_time_20, 8, label_time_21, 8, label_time_22, 8, label_time_23, 9, user_id, 9, year_id, 10, business_id, 10, user_id, 10, review_stars, 10, review_votes_funny, 10, review_votes_useful, 10, review_votes_cool, 10, review_length, 11, business_id, 11, user_id, 11, likes, 11, tip_length, 12, compliment_id, 12, user_id, 12, number_of_compliments, 13, business_id, 13, active, 13, city, 13, state, 13, stars, 13, review_count, 14, user_id, 14, user_yelping_since_year, 14, user_average_stars, 14, user_votes_funny, 14, user_votes_useful, 14, user_votes_cool, 14, user_review_count, 14, user_fans
Question: Find out which hotel and travel business having the most review? Calculate the standard deviation of the review star for this business.
Evidence: "Hotel & Travel" is the category_name; most review refers to Max(Count(category_id)); Average star per user = Divide (Sum (review_stars), Count(user_id))
SQL: SELECT T2.category_id FROM Business_Categories AS T1 INNER JOIN Categories AS T2 ON T1.category_id = T2.category_id INNER JOIN Reviews AS T3 ON T3.business_id = T1.business_id WHERE T2.category_name = 'Hotels & Travel' GROUP BY T2.category_id ORDER BY COUNT(T2.category_id) DESC LIMIT 1
Database: public_review_platform
Tables: Attributes, Categories, Compliments, Days, Years, Business_Attributes, Business_Categories, Business_Hours, Checkins, Elite, Reviews, Tips, Users_Compliments, Business, Users
Columns (table index, column name): -1, *, 0, attribute_id, 0, attribute_name, 1, category_id, 1, category_name, 2, compliment_id, 2, compliment_type, 3, day_id, 3, day_of_week, 4, year_id, 4, actual_year, 5, attribute_id, 5, business_id, 5, attribute_value, 6, business_id, 6, category_id, 7, business_id, 7, day_id, 7, opening_time, 7, closing_time, 8, business_id, 8, day_id, 8, label_time_0, 8, label_time_1, 8, label_time_2, 8, label_time_3, 8, label_time_4, 8, label_time_5, 8, label_time_6, 8, label_time_7, 8, label_time_8, 8, label_time_9, 8, label_time_10, 8, label_time_11, 8, label_time_12, 8, label_time_13, 8, label_time_14, 8, label_time_15, 8, label_time_16, 8, label_time_17, 8, label_time_18, 8, label_time_19, 8, label_time_20, 8, label_time_21, 8, label_time_22, 8, label_time_23, 9, user_id, 9, year_id, 10, business_id, 10, user_id, 10, review_stars, 10, review_votes_funny, 10, review_votes_useful, 10, review_votes_cool, 10, review_length, 11, business_id, 11, user_id, 11, likes, 11, tip_length, 12, compliment_id, 12, user_id, 12, number_of_compliments, 13, business_id, 13, active, 13, city, 13, state, 13, stars, 13, review_count, 14, user_id, 14, user_yelping_since_year, 14, user_average_stars, 14, user_votes_funny, 14, user_votes_useful, 14, user_votes_cool, 14, user_review_count, 14, user_fans
Question: What is the correlation between the review starts and business stars?
Evidence: highest review count refers to review_count = 'Uber'; average business review stars = Divide (Sum(review_stars), Count(user_id))
SQL: SELECT CAST(SUM(T2.review_stars) AS REAL) / COUNT(T1.business_id) FROM Business AS T1 INNER JOIN Reviews AS T2 ON T1.business_id = T2.business_id
Database: public_review_platform
Tables: Attributes, Categories, Compliments, Days, Years, Business_Attributes, Business_Categories, Business_Hours, Checkins, Elite, Reviews, Tips, Users_Compliments, Business, Users
Columns (table index, column name): -1, *, 0, attribute_id, 0, attribute_name, 1, category_id, 1, category_name, 2, compliment_id, 2, compliment_type, 3, day_id, 3, day_of_week, 4, year_id, 4, actual_year, 5, attribute_id, 5, business_id, 5, attribute_value, 6, business_id, 6, category_id, 7, business_id, 7, day_id, 7, opening_time, 7, closing_time, 8, business_id, 8, day_id, 8, label_time_0, 8, label_time_1, 8, label_time_2, 8, label_time_3, 8, label_time_4, 8, label_time_5, 8, label_time_6, 8, label_time_7, 8, label_time_8, 8, label_time_9, 8, label_time_10, 8, label_time_11, 8, label_time_12, 8, label_time_13, 8, label_time_14, 8, label_time_15, 8, label_time_16, 8, label_time_17, 8, label_time_18, 8, label_time_19, 8, label_time_20, 8, label_time_21, 8, label_time_22, 8, label_time_23, 9, user_id, 9, year_id, 10, business_id, 10, user_id, 10, review_stars, 10, review_votes_funny, 10, review_votes_useful, 10, review_votes_cool, 10, review_length, 11, business_id, 11, user_id, 11, likes, 11, tip_length, 12, compliment_id, 12, user_id, 12, number_of_compliments, 13, business_id, 13, active, 13, city, 13, state, 13, stars, 13, review_count, 14, user_id, 14, user_yelping_since_year, 14, user_average_stars, 14, user_votes_funny, 14, user_votes_useful, 14, user_votes_cool, 14, user_review_count, 14, user_fans
Question: How many of the businesses are active?
Evidence: active refers to active = 'true'
SQL: SELECT COUNT(business_id) FROM Business WHERE active LIKE 'True'
Database: public_review_platform
Tables: Attributes, Categories, Compliments, Days, Years, Business_Attributes, Business_Categories, Business_Hours, Checkins, Elite, Reviews, Tips, Users_Compliments, Business, Users
Columns (table index, column name): -1, *, 0, attribute_id, 0, attribute_name, 1, category_id, 1, category_name, 2, compliment_id, 2, compliment_type, 3, day_id, 3, day_of_week, 4, year_id, 4, actual_year, 5, attribute_id, 5, business_id, 5, attribute_value, 6, business_id, 6, category_id, 7, business_id, 7, day_id, 7, opening_time, 7, closing_time, 8, business_id, 8, day_id, 8, label_time_0, 8, label_time_1, 8, label_time_2, 8, label_time_3, 8, label_time_4, 8, label_time_5, 8, label_time_6, 8, label_time_7, 8, label_time_8, 8, label_time_9, 8, label_time_10, 8, label_time_11, 8, label_time_12, 8, label_time_13, 8, label_time_14, 8, label_time_15, 8, label_time_16, 8, label_time_17, 8, label_time_18, 8, label_time_19, 8, label_time_20, 8, label_time_21, 8, label_time_22, 8, label_time_23, 9, user_id, 9, year_id, 10, business_id, 10, user_id, 10, review_stars, 10, review_votes_funny, 10, review_votes_useful, 10, review_votes_cool, 10, review_length, 11, business_id, 11, user_id, 11, likes, 11, tip_length, 12, compliment_id, 12, user_id, 12, number_of_compliments, 13, business_id, 13, active, 13, city, 13, state, 13, stars, 13, review_count, 14, user_id, 14, user_yelping_since_year, 14, user_average_stars, 14, user_votes_funny, 14, user_votes_useful, 14, user_votes_cool, 14, user_review_count, 14, user_fans
Question: List down the business ID with a low review count in Phoenix.
Evidence: "Phoenix" is the city; low review count refers to review_count = 'Low'
SQL: SELECT business_id FROM Business WHERE city LIKE 'Phoenix' AND review_count LIKE 'Low'
Database: public_review_platform
Tables: Attributes, Categories, Compliments, Days, Years, Business_Attributes, Business_Categories, Business_Hours, Checkins, Elite, Reviews, Tips, Users_Compliments, Business, Users
Columns (table index, column name): -1, *, 0, attribute_id, 0, attribute_name, 1, category_id, 1, category_name, 2, compliment_id, 2, compliment_type, 3, day_id, 3, day_of_week, 4, year_id, 4, actual_year, 5, attribute_id, 5, business_id, 5, attribute_value, 6, business_id, 6, category_id, 7, business_id, 7, day_id, 7, opening_time, 7, closing_time, 8, business_id, 8, day_id, 8, label_time_0, 8, label_time_1, 8, label_time_2, 8, label_time_3, 8, label_time_4, 8, label_time_5, 8, label_time_6, 8, label_time_7, 8, label_time_8, 8, label_time_9, 8, label_time_10, 8, label_time_11, 8, label_time_12, 8, label_time_13, 8, label_time_14, 8, label_time_15, 8, label_time_16, 8, label_time_17, 8, label_time_18, 8, label_time_19, 8, label_time_20, 8, label_time_21, 8, label_time_22, 8, label_time_23, 9, user_id, 9, year_id, 10, business_id, 10, user_id, 10, review_stars, 10, review_votes_funny, 10, review_votes_useful, 10, review_votes_cool, 10, review_length, 11, business_id, 11, user_id, 11, likes, 11, tip_length, 12, compliment_id, 12, user_id, 12, number_of_compliments, 13, business_id, 13, active, 13, city, 13, state, 13, stars, 13, review_count, 14, user_id, 14, user_yelping_since_year, 14, user_average_stars, 14, user_votes_funny, 14, user_votes_useful, 14, user_votes_cool, 14, user_review_count, 14, user_fans
Question: What is the total number of active business in AZ with a high review count?
Evidence: active business refers to active = 'true'; 'AZ' is the state; high review count refers to review_count = 'High'
SQL: SELECT COUNT(business_id) FROM Business WHERE state LIKE 'AZ' AND review_count LIKE 'High' AND active LIKE 'True'
Database: public_review_platform
Tables: Attributes, Categories, Compliments, Days, Years, Business_Attributes, Business_Categories, Business_Hours, Checkins, Elite, Reviews, Tips, Users_Compliments, Business, Users
Columns (table index, column name): -1, *, 0, attribute_id, 0, attribute_name, 1, category_id, 1, category_name, 2, compliment_id, 2, compliment_type, 3, day_id, 3, day_of_week, 4, year_id, 4, actual_year, 5, attribute_id, 5, business_id, 5, attribute_value, 6, business_id, 6, category_id, 7, business_id, 7, day_id, 7, opening_time, 7, closing_time, 8, business_id, 8, day_id, 8, label_time_0, 8, label_time_1, 8, label_time_2, 8, label_time_3, 8, label_time_4, 8, label_time_5, 8, label_time_6, 8, label_time_7, 8, label_time_8, 8, label_time_9, 8, label_time_10, 8, label_time_11, 8, label_time_12, 8, label_time_13, 8, label_time_14, 8, label_time_15, 8, label_time_16, 8, label_time_17, 8, label_time_18, 8, label_time_19, 8, label_time_20, 8, label_time_21, 8, label_time_22, 8, label_time_23, 9, user_id, 9, year_id, 10, business_id, 10, user_id, 10, review_stars, 10, review_votes_funny, 10, review_votes_useful, 10, review_votes_cool, 10, review_length, 11, business_id, 11, user_id, 11, likes, 11, tip_length, 12, compliment_id, 12, user_id, 12, number_of_compliments, 13, business_id, 13, active, 13, city, 13, state, 13, stars, 13, review_count, 14, user_id, 14, user_yelping_since_year, 14, user_average_stars, 14, user_votes_funny, 14, user_votes_useful, 14, user_votes_cool, 14, user_review_count, 14, user_fans
Question: List down the business ID with a star range from 3 to 4, located at Tempe.
Evidence: star range from 3 to 4 refers to stars > = 3 AND stars < 5; 'Tempe' is the name of city
SQL: SELECT business_id FROM Business WHERE city LIKE 'Tempe' AND stars BETWEEN 3 AND 4
Database: public_review_platform
Tables: Attributes, Categories, Compliments, Days, Years, Business_Attributes, Business_Categories, Business_Hours, Checkins, Elite, Reviews, Tips, Users_Compliments, Business, Users
Columns (table index, column name): -1, *, 0, attribute_id, 0, attribute_name, 1, category_id, 1, category_name, 2, compliment_id, 2, compliment_type, 3, day_id, 3, day_of_week, 4, year_id, 4, actual_year, 5, attribute_id, 5, business_id, 5, attribute_value, 6, business_id, 6, category_id, 7, business_id, 7, day_id, 7, opening_time, 7, closing_time, 8, business_id, 8, day_id, 8, label_time_0, 8, label_time_1, 8, label_time_2, 8, label_time_3, 8, label_time_4, 8, label_time_5, 8, label_time_6, 8, label_time_7, 8, label_time_8, 8, label_time_9, 8, label_time_10, 8, label_time_11, 8, label_time_12, 8, label_time_13, 8, label_time_14, 8, label_time_15, 8, label_time_16, 8, label_time_17, 8, label_time_18, 8, label_time_19, 8, label_time_20, 8, label_time_21, 8, label_time_22, 8, label_time_23, 9, user_id, 9, year_id, 10, business_id, 10, user_id, 10, review_stars, 10, review_votes_funny, 10, review_votes_useful, 10, review_votes_cool, 10, review_length, 11, business_id, 11, user_id, 11, likes, 11, tip_length, 12, compliment_id, 12, user_id, 12, number_of_compliments, 13, business_id, 13, active, 13, city, 13, state, 13, stars, 13, review_count, 14, user_id, 14, user_yelping_since_year, 14, user_average_stars, 14, user_votes_funny, 14, user_votes_useful, 14, user_votes_cool, 14, user_review_count, 14, user_fans
Question: In users yelping since 2010 to 2012, how many of them has an low fans?
Evidence: user yelping since 2010 to 2012 refers to user_yelping_since_year > = '2010' AND user_yelping_since_year < '2013'; low fans refers to user_fans = 'Low'
SQL: SELECT COUNT(user_id) FROM Users WHERE user_yelping_since_year BETWEEN 2010 AND 2012 AND user_fans LIKE 'Low'
Database: public_review_platform
Tables: Attributes, Categories, Compliments, Days, Years, Business_Attributes, Business_Categories, Business_Hours, Checkins, Elite, Reviews, Tips, Users_Compliments, Business, Users
Columns (table index, column name): -1, *, 0, attribute_id, 0, attribute_name, 1, category_id, 1, category_name, 2, compliment_id, 2, compliment_type, 3, day_id, 3, day_of_week, 4, year_id, 4, actual_year, 5, attribute_id, 5, business_id, 5, attribute_value, 6, business_id, 6, category_id, 7, business_id, 7, day_id, 7, opening_time, 7, closing_time, 8, business_id, 8, day_id, 8, label_time_0, 8, label_time_1, 8, label_time_2, 8, label_time_3, 8, label_time_4, 8, label_time_5, 8, label_time_6, 8, label_time_7, 8, label_time_8, 8, label_time_9, 8, label_time_10, 8, label_time_11, 8, label_time_12, 8, label_time_13, 8, label_time_14, 8, label_time_15, 8, label_time_16, 8, label_time_17, 8, label_time_18, 8, label_time_19, 8, label_time_20, 8, label_time_21, 8, label_time_22, 8, label_time_23, 9, user_id, 9, year_id, 10, business_id, 10, user_id, 10, review_stars, 10, review_votes_funny, 10, review_votes_useful, 10, review_votes_cool, 10, review_length, 11, business_id, 11, user_id, 11, likes, 11, tip_length, 12, compliment_id, 12, user_id, 12, number_of_compliments, 13, business_id, 13, active, 13, city, 13, state, 13, stars, 13, review_count, 14, user_id, 14, user_yelping_since_year, 14, user_average_stars, 14, user_votes_funny, 14, user_votes_useful, 14, user_votes_cool, 14, user_review_count, 14, user_fans
Question: What is the review length of user 60776 to business with business ID 1?
Evidence: "60776" is the user_id
SQL: SELECT review_length FROM Reviews WHERE user_id = 60776 AND business_id = 1
Database: public_review_platform
Tables: Attributes, Categories, Compliments, Days, Years, Business_Attributes, Business_Categories, Business_Hours, Checkins, Elite, Reviews, Tips, Users_Compliments, Business, Users
Columns (table index, column name): -1, *, 0, attribute_id, 0, attribute_name, 1, category_id, 1, category_name, 2, compliment_id, 2, compliment_type, 3, day_id, 3, day_of_week, 4, year_id, 4, actual_year, 5, attribute_id, 5, business_id, 5, attribute_value, 6, business_id, 6, category_id, 7, business_id, 7, day_id, 7, opening_time, 7, closing_time, 8, business_id, 8, day_id, 8, label_time_0, 8, label_time_1, 8, label_time_2, 8, label_time_3, 8, label_time_4, 8, label_time_5, 8, label_time_6, 8, label_time_7, 8, label_time_8, 8, label_time_9, 8, label_time_10, 8, label_time_11, 8, label_time_12, 8, label_time_13, 8, label_time_14, 8, label_time_15, 8, label_time_16, 8, label_time_17, 8, label_time_18, 8, label_time_19, 8, label_time_20, 8, label_time_21, 8, label_time_22, 8, label_time_23, 9, user_id, 9, year_id, 10, business_id, 10, user_id, 10, review_stars, 10, review_votes_funny, 10, review_votes_useful, 10, review_votes_cool, 10, review_length, 11, business_id, 11, user_id, 11, likes, 11, tip_length, 12, compliment_id, 12, user_id, 12, number_of_compliments, 13, business_id, 13, active, 13, city, 13, state, 13, stars, 13, review_count, 14, user_id, 14, user_yelping_since_year, 14, user_average_stars, 14, user_votes_funny, 14, user_votes_useful, 14, user_votes_cool, 14, user_review_count, 14, user_fans
Question: Among the businesses in Scottsdale, list the attribute of the business with a high review count.
Evidence: "Scottsdale" is the name of city; high review count refers to review_count = 'High'; attribute of the business refers to attribute_name
SQL: SELECT T3.attribute_name FROM Business AS T1 INNER JOIN Business_Attributes AS T2 ON T1.business_id = T2.business_id INNER JOIN Attributes AS T3 ON T2.attribute_id = T3.attribute_id WHERE T1.review_count LIKE 'High' AND T1.city LIKE 'Scottsdale' GROUP BY T3.attribute_name
Database: public_review_platform
Tables: Attributes, Categories, Compliments, Days, Years, Business_Attributes, Business_Categories, Business_Hours, Checkins, Elite, Reviews, Tips, Users_Compliments, Business, Users
Columns (table index, column name): -1, *, 0, attribute_id, 0, attribute_name, 1, category_id, 1, category_name, 2, compliment_id, 2, compliment_type, 3, day_id, 3, day_of_week, 4, year_id, 4, actual_year, 5, attribute_id, 5, business_id, 5, attribute_value, 6, business_id, 6, category_id, 7, business_id, 7, day_id, 7, opening_time, 7, closing_time, 8, business_id, 8, day_id, 8, label_time_0, 8, label_time_1, 8, label_time_2, 8, label_time_3, 8, label_time_4, 8, label_time_5, 8, label_time_6, 8, label_time_7, 8, label_time_8, 8, label_time_9, 8, label_time_10, 8, label_time_11, 8, label_time_12, 8, label_time_13, 8, label_time_14, 8, label_time_15, 8, label_time_16, 8, label_time_17, 8, label_time_18, 8, label_time_19, 8, label_time_20, 8, label_time_21, 8, label_time_22, 8, label_time_23, 9, user_id, 9, year_id, 10, business_id, 10, user_id, 10, review_stars, 10, review_votes_funny, 10, review_votes_useful, 10, review_votes_cool, 10, review_length, 11, business_id, 11, user_id, 11, likes, 11, tip_length, 12, compliment_id, 12, user_id, 12, number_of_compliments, 13, business_id, 13, active, 13, city, 13, state, 13, stars, 13, review_count, 14, user_id, 14, user_yelping_since_year, 14, user_average_stars, 14, user_votes_funny, 14, user_votes_useful, 14, user_votes_cool, 14, user_review_count, 14, user_fans
Question: In businesses with a category of automotive, how many of them has an star rating below 3?
Evidence: "Automotive" is the category of business; star rating below 3 refers to stars < 3
SQL: SELECT COUNT(T1.business_id) FROM Business AS T1 INNER JOIN Business_Categories ON T1.business_id = Business_Categories.business_id INNER JOIN Categories AS T3 ON Business_Categories.category_id = T3.category_id WHERE T3.category_name LIKE 'Automotive' AND T1.stars < 3