db_name
stringclasses 146
values | prompt
stringlengths 310
4.81k
|
|---|---|
entertainment_awards
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# festival_detail ( Festival_ID, Festival_Name, Chair_Name, Location, Year, Num_of_Audience )
# artwork ( Artwork_ID, Type, Name )
# nomination ( Artwork_ID, Festival_ID, Result )
#
# nomination.Festival_ID can be joined with festival_detail.Festival_ID
# nomination.Artwork_ID can be joined with artwork.Artwork_ID
#
### Question:
#
# List the name of artworks whose type is not "Program Talent Show".
#
### SQL:
#
# SELECT Name FROM artwork WHERE TYPE != "Program Talent Show"
#
### End.
|
entertainment_awards
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# festival_detail ( Festival_ID, Festival_Name, Chair_Name, Location, Year, Num_of_Audience )
# artwork ( Artwork_ID, Type, Name )
# nomination ( Artwork_ID, Festival_ID, Result )
#
# nomination.Festival_ID can be joined with festival_detail.Festival_ID
# nomination.Artwork_ID can be joined with artwork.Artwork_ID
#
### Question:
#
# What are the names and locations of festivals?
#
### SQL:
#
# SELECT Festival_Name , LOCATION FROM festival_detail
#
### End.
|
entertainment_awards
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# festival_detail ( Festival_ID, Festival_Name, Chair_Name, Location, Year, Num_of_Audience )
# artwork ( Artwork_ID, Type, Name )
# nomination ( Artwork_ID, Festival_ID, Result )
#
# nomination.Festival_ID can be joined with festival_detail.Festival_ID
# nomination.Artwork_ID can be joined with artwork.Artwork_ID
#
### Question:
#
# What are the names of the chairs of festivals, sorted in ascending order of the year held?
#
### SQL:
#
# SELECT Chair_Name FROM festival_detail ORDER BY YEAR ASC
#
### End.
|
entertainment_awards
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# festival_detail ( Festival_ID, Festival_Name, Chair_Name, Location, Year, Num_of_Audience )
# artwork ( Artwork_ID, Type, Name )
# nomination ( Artwork_ID, Festival_ID, Result )
#
# nomination.Festival_ID can be joined with festival_detail.Festival_ID
# nomination.Artwork_ID can be joined with artwork.Artwork_ID
#
### Question:
#
# What is the location of the festival with the largest number of audience?
#
### SQL:
#
# SELECT LOCATION FROM festival_detail ORDER BY Num_of_Audience DESC LIMIT 1
#
### End.
|
entertainment_awards
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# festival_detail ( Festival_ID, Festival_Name, Chair_Name, Location, Year, Num_of_Audience )
# artwork ( Artwork_ID, Type, Name )
# nomination ( Artwork_ID, Festival_ID, Result )
#
# nomination.Festival_ID can be joined with festival_detail.Festival_ID
# nomination.Artwork_ID can be joined with artwork.Artwork_ID
#
### Question:
#
# What are the names of festivals held in year 2007?
#
### SQL:
#
# SELECT Festival_Name FROM festival_detail WHERE YEAR = 2007
#
### End.
|
entertainment_awards
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# festival_detail ( Festival_ID, Festival_Name, Chair_Name, Location, Year, Num_of_Audience )
# artwork ( Artwork_ID, Type, Name )
# nomination ( Artwork_ID, Festival_ID, Result )
#
# nomination.Festival_ID can be joined with festival_detail.Festival_ID
# nomination.Artwork_ID can be joined with artwork.Artwork_ID
#
### Question:
#
# What is the average number of audience for festivals?
#
### SQL:
#
# SELECT avg(Num_of_Audience) FROM festival_detail
#
### End.
|
entertainment_awards
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# festival_detail ( Festival_ID, Festival_Name, Chair_Name, Location, Year, Num_of_Audience )
# artwork ( Artwork_ID, Type, Name )
# nomination ( Artwork_ID, Festival_ID, Result )
#
# nomination.Festival_ID can be joined with festival_detail.Festival_ID
# nomination.Artwork_ID can be joined with artwork.Artwork_ID
#
### Question:
#
# Show the names of the three most recent festivals.
#
### SQL:
#
# SELECT Festival_Name FROM festival_detail ORDER BY YEAR DESC LIMIT 3
#
### End.
|
entertainment_awards
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# festival_detail ( Festival_ID, Festival_Name, Chair_Name, Location, Year, Num_of_Audience )
# artwork ( Artwork_ID, Type, Name )
# nomination ( Artwork_ID, Festival_ID, Result )
#
# nomination.Festival_ID can be joined with festival_detail.Festival_ID
# nomination.Artwork_ID can be joined with artwork.Artwork_ID
#
### Question:
#
# For each nomination, show the name of the artwork and name of the festival where it is nominated.
#
### SQL:
#
# SELECT T2.Name , T3.Festival_Name FROM nomination AS T1 JOIN artwork AS T2 ON T1.Artwork_ID = T2.Artwork_ID JOIN festival_detail AS T3 ON T1.Festival_ID = T3.Festival_ID
#
### End.
|
entertainment_awards
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# festival_detail ( Festival_ID, Festival_Name, Chair_Name, Location, Year, Num_of_Audience )
# artwork ( Artwork_ID, Type, Name )
# nomination ( Artwork_ID, Festival_ID, Result )
#
# nomination.Festival_ID can be joined with festival_detail.Festival_ID
# nomination.Artwork_ID can be joined with artwork.Artwork_ID
#
### Question:
#
# Show distinct types of artworks that are nominated in festivals in 2007.
#
### SQL:
#
# SELECT DISTINCT T2.Type FROM nomination AS T1 JOIN artwork AS T2 ON T1.Artwork_ID = T2.Artwork_ID JOIN festival_detail AS T3 ON T1.Festival_ID = T3.Festival_ID WHERE T3.Year = 2007
#
### End.
|
entertainment_awards
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# festival_detail ( Festival_ID, Festival_Name, Chair_Name, Location, Year, Num_of_Audience )
# artwork ( Artwork_ID, Type, Name )
# nomination ( Artwork_ID, Festival_ID, Result )
#
# nomination.Festival_ID can be joined with festival_detail.Festival_ID
# nomination.Artwork_ID can be joined with artwork.Artwork_ID
#
### Question:
#
# Show the names of artworks in ascending order of the year they are nominated in.
#
### SQL:
#
# SELECT T2.Name FROM nomination AS T1 JOIN artwork AS T2 ON T1.Artwork_ID = T2.Artwork_ID JOIN festival_detail AS T3 ON T1.Festival_ID = T3.Festival_ID ORDER BY T3.Year
#
### End.
|
entertainment_awards
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# festival_detail ( Festival_ID, Festival_Name, Chair_Name, Location, Year, Num_of_Audience )
# artwork ( Artwork_ID, Type, Name )
# nomination ( Artwork_ID, Festival_ID, Result )
#
# nomination.Festival_ID can be joined with festival_detail.Festival_ID
# nomination.Artwork_ID can be joined with artwork.Artwork_ID
#
### Question:
#
# Show the names of festivals that have nominated artworks of type "Program Talent Show".
#
### SQL:
#
# SELECT T3.Festival_Name FROM nomination AS T1 JOIN artwork AS T2 ON T1.Artwork_ID = T2.Artwork_ID JOIN festival_detail AS T3 ON T1.Festival_ID = T3.Festival_ID WHERE T2.Type = "Program Talent Show"
#
### End.
|
entertainment_awards
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# festival_detail ( Festival_ID, Festival_Name, Chair_Name, Location, Year, Num_of_Audience )
# artwork ( Artwork_ID, Type, Name )
# nomination ( Artwork_ID, Festival_ID, Result )
#
# nomination.Festival_ID can be joined with festival_detail.Festival_ID
# nomination.Artwork_ID can be joined with artwork.Artwork_ID
#
### Question:
#
# Show the ids and names of festivals that have at least two nominations for artworks.
#
### SQL:
#
# SELECT T1.Festival_ID , T3.Festival_Name FROM nomination AS T1 JOIN artwork AS T2 ON T1.Artwork_ID = T2.Artwork_ID JOIN festival_detail AS T3 ON T1.Festival_ID = T3.Festival_ID GROUP BY T1.Festival_ID HAVING COUNT(*) >= 2
#
### End.
|
entertainment_awards
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# festival_detail ( Festival_ID, Festival_Name, Chair_Name, Location, Year, Num_of_Audience )
# artwork ( Artwork_ID, Type, Name )
# nomination ( Artwork_ID, Festival_ID, Result )
#
# nomination.Festival_ID can be joined with festival_detail.Festival_ID
# nomination.Artwork_ID can be joined with artwork.Artwork_ID
#
### Question:
#
# Show the id, name of each festival and the number of artworks it has nominated.
#
### SQL:
#
# SELECT T1.Festival_ID , T3.Festival_Name , COUNT(*) FROM nomination AS T1 JOIN artwork AS T2 ON T1.Artwork_ID = T2.Artwork_ID JOIN festival_detail AS T3 ON T1.Festival_ID = T3.Festival_ID GROUP BY T1.Festival_ID
#
### End.
|
entertainment_awards
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# festival_detail ( Festival_ID, Festival_Name, Chair_Name, Location, Year, Num_of_Audience )
# artwork ( Artwork_ID, Type, Name )
# nomination ( Artwork_ID, Festival_ID, Result )
#
# nomination.Festival_ID can be joined with festival_detail.Festival_ID
# nomination.Artwork_ID can be joined with artwork.Artwork_ID
#
### Question:
#
# Please show different types of artworks with the corresponding number of artworks of each type.
#
### SQL:
#
# SELECT TYPE , COUNT(*) FROM artwork GROUP BY TYPE
#
### End.
|
entertainment_awards
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# festival_detail ( Festival_ID, Festival_Name, Chair_Name, Location, Year, Num_of_Audience )
# artwork ( Artwork_ID, Type, Name )
# nomination ( Artwork_ID, Festival_ID, Result )
#
# nomination.Festival_ID can be joined with festival_detail.Festival_ID
# nomination.Artwork_ID can be joined with artwork.Artwork_ID
#
### Question:
#
# List the most common type of artworks.
#
### SQL:
#
# SELECT TYPE FROM artwork GROUP BY TYPE ORDER BY COUNT(*) DESC LIMIT 1
#
### End.
|
entertainment_awards
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# festival_detail ( Festival_ID, Festival_Name, Chair_Name, Location, Year, Num_of_Audience )
# artwork ( Artwork_ID, Type, Name )
# nomination ( Artwork_ID, Festival_ID, Result )
#
# nomination.Festival_ID can be joined with festival_detail.Festival_ID
# nomination.Artwork_ID can be joined with artwork.Artwork_ID
#
### Question:
#
# List the year in which there are more than one festivals.
#
### SQL:
#
# SELECT YEAR FROM festival_detail GROUP BY YEAR HAVING COUNT(*) > 1
#
### End.
|
entertainment_awards
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# festival_detail ( Festival_ID, Festival_Name, Chair_Name, Location, Year, Num_of_Audience )
# artwork ( Artwork_ID, Type, Name )
# nomination ( Artwork_ID, Festival_ID, Result )
#
# nomination.Festival_ID can be joined with festival_detail.Festival_ID
# nomination.Artwork_ID can be joined with artwork.Artwork_ID
#
### Question:
#
# List the name of artworks that are not nominated.
#
### SQL:
#
# SELECT Name FROM Artwork WHERE Artwork_ID NOT IN (SELECT Artwork_ID FROM nomination)
#
### End.
|
entertainment_awards
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# festival_detail ( Festival_ID, Festival_Name, Chair_Name, Location, Year, Num_of_Audience )
# artwork ( Artwork_ID, Type, Name )
# nomination ( Artwork_ID, Festival_ID, Result )
#
# nomination.Festival_ID can be joined with festival_detail.Festival_ID
# nomination.Artwork_ID can be joined with artwork.Artwork_ID
#
### Question:
#
# Show the number of audience in year 2008 or 2010.
#
### SQL:
#
# SELECT Num_of_Audience FROM festival_detail WHERE YEAR = 2008 OR YEAR = 2010
#
### End.
|
entertainment_awards
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# festival_detail ( Festival_ID, Festival_Name, Chair_Name, Location, Year, Num_of_Audience )
# artwork ( Artwork_ID, Type, Name )
# nomination ( Artwork_ID, Festival_ID, Result )
#
# nomination.Festival_ID can be joined with festival_detail.Festival_ID
# nomination.Artwork_ID can be joined with artwork.Artwork_ID
#
### Question:
#
# What are the total number of the audiences who visited any of the festivals?
#
### SQL:
#
# SELECT sum(Num_of_Audience) FROM festival_detail
#
### End.
|
entertainment_awards
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# festival_detail ( Festival_ID, Festival_Name, Chair_Name, Location, Year, Num_of_Audience )
# artwork ( Artwork_ID, Type, Name )
# nomination ( Artwork_ID, Festival_ID, Result )
#
# nomination.Festival_ID can be joined with festival_detail.Festival_ID
# nomination.Artwork_ID can be joined with artwork.Artwork_ID
#
### Question:
#
# In which year are there festivals both inside the 'United States' and outside the 'United States'?
#
### SQL:
#
# SELECT YEAR FROM festival_detail WHERE LOCATION = 'United States' INTERSECT SELECT YEAR FROM festival_detail WHERE LOCATION != 'United States'
#
### End.
|
customers_campaigns_ecommerce
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Premises ( premise_id, premises_type, premise_details )
# Products ( product_id, product_category, product_name )
# Customers ( customer_id, payment_method, customer_name, customer_phone, customer_email, customer_address, customer_login, customer_password )
# Mailshot_Campaigns ( mailshot_id, product_category, mailshot_name, mailshot_start_date, mailshot_end_date )
# Customer_Addresses ( customer_id, premise_id, date_address_from, address_type_code, date_address_to )
# Customer_Orders ( order_id, customer_id, order_status_code, shipping_method_code, order_placed_datetime, order_delivered_datetime, order_shipping_charges )
# Mailshot_Customers ( mailshot_id, customer_id, outcome_code, mailshot_customer_date )
# Order_Items ( item_id, order_item_status_code, order_id, product_id, item_status_code, item_delivered_datetime, item_order_quantity )
#
# Customer_Addresses.customer_id can be joined with Customers.customer_id
# Customer_Addresses.premise_id can be joined with Premises.premise_id
# Customer_Orders.customer_id can be joined with Customers.customer_id
# Mailshot_Customers.mailshot_id can be joined with Mailshot_Campaigns.mailshot_id
# Mailshot_Customers.customer_id can be joined with Customers.customer_id
# Order_Items.order_id can be joined with Customer_Orders.order_id
# Order_Items.product_id can be joined with Products.product_id
#
### Question:
#
# How many premises are there?
#
### SQL:
#
# SELECT count(*) FROM premises
#
### End.
|
customers_campaigns_ecommerce
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Premises ( premise_id, premises_type, premise_details )
# Products ( product_id, product_category, product_name )
# Customers ( customer_id, payment_method, customer_name, customer_phone, customer_email, customer_address, customer_login, customer_password )
# Mailshot_Campaigns ( mailshot_id, product_category, mailshot_name, mailshot_start_date, mailshot_end_date )
# Customer_Addresses ( customer_id, premise_id, date_address_from, address_type_code, date_address_to )
# Customer_Orders ( order_id, customer_id, order_status_code, shipping_method_code, order_placed_datetime, order_delivered_datetime, order_shipping_charges )
# Mailshot_Customers ( mailshot_id, customer_id, outcome_code, mailshot_customer_date )
# Order_Items ( item_id, order_item_status_code, order_id, product_id, item_status_code, item_delivered_datetime, item_order_quantity )
#
# Customer_Addresses.customer_id can be joined with Customers.customer_id
# Customer_Addresses.premise_id can be joined with Premises.premise_id
# Customer_Orders.customer_id can be joined with Customers.customer_id
# Mailshot_Customers.mailshot_id can be joined with Mailshot_Campaigns.mailshot_id
# Mailshot_Customers.customer_id can be joined with Customers.customer_id
# Order_Items.order_id can be joined with Customer_Orders.order_id
# Order_Items.product_id can be joined with Products.product_id
#
### Question:
#
# What are all the distinct premise types?
#
### SQL:
#
# SELECT DISTINCT premises_type FROM premises
#
### End.
|
customers_campaigns_ecommerce
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Premises ( premise_id, premises_type, premise_details )
# Products ( product_id, product_category, product_name )
# Customers ( customer_id, payment_method, customer_name, customer_phone, customer_email, customer_address, customer_login, customer_password )
# Mailshot_Campaigns ( mailshot_id, product_category, mailshot_name, mailshot_start_date, mailshot_end_date )
# Customer_Addresses ( customer_id, premise_id, date_address_from, address_type_code, date_address_to )
# Customer_Orders ( order_id, customer_id, order_status_code, shipping_method_code, order_placed_datetime, order_delivered_datetime, order_shipping_charges )
# Mailshot_Customers ( mailshot_id, customer_id, outcome_code, mailshot_customer_date )
# Order_Items ( item_id, order_item_status_code, order_id, product_id, item_status_code, item_delivered_datetime, item_order_quantity )
#
# Customer_Addresses.customer_id can be joined with Customers.customer_id
# Customer_Addresses.premise_id can be joined with Premises.premise_id
# Customer_Orders.customer_id can be joined with Customers.customer_id
# Mailshot_Customers.mailshot_id can be joined with Mailshot_Campaigns.mailshot_id
# Mailshot_Customers.customer_id can be joined with Customers.customer_id
# Order_Items.order_id can be joined with Customer_Orders.order_id
# Order_Items.product_id can be joined with Products.product_id
#
### Question:
#
# Find the types and details for all premises and order by the premise type.
#
### SQL:
#
# SELECT premises_type , premise_details FROM premises ORDER BY premises_type
#
### End.
|
customers_campaigns_ecommerce
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Premises ( premise_id, premises_type, premise_details )
# Products ( product_id, product_category, product_name )
# Customers ( customer_id, payment_method, customer_name, customer_phone, customer_email, customer_address, customer_login, customer_password )
# Mailshot_Campaigns ( mailshot_id, product_category, mailshot_name, mailshot_start_date, mailshot_end_date )
# Customer_Addresses ( customer_id, premise_id, date_address_from, address_type_code, date_address_to )
# Customer_Orders ( order_id, customer_id, order_status_code, shipping_method_code, order_placed_datetime, order_delivered_datetime, order_shipping_charges )
# Mailshot_Customers ( mailshot_id, customer_id, outcome_code, mailshot_customer_date )
# Order_Items ( item_id, order_item_status_code, order_id, product_id, item_status_code, item_delivered_datetime, item_order_quantity )
#
# Customer_Addresses.customer_id can be joined with Customers.customer_id
# Customer_Addresses.premise_id can be joined with Premises.premise_id
# Customer_Orders.customer_id can be joined with Customers.customer_id
# Mailshot_Customers.mailshot_id can be joined with Mailshot_Campaigns.mailshot_id
# Mailshot_Customers.customer_id can be joined with Customers.customer_id
# Order_Items.order_id can be joined with Customer_Orders.order_id
# Order_Items.product_id can be joined with Products.product_id
#
### Question:
#
# Show each premise type and the number of premises in that type.
#
### SQL:
#
# SELECT premises_type , count(*) FROM premises GROUP BY premises_type
#
### End.
|
customers_campaigns_ecommerce
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Premises ( premise_id, premises_type, premise_details )
# Products ( product_id, product_category, product_name )
# Customers ( customer_id, payment_method, customer_name, customer_phone, customer_email, customer_address, customer_login, customer_password )
# Mailshot_Campaigns ( mailshot_id, product_category, mailshot_name, mailshot_start_date, mailshot_end_date )
# Customer_Addresses ( customer_id, premise_id, date_address_from, address_type_code, date_address_to )
# Customer_Orders ( order_id, customer_id, order_status_code, shipping_method_code, order_placed_datetime, order_delivered_datetime, order_shipping_charges )
# Mailshot_Customers ( mailshot_id, customer_id, outcome_code, mailshot_customer_date )
# Order_Items ( item_id, order_item_status_code, order_id, product_id, item_status_code, item_delivered_datetime, item_order_quantity )
#
# Customer_Addresses.customer_id can be joined with Customers.customer_id
# Customer_Addresses.premise_id can be joined with Premises.premise_id
# Customer_Orders.customer_id can be joined with Customers.customer_id
# Mailshot_Customers.mailshot_id can be joined with Mailshot_Campaigns.mailshot_id
# Mailshot_Customers.customer_id can be joined with Customers.customer_id
# Order_Items.order_id can be joined with Customer_Orders.order_id
# Order_Items.product_id can be joined with Products.product_id
#
### Question:
#
# Show all distinct product categories along with the number of mailshots in each category.
#
### SQL:
#
# SELECT product_category , count(*) FROM mailshot_campaigns GROUP BY product_category
#
### End.
|
customers_campaigns_ecommerce
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Premises ( premise_id, premises_type, premise_details )
# Products ( product_id, product_category, product_name )
# Customers ( customer_id, payment_method, customer_name, customer_phone, customer_email, customer_address, customer_login, customer_password )
# Mailshot_Campaigns ( mailshot_id, product_category, mailshot_name, mailshot_start_date, mailshot_end_date )
# Customer_Addresses ( customer_id, premise_id, date_address_from, address_type_code, date_address_to )
# Customer_Orders ( order_id, customer_id, order_status_code, shipping_method_code, order_placed_datetime, order_delivered_datetime, order_shipping_charges )
# Mailshot_Customers ( mailshot_id, customer_id, outcome_code, mailshot_customer_date )
# Order_Items ( item_id, order_item_status_code, order_id, product_id, item_status_code, item_delivered_datetime, item_order_quantity )
#
# Customer_Addresses.customer_id can be joined with Customers.customer_id
# Customer_Addresses.premise_id can be joined with Premises.premise_id
# Customer_Orders.customer_id can be joined with Customers.customer_id
# Mailshot_Customers.mailshot_id can be joined with Mailshot_Campaigns.mailshot_id
# Mailshot_Customers.customer_id can be joined with Customers.customer_id
# Order_Items.order_id can be joined with Customer_Orders.order_id
# Order_Items.product_id can be joined with Products.product_id
#
### Question:
#
# Show the name and phone of the customer without any mailshot.
#
### SQL:
#
# SELECT customer_name , customer_phone FROM customers WHERE customer_id NOT IN (SELECT customer_id FROM mailshot_customers)
#
### End.
|
customers_campaigns_ecommerce
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Premises ( premise_id, premises_type, premise_details )
# Products ( product_id, product_category, product_name )
# Customers ( customer_id, payment_method, customer_name, customer_phone, customer_email, customer_address, customer_login, customer_password )
# Mailshot_Campaigns ( mailshot_id, product_category, mailshot_name, mailshot_start_date, mailshot_end_date )
# Customer_Addresses ( customer_id, premise_id, date_address_from, address_type_code, date_address_to )
# Customer_Orders ( order_id, customer_id, order_status_code, shipping_method_code, order_placed_datetime, order_delivered_datetime, order_shipping_charges )
# Mailshot_Customers ( mailshot_id, customer_id, outcome_code, mailshot_customer_date )
# Order_Items ( item_id, order_item_status_code, order_id, product_id, item_status_code, item_delivered_datetime, item_order_quantity )
#
# Customer_Addresses.customer_id can be joined with Customers.customer_id
# Customer_Addresses.premise_id can be joined with Premises.premise_id
# Customer_Orders.customer_id can be joined with Customers.customer_id
# Mailshot_Customers.mailshot_id can be joined with Mailshot_Campaigns.mailshot_id
# Mailshot_Customers.customer_id can be joined with Customers.customer_id
# Order_Items.order_id can be joined with Customer_Orders.order_id
# Order_Items.product_id can be joined with Products.product_id
#
### Question:
#
# Show the name and phone for customers with a mailshot with outcome code 'No Response'.
#
### SQL:
#
# SELECT T1.customer_name , T1.customer_phone FROM customers AS T1 JOIN mailshot_customers AS T2 ON T1.customer_id = T2.customer_id WHERE T2.outcome_code = 'No Response'
#
### End.
|
customers_campaigns_ecommerce
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Premises ( premise_id, premises_type, premise_details )
# Products ( product_id, product_category, product_name )
# Customers ( customer_id, payment_method, customer_name, customer_phone, customer_email, customer_address, customer_login, customer_password )
# Mailshot_Campaigns ( mailshot_id, product_category, mailshot_name, mailshot_start_date, mailshot_end_date )
# Customer_Addresses ( customer_id, premise_id, date_address_from, address_type_code, date_address_to )
# Customer_Orders ( order_id, customer_id, order_status_code, shipping_method_code, order_placed_datetime, order_delivered_datetime, order_shipping_charges )
# Mailshot_Customers ( mailshot_id, customer_id, outcome_code, mailshot_customer_date )
# Order_Items ( item_id, order_item_status_code, order_id, product_id, item_status_code, item_delivered_datetime, item_order_quantity )
#
# Customer_Addresses.customer_id can be joined with Customers.customer_id
# Customer_Addresses.premise_id can be joined with Premises.premise_id
# Customer_Orders.customer_id can be joined with Customers.customer_id
# Mailshot_Customers.mailshot_id can be joined with Mailshot_Campaigns.mailshot_id
# Mailshot_Customers.customer_id can be joined with Customers.customer_id
# Order_Items.order_id can be joined with Customer_Orders.order_id
# Order_Items.product_id can be joined with Products.product_id
#
### Question:
#
# Show the outcome code of mailshots along with the number of mailshots in each outcome code.
#
### SQL:
#
# SELECT outcome_code , count(*) FROM mailshot_customers GROUP BY outcome_code
#
### End.
|
customers_campaigns_ecommerce
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Premises ( premise_id, premises_type, premise_details )
# Products ( product_id, product_category, product_name )
# Customers ( customer_id, payment_method, customer_name, customer_phone, customer_email, customer_address, customer_login, customer_password )
# Mailshot_Campaigns ( mailshot_id, product_category, mailshot_name, mailshot_start_date, mailshot_end_date )
# Customer_Addresses ( customer_id, premise_id, date_address_from, address_type_code, date_address_to )
# Customer_Orders ( order_id, customer_id, order_status_code, shipping_method_code, order_placed_datetime, order_delivered_datetime, order_shipping_charges )
# Mailshot_Customers ( mailshot_id, customer_id, outcome_code, mailshot_customer_date )
# Order_Items ( item_id, order_item_status_code, order_id, product_id, item_status_code, item_delivered_datetime, item_order_quantity )
#
# Customer_Addresses.customer_id can be joined with Customers.customer_id
# Customer_Addresses.premise_id can be joined with Premises.premise_id
# Customer_Orders.customer_id can be joined with Customers.customer_id
# Mailshot_Customers.mailshot_id can be joined with Mailshot_Campaigns.mailshot_id
# Mailshot_Customers.customer_id can be joined with Customers.customer_id
# Order_Items.order_id can be joined with Customer_Orders.order_id
# Order_Items.product_id can be joined with Products.product_id
#
### Question:
#
# Show the names of customers who have at least 2 mailshots with outcome code 'Order'.
#
### SQL:
#
# SELECT T2.customer_name FROM mailshot_customers AS T1 JOIN customers AS T2 ON T1.customer_id = T2.customer_id WHERE outcome_code = 'Order' GROUP BY T1.customer_id HAVING count(*) >= 2
#
### End.
|
customers_campaigns_ecommerce
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Premises ( premise_id, premises_type, premise_details )
# Products ( product_id, product_category, product_name )
# Customers ( customer_id, payment_method, customer_name, customer_phone, customer_email, customer_address, customer_login, customer_password )
# Mailshot_Campaigns ( mailshot_id, product_category, mailshot_name, mailshot_start_date, mailshot_end_date )
# Customer_Addresses ( customer_id, premise_id, date_address_from, address_type_code, date_address_to )
# Customer_Orders ( order_id, customer_id, order_status_code, shipping_method_code, order_placed_datetime, order_delivered_datetime, order_shipping_charges )
# Mailshot_Customers ( mailshot_id, customer_id, outcome_code, mailshot_customer_date )
# Order_Items ( item_id, order_item_status_code, order_id, product_id, item_status_code, item_delivered_datetime, item_order_quantity )
#
# Customer_Addresses.customer_id can be joined with Customers.customer_id
# Customer_Addresses.premise_id can be joined with Premises.premise_id
# Customer_Orders.customer_id can be joined with Customers.customer_id
# Mailshot_Customers.mailshot_id can be joined with Mailshot_Campaigns.mailshot_id
# Mailshot_Customers.customer_id can be joined with Customers.customer_id
# Order_Items.order_id can be joined with Customer_Orders.order_id
# Order_Items.product_id can be joined with Products.product_id
#
### Question:
#
# Show the names of customers who have the most mailshots.
#
### SQL:
#
# SELECT T2.customer_name FROM mailshot_customers AS T1 JOIN customers AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.customer_id ORDER BY count(*) DESC LIMIT 1
#
### End.
|
customers_campaigns_ecommerce
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Premises ( premise_id, premises_type, premise_details )
# Products ( product_id, product_category, product_name )
# Customers ( customer_id, payment_method, customer_name, customer_phone, customer_email, customer_address, customer_login, customer_password )
# Mailshot_Campaigns ( mailshot_id, product_category, mailshot_name, mailshot_start_date, mailshot_end_date )
# Customer_Addresses ( customer_id, premise_id, date_address_from, address_type_code, date_address_to )
# Customer_Orders ( order_id, customer_id, order_status_code, shipping_method_code, order_placed_datetime, order_delivered_datetime, order_shipping_charges )
# Mailshot_Customers ( mailshot_id, customer_id, outcome_code, mailshot_customer_date )
# Order_Items ( item_id, order_item_status_code, order_id, product_id, item_status_code, item_delivered_datetime, item_order_quantity )
#
# Customer_Addresses.customer_id can be joined with Customers.customer_id
# Customer_Addresses.premise_id can be joined with Premises.premise_id
# Customer_Orders.customer_id can be joined with Customers.customer_id
# Mailshot_Customers.mailshot_id can be joined with Mailshot_Campaigns.mailshot_id
# Mailshot_Customers.customer_id can be joined with Customers.customer_id
# Order_Items.order_id can be joined with Customer_Orders.order_id
# Order_Items.product_id can be joined with Products.product_id
#
### Question:
#
# What are the name and payment method of customers who have both mailshots in 'Order' outcome and mailshots in 'No Response' outcome.
#
### SQL:
#
# SELECT T2.customer_name , T2.payment_method FROM mailshot_customers AS T1 JOIN customers AS T2 ON T1.customer_id = T2.customer_id WHERE T1.outcome_code = 'Order' INTERSECT SELECT T2.customer_name , T2.payment_method FROM mailshot_customers AS T1 JOIN customers AS T2 ON T1.customer_id = T2.customer_id WHERE T1.outcome_code = 'No Response'
#
### End.
|
customers_campaigns_ecommerce
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Premises ( premise_id, premises_type, premise_details )
# Products ( product_id, product_category, product_name )
# Customers ( customer_id, payment_method, customer_name, customer_phone, customer_email, customer_address, customer_login, customer_password )
# Mailshot_Campaigns ( mailshot_id, product_category, mailshot_name, mailshot_start_date, mailshot_end_date )
# Customer_Addresses ( customer_id, premise_id, date_address_from, address_type_code, date_address_to )
# Customer_Orders ( order_id, customer_id, order_status_code, shipping_method_code, order_placed_datetime, order_delivered_datetime, order_shipping_charges )
# Mailshot_Customers ( mailshot_id, customer_id, outcome_code, mailshot_customer_date )
# Order_Items ( item_id, order_item_status_code, order_id, product_id, item_status_code, item_delivered_datetime, item_order_quantity )
#
# Customer_Addresses.customer_id can be joined with Customers.customer_id
# Customer_Addresses.premise_id can be joined with Premises.premise_id
# Customer_Orders.customer_id can be joined with Customers.customer_id
# Mailshot_Customers.mailshot_id can be joined with Mailshot_Campaigns.mailshot_id
# Mailshot_Customers.customer_id can be joined with Customers.customer_id
# Order_Items.order_id can be joined with Customer_Orders.order_id
# Order_Items.product_id can be joined with Products.product_id
#
### Question:
#
# Show the premise type and address type code for all customer addresses.
#
### SQL:
#
# SELECT T2.premises_type , T1.address_type_code FROM customer_addresses AS T1 JOIN premises AS T2 ON T1.premise_id = T2.premise_id
#
### End.
|
customers_campaigns_ecommerce
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Premises ( premise_id, premises_type, premise_details )
# Products ( product_id, product_category, product_name )
# Customers ( customer_id, payment_method, customer_name, customer_phone, customer_email, customer_address, customer_login, customer_password )
# Mailshot_Campaigns ( mailshot_id, product_category, mailshot_name, mailshot_start_date, mailshot_end_date )
# Customer_Addresses ( customer_id, premise_id, date_address_from, address_type_code, date_address_to )
# Customer_Orders ( order_id, customer_id, order_status_code, shipping_method_code, order_placed_datetime, order_delivered_datetime, order_shipping_charges )
# Mailshot_Customers ( mailshot_id, customer_id, outcome_code, mailshot_customer_date )
# Order_Items ( item_id, order_item_status_code, order_id, product_id, item_status_code, item_delivered_datetime, item_order_quantity )
#
# Customer_Addresses.customer_id can be joined with Customers.customer_id
# Customer_Addresses.premise_id can be joined with Premises.premise_id
# Customer_Orders.customer_id can be joined with Customers.customer_id
# Mailshot_Customers.mailshot_id can be joined with Mailshot_Campaigns.mailshot_id
# Mailshot_Customers.customer_id can be joined with Customers.customer_id
# Order_Items.order_id can be joined with Customer_Orders.order_id
# Order_Items.product_id can be joined with Products.product_id
#
### Question:
#
# What are the distinct address type codes for all customer addresses?
#
### SQL:
#
# SELECT DISTINCT address_type_code FROM customer_addresses
#
### End.
|
customers_campaigns_ecommerce
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Premises ( premise_id, premises_type, premise_details )
# Products ( product_id, product_category, product_name )
# Customers ( customer_id, payment_method, customer_name, customer_phone, customer_email, customer_address, customer_login, customer_password )
# Mailshot_Campaigns ( mailshot_id, product_category, mailshot_name, mailshot_start_date, mailshot_end_date )
# Customer_Addresses ( customer_id, premise_id, date_address_from, address_type_code, date_address_to )
# Customer_Orders ( order_id, customer_id, order_status_code, shipping_method_code, order_placed_datetime, order_delivered_datetime, order_shipping_charges )
# Mailshot_Customers ( mailshot_id, customer_id, outcome_code, mailshot_customer_date )
# Order_Items ( item_id, order_item_status_code, order_id, product_id, item_status_code, item_delivered_datetime, item_order_quantity )
#
# Customer_Addresses.customer_id can be joined with Customers.customer_id
# Customer_Addresses.premise_id can be joined with Premises.premise_id
# Customer_Orders.customer_id can be joined with Customers.customer_id
# Mailshot_Customers.mailshot_id can be joined with Mailshot_Campaigns.mailshot_id
# Mailshot_Customers.customer_id can be joined with Customers.customer_id
# Order_Items.order_id can be joined with Customer_Orders.order_id
# Order_Items.product_id can be joined with Products.product_id
#
### Question:
#
# Show the shipping charge and customer id for customer orders with order status Cancelled or Paid.
#
### SQL:
#
# SELECT order_shipping_charges , customer_id FROM customer_orders WHERE order_status_code = 'Cancelled' OR order_status_code = 'Paid'
#
### End.
|
customers_campaigns_ecommerce
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Premises ( premise_id, premises_type, premise_details )
# Products ( product_id, product_category, product_name )
# Customers ( customer_id, payment_method, customer_name, customer_phone, customer_email, customer_address, customer_login, customer_password )
# Mailshot_Campaigns ( mailshot_id, product_category, mailshot_name, mailshot_start_date, mailshot_end_date )
# Customer_Addresses ( customer_id, premise_id, date_address_from, address_type_code, date_address_to )
# Customer_Orders ( order_id, customer_id, order_status_code, shipping_method_code, order_placed_datetime, order_delivered_datetime, order_shipping_charges )
# Mailshot_Customers ( mailshot_id, customer_id, outcome_code, mailshot_customer_date )
# Order_Items ( item_id, order_item_status_code, order_id, product_id, item_status_code, item_delivered_datetime, item_order_quantity )
#
# Customer_Addresses.customer_id can be joined with Customers.customer_id
# Customer_Addresses.premise_id can be joined with Premises.premise_id
# Customer_Orders.customer_id can be joined with Customers.customer_id
# Mailshot_Customers.mailshot_id can be joined with Mailshot_Campaigns.mailshot_id
# Mailshot_Customers.customer_id can be joined with Customers.customer_id
# Order_Items.order_id can be joined with Customer_Orders.order_id
# Order_Items.product_id can be joined with Products.product_id
#
### Question:
#
# Show the names of customers having an order with shipping method FedEx and order status Paid.
#
### SQL:
#
# SELECT T1.customer_name FROM customers AS T1 JOIN customer_orders AS T2 ON T1.customer_id = T2.customer_id WHERE shipping_method_code = 'FedEx' AND order_status_code = 'Paid'
#
### End.
|
college_3
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Student ( StuID, LName, Fname, Age, Sex, Major, Advisor, city_code )
# Faculty ( FacID, Lname, Fname, Rank, Sex, Phone, Room, Building )
# Department ( DNO, Division, DName, Room, Building, DPhone )
# Member_of ( FacID, DNO, Appt_Type )
# Course ( CID, CName, Credits, Instructor, Days, Hours, DNO )
# Minor_in ( StuID, DNO )
# Enrolled_in ( StuID, CID, Grade )
# Gradeconversion ( lettergrade, gradepoint )
#
# Member_of.DNO can be joined with Department.DNO
# Member_of.FacID can be joined with Faculty.FacID
# Course.DNO can be joined with Department.DNO
# Course.Instructor can be joined with Faculty.FacID
# Minor_in.DNO can be joined with Department.DNO
# Minor_in.StuID can be joined with Student.StuID
# Enrolled_in.Grade can be joined with Gradeconversion.lettergrade
# Enrolled_in.CID can be joined with Course.CID
# Enrolled_in.StuID can be joined with Student.StuID
#
### Question:
#
# How many courses are there in total?
#
### SQL:
#
# SELECT count(*) FROM COURSE
#
### End.
|
college_3
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Student ( StuID, LName, Fname, Age, Sex, Major, Advisor, city_code )
# Faculty ( FacID, Lname, Fname, Rank, Sex, Phone, Room, Building )
# Department ( DNO, Division, DName, Room, Building, DPhone )
# Member_of ( FacID, DNO, Appt_Type )
# Course ( CID, CName, Credits, Instructor, Days, Hours, DNO )
# Minor_in ( StuID, DNO )
# Enrolled_in ( StuID, CID, Grade )
# Gradeconversion ( lettergrade, gradepoint )
#
# Member_of.DNO can be joined with Department.DNO
# Member_of.FacID can be joined with Faculty.FacID
# Course.DNO can be joined with Department.DNO
# Course.Instructor can be joined with Faculty.FacID
# Minor_in.DNO can be joined with Department.DNO
# Minor_in.StuID can be joined with Student.StuID
# Enrolled_in.Grade can be joined with Gradeconversion.lettergrade
# Enrolled_in.CID can be joined with Course.CID
# Enrolled_in.StuID can be joined with Student.StuID
#
### Question:
#
# Count the number of courses.
#
### SQL:
#
# SELECT count(*) FROM COURSE
#
### End.
|
college_3
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Student ( StuID, LName, Fname, Age, Sex, Major, Advisor, city_code )
# Faculty ( FacID, Lname, Fname, Rank, Sex, Phone, Room, Building )
# Department ( DNO, Division, DName, Room, Building, DPhone )
# Member_of ( FacID, DNO, Appt_Type )
# Course ( CID, CName, Credits, Instructor, Days, Hours, DNO )
# Minor_in ( StuID, DNO )
# Enrolled_in ( StuID, CID, Grade )
# Gradeconversion ( lettergrade, gradepoint )
#
# Member_of.DNO can be joined with Department.DNO
# Member_of.FacID can be joined with Faculty.FacID
# Course.DNO can be joined with Department.DNO
# Course.Instructor can be joined with Faculty.FacID
# Minor_in.DNO can be joined with Department.DNO
# Minor_in.StuID can be joined with Student.StuID
# Enrolled_in.Grade can be joined with Gradeconversion.lettergrade
# Enrolled_in.CID can be joined with Course.CID
# Enrolled_in.StuID can be joined with Student.StuID
#
### Question:
#
# How many courses have more than 2 credits?
#
### SQL:
#
# SELECT count(*) FROM COURSE WHERE Credits > 2
#
### End.
|
college_3
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Student ( StuID, LName, Fname, Age, Sex, Major, Advisor, city_code )
# Faculty ( FacID, Lname, Fname, Rank, Sex, Phone, Room, Building )
# Department ( DNO, Division, DName, Room, Building, DPhone )
# Member_of ( FacID, DNO, Appt_Type )
# Course ( CID, CName, Credits, Instructor, Days, Hours, DNO )
# Minor_in ( StuID, DNO )
# Enrolled_in ( StuID, CID, Grade )
# Gradeconversion ( lettergrade, gradepoint )
#
# Member_of.DNO can be joined with Department.DNO
# Member_of.FacID can be joined with Faculty.FacID
# Course.DNO can be joined with Department.DNO
# Course.Instructor can be joined with Faculty.FacID
# Minor_in.DNO can be joined with Department.DNO
# Minor_in.StuID can be joined with Student.StuID
# Enrolled_in.Grade can be joined with Gradeconversion.lettergrade
# Enrolled_in.CID can be joined with Course.CID
# Enrolled_in.StuID can be joined with Student.StuID
#
### Question:
#
# Count the number of courses with more than 2 credits.
#
### SQL:
#
# SELECT count(*) FROM COURSE WHERE Credits > 2
#
### End.
|
college_3
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Student ( StuID, LName, Fname, Age, Sex, Major, Advisor, city_code )
# Faculty ( FacID, Lname, Fname, Rank, Sex, Phone, Room, Building )
# Department ( DNO, Division, DName, Room, Building, DPhone )
# Member_of ( FacID, DNO, Appt_Type )
# Course ( CID, CName, Credits, Instructor, Days, Hours, DNO )
# Minor_in ( StuID, DNO )
# Enrolled_in ( StuID, CID, Grade )
# Gradeconversion ( lettergrade, gradepoint )
#
# Member_of.DNO can be joined with Department.DNO
# Member_of.FacID can be joined with Faculty.FacID
# Course.DNO can be joined with Department.DNO
# Course.Instructor can be joined with Faculty.FacID
# Minor_in.DNO can be joined with Department.DNO
# Minor_in.StuID can be joined with Student.StuID
# Enrolled_in.Grade can be joined with Gradeconversion.lettergrade
# Enrolled_in.CID can be joined with Course.CID
# Enrolled_in.StuID can be joined with Student.StuID
#
### Question:
#
# List all names of courses with 1 credit?
#
### SQL:
#
# SELECT CName FROM COURSE WHERE Credits = 1
#
### End.
|
college_3
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Student ( StuID, LName, Fname, Age, Sex, Major, Advisor, city_code )
# Faculty ( FacID, Lname, Fname, Rank, Sex, Phone, Room, Building )
# Department ( DNO, Division, DName, Room, Building, DPhone )
# Member_of ( FacID, DNO, Appt_Type )
# Course ( CID, CName, Credits, Instructor, Days, Hours, DNO )
# Minor_in ( StuID, DNO )
# Enrolled_in ( StuID, CID, Grade )
# Gradeconversion ( lettergrade, gradepoint )
#
# Member_of.DNO can be joined with Department.DNO
# Member_of.FacID can be joined with Faculty.FacID
# Course.DNO can be joined with Department.DNO
# Course.Instructor can be joined with Faculty.FacID
# Minor_in.DNO can be joined with Department.DNO
# Minor_in.StuID can be joined with Student.StuID
# Enrolled_in.Grade can be joined with Gradeconversion.lettergrade
# Enrolled_in.CID can be joined with Course.CID
# Enrolled_in.StuID can be joined with Student.StuID
#
### Question:
#
# What are the names of courses with 1 credit?
#
### SQL:
#
# SELECT CName FROM COURSE WHERE Credits = 1
#
### End.
|
college_3
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Student ( StuID, LName, Fname, Age, Sex, Major, Advisor, city_code )
# Faculty ( FacID, Lname, Fname, Rank, Sex, Phone, Room, Building )
# Department ( DNO, Division, DName, Room, Building, DPhone )
# Member_of ( FacID, DNO, Appt_Type )
# Course ( CID, CName, Credits, Instructor, Days, Hours, DNO )
# Minor_in ( StuID, DNO )
# Enrolled_in ( StuID, CID, Grade )
# Gradeconversion ( lettergrade, gradepoint )
#
# Member_of.DNO can be joined with Department.DNO
# Member_of.FacID can be joined with Faculty.FacID
# Course.DNO can be joined with Department.DNO
# Course.Instructor can be joined with Faculty.FacID
# Minor_in.DNO can be joined with Department.DNO
# Minor_in.StuID can be joined with Student.StuID
# Enrolled_in.Grade can be joined with Gradeconversion.lettergrade
# Enrolled_in.CID can be joined with Course.CID
# Enrolled_in.StuID can be joined with Student.StuID
#
### Question:
#
# Which courses are taught on days MTW?
#
### SQL:
#
# SELECT CName FROM COURSE WHERE Days = "MTW"
#
### End.
|
college_3
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Student ( StuID, LName, Fname, Age, Sex, Major, Advisor, city_code )
# Faculty ( FacID, Lname, Fname, Rank, Sex, Phone, Room, Building )
# Department ( DNO, Division, DName, Room, Building, DPhone )
# Member_of ( FacID, DNO, Appt_Type )
# Course ( CID, CName, Credits, Instructor, Days, Hours, DNO )
# Minor_in ( StuID, DNO )
# Enrolled_in ( StuID, CID, Grade )
# Gradeconversion ( lettergrade, gradepoint )
#
# Member_of.DNO can be joined with Department.DNO
# Member_of.FacID can be joined with Faculty.FacID
# Course.DNO can be joined with Department.DNO
# Course.Instructor can be joined with Faculty.FacID
# Minor_in.DNO can be joined with Department.DNO
# Minor_in.StuID can be joined with Student.StuID
# Enrolled_in.Grade can be joined with Gradeconversion.lettergrade
# Enrolled_in.CID can be joined with Course.CID
# Enrolled_in.StuID can be joined with Student.StuID
#
### Question:
#
# What are the course names for courses taught on MTW?
#
### SQL:
#
# SELECT CName FROM COURSE WHERE Days = "MTW"
#
### End.
|
college_3
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Student ( StuID, LName, Fname, Age, Sex, Major, Advisor, city_code )
# Faculty ( FacID, Lname, Fname, Rank, Sex, Phone, Room, Building )
# Department ( DNO, Division, DName, Room, Building, DPhone )
# Member_of ( FacID, DNO, Appt_Type )
# Course ( CID, CName, Credits, Instructor, Days, Hours, DNO )
# Minor_in ( StuID, DNO )
# Enrolled_in ( StuID, CID, Grade )
# Gradeconversion ( lettergrade, gradepoint )
#
# Member_of.DNO can be joined with Department.DNO
# Member_of.FacID can be joined with Faculty.FacID
# Course.DNO can be joined with Department.DNO
# Course.Instructor can be joined with Faculty.FacID
# Minor_in.DNO can be joined with Department.DNO
# Minor_in.StuID can be joined with Student.StuID
# Enrolled_in.Grade can be joined with Gradeconversion.lettergrade
# Enrolled_in.CID can be joined with Course.CID
# Enrolled_in.StuID can be joined with Student.StuID
#
### Question:
#
# What is the number of departments in Division "AS"?
#
### SQL:
#
# SELECT count(*) FROM DEPARTMENT WHERE Division = "AS"
#
### End.
|
college_3
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Student ( StuID, LName, Fname, Age, Sex, Major, Advisor, city_code )
# Faculty ( FacID, Lname, Fname, Rank, Sex, Phone, Room, Building )
# Department ( DNO, Division, DName, Room, Building, DPhone )
# Member_of ( FacID, DNO, Appt_Type )
# Course ( CID, CName, Credits, Instructor, Days, Hours, DNO )
# Minor_in ( StuID, DNO )
# Enrolled_in ( StuID, CID, Grade )
# Gradeconversion ( lettergrade, gradepoint )
#
# Member_of.DNO can be joined with Department.DNO
# Member_of.FacID can be joined with Faculty.FacID
# Course.DNO can be joined with Department.DNO
# Course.Instructor can be joined with Faculty.FacID
# Minor_in.DNO can be joined with Department.DNO
# Minor_in.StuID can be joined with Student.StuID
# Enrolled_in.Grade can be joined with Gradeconversion.lettergrade
# Enrolled_in.CID can be joined with Course.CID
# Enrolled_in.StuID can be joined with Student.StuID
#
### Question:
#
# How many departments are in the division AS?
#
### SQL:
#
# SELECT count(*) FROM DEPARTMENT WHERE Division = "AS"
#
### End.
|
college_3
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Student ( StuID, LName, Fname, Age, Sex, Major, Advisor, city_code )
# Faculty ( FacID, Lname, Fname, Rank, Sex, Phone, Room, Building )
# Department ( DNO, Division, DName, Room, Building, DPhone )
# Member_of ( FacID, DNO, Appt_Type )
# Course ( CID, CName, Credits, Instructor, Days, Hours, DNO )
# Minor_in ( StuID, DNO )
# Enrolled_in ( StuID, CID, Grade )
# Gradeconversion ( lettergrade, gradepoint )
#
# Member_of.DNO can be joined with Department.DNO
# Member_of.FacID can be joined with Faculty.FacID
# Course.DNO can be joined with Department.DNO
# Course.Instructor can be joined with Faculty.FacID
# Minor_in.DNO can be joined with Department.DNO
# Minor_in.StuID can be joined with Student.StuID
# Enrolled_in.Grade can be joined with Gradeconversion.lettergrade
# Enrolled_in.CID can be joined with Course.CID
# Enrolled_in.StuID can be joined with Student.StuID
#
### Question:
#
# What are the phones of departments in Room 268?
#
### SQL:
#
# SELECT DPhone FROM DEPARTMENT WHERE Room = 268
#
### End.
|
college_3
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Student ( StuID, LName, Fname, Age, Sex, Major, Advisor, city_code )
# Faculty ( FacID, Lname, Fname, Rank, Sex, Phone, Room, Building )
# Department ( DNO, Division, DName, Room, Building, DPhone )
# Member_of ( FacID, DNO, Appt_Type )
# Course ( CID, CName, Credits, Instructor, Days, Hours, DNO )
# Minor_in ( StuID, DNO )
# Enrolled_in ( StuID, CID, Grade )
# Gradeconversion ( lettergrade, gradepoint )
#
# Member_of.DNO can be joined with Department.DNO
# Member_of.FacID can be joined with Faculty.FacID
# Course.DNO can be joined with Department.DNO
# Course.Instructor can be joined with Faculty.FacID
# Minor_in.DNO can be joined with Department.DNO
# Minor_in.StuID can be joined with Student.StuID
# Enrolled_in.Grade can be joined with Gradeconversion.lettergrade
# Enrolled_in.CID can be joined with Course.CID
# Enrolled_in.StuID can be joined with Student.StuID
#
### Question:
#
# Give the phones for departments in room 268.
#
### SQL:
#
# SELECT DPhone FROM DEPARTMENT WHERE Room = 268
#
### End.
|
college_3
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Student ( StuID, LName, Fname, Age, Sex, Major, Advisor, city_code )
# Faculty ( FacID, Lname, Fname, Rank, Sex, Phone, Room, Building )
# Department ( DNO, Division, DName, Room, Building, DPhone )
# Member_of ( FacID, DNO, Appt_Type )
# Course ( CID, CName, Credits, Instructor, Days, Hours, DNO )
# Minor_in ( StuID, DNO )
# Enrolled_in ( StuID, CID, Grade )
# Gradeconversion ( lettergrade, gradepoint )
#
# Member_of.DNO can be joined with Department.DNO
# Member_of.FacID can be joined with Faculty.FacID
# Course.DNO can be joined with Department.DNO
# Course.Instructor can be joined with Faculty.FacID
# Minor_in.DNO can be joined with Department.DNO
# Minor_in.StuID can be joined with Student.StuID
# Enrolled_in.Grade can be joined with Gradeconversion.lettergrade
# Enrolled_in.CID can be joined with Course.CID
# Enrolled_in.StuID can be joined with Student.StuID
#
### Question:
#
# Find the number of students that have at least one grade "B".
#
### SQL:
#
# SELECT COUNT(DISTINCT StuID) FROM ENROLLED_IN WHERE Grade = "B"
#
### End.
|
college_3
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Student ( StuID, LName, Fname, Age, Sex, Major, Advisor, city_code )
# Faculty ( FacID, Lname, Fname, Rank, Sex, Phone, Room, Building )
# Department ( DNO, Division, DName, Room, Building, DPhone )
# Member_of ( FacID, DNO, Appt_Type )
# Course ( CID, CName, Credits, Instructor, Days, Hours, DNO )
# Minor_in ( StuID, DNO )
# Enrolled_in ( StuID, CID, Grade )
# Gradeconversion ( lettergrade, gradepoint )
#
# Member_of.DNO can be joined with Department.DNO
# Member_of.FacID can be joined with Faculty.FacID
# Course.DNO can be joined with Department.DNO
# Course.Instructor can be joined with Faculty.FacID
# Minor_in.DNO can be joined with Department.DNO
# Minor_in.StuID can be joined with Student.StuID
# Enrolled_in.Grade can be joined with Gradeconversion.lettergrade
# Enrolled_in.CID can be joined with Course.CID
# Enrolled_in.StuID can be joined with Student.StuID
#
### Question:
#
# How many students have had at least one "B" grade?
#
### SQL:
#
# SELECT COUNT(DISTINCT StuID) FROM ENROLLED_IN WHERE Grade = "B"
#
### End.
|
college_3
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Student ( StuID, LName, Fname, Age, Sex, Major, Advisor, city_code )
# Faculty ( FacID, Lname, Fname, Rank, Sex, Phone, Room, Building )
# Department ( DNO, Division, DName, Room, Building, DPhone )
# Member_of ( FacID, DNO, Appt_Type )
# Course ( CID, CName, Credits, Instructor, Days, Hours, DNO )
# Minor_in ( StuID, DNO )
# Enrolled_in ( StuID, CID, Grade )
# Gradeconversion ( lettergrade, gradepoint )
#
# Member_of.DNO can be joined with Department.DNO
# Member_of.FacID can be joined with Faculty.FacID
# Course.DNO can be joined with Department.DNO
# Course.Instructor can be joined with Faculty.FacID
# Minor_in.DNO can be joined with Department.DNO
# Minor_in.StuID can be joined with Student.StuID
# Enrolled_in.Grade can be joined with Gradeconversion.lettergrade
# Enrolled_in.CID can be joined with Course.CID
# Enrolled_in.StuID can be joined with Student.StuID
#
### Question:
#
# Find the max and min grade point for all letter grade.
#
### SQL:
#
# SELECT max(gradepoint) , min(gradepoint) FROM GRADECONVERSION
#
### End.
|
college_3
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Student ( StuID, LName, Fname, Age, Sex, Major, Advisor, city_code )
# Faculty ( FacID, Lname, Fname, Rank, Sex, Phone, Room, Building )
# Department ( DNO, Division, DName, Room, Building, DPhone )
# Member_of ( FacID, DNO, Appt_Type )
# Course ( CID, CName, Credits, Instructor, Days, Hours, DNO )
# Minor_in ( StuID, DNO )
# Enrolled_in ( StuID, CID, Grade )
# Gradeconversion ( lettergrade, gradepoint )
#
# Member_of.DNO can be joined with Department.DNO
# Member_of.FacID can be joined with Faculty.FacID
# Course.DNO can be joined with Department.DNO
# Course.Instructor can be joined with Faculty.FacID
# Minor_in.DNO can be joined with Department.DNO
# Minor_in.StuID can be joined with Student.StuID
# Enrolled_in.Grade can be joined with Gradeconversion.lettergrade
# Enrolled_in.CID can be joined with Course.CID
# Enrolled_in.StuID can be joined with Student.StuID
#
### Question:
#
# What are the maximum and minumum grade points?
#
### SQL:
#
# SELECT max(gradepoint) , min(gradepoint) FROM GRADECONVERSION
#
### End.
|
college_3
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Student ( StuID, LName, Fname, Age, Sex, Major, Advisor, city_code )
# Faculty ( FacID, Lname, Fname, Rank, Sex, Phone, Room, Building )
# Department ( DNO, Division, DName, Room, Building, DPhone )
# Member_of ( FacID, DNO, Appt_Type )
# Course ( CID, CName, Credits, Instructor, Days, Hours, DNO )
# Minor_in ( StuID, DNO )
# Enrolled_in ( StuID, CID, Grade )
# Gradeconversion ( lettergrade, gradepoint )
#
# Member_of.DNO can be joined with Department.DNO
# Member_of.FacID can be joined with Faculty.FacID
# Course.DNO can be joined with Department.DNO
# Course.Instructor can be joined with Faculty.FacID
# Minor_in.DNO can be joined with Department.DNO
# Minor_in.StuID can be joined with Student.StuID
# Enrolled_in.Grade can be joined with Gradeconversion.lettergrade
# Enrolled_in.CID can be joined with Course.CID
# Enrolled_in.StuID can be joined with Student.StuID
#
### Question:
#
# Find the first names of students whose first names contain letter "a".
#
### SQL:
#
# SELECT DISTINCT Fname FROM STUDENT WHERE Fname LIKE '%a%'
#
### End.
|
college_3
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Student ( StuID, LName, Fname, Age, Sex, Major, Advisor, city_code )
# Faculty ( FacID, Lname, Fname, Rank, Sex, Phone, Room, Building )
# Department ( DNO, Division, DName, Room, Building, DPhone )
# Member_of ( FacID, DNO, Appt_Type )
# Course ( CID, CName, Credits, Instructor, Days, Hours, DNO )
# Minor_in ( StuID, DNO )
# Enrolled_in ( StuID, CID, Grade )
# Gradeconversion ( lettergrade, gradepoint )
#
# Member_of.DNO can be joined with Department.DNO
# Member_of.FacID can be joined with Faculty.FacID
# Course.DNO can be joined with Department.DNO
# Course.Instructor can be joined with Faculty.FacID
# Minor_in.DNO can be joined with Department.DNO
# Minor_in.StuID can be joined with Student.StuID
# Enrolled_in.Grade can be joined with Gradeconversion.lettergrade
# Enrolled_in.CID can be joined with Course.CID
# Enrolled_in.StuID can be joined with Student.StuID
#
### Question:
#
# What are the first names for students who have an "a" in their first name?
#
### SQL:
#
# SELECT DISTINCT Fname FROM STUDENT WHERE Fname LIKE '%a%'
#
### End.
|
college_3
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Student ( StuID, LName, Fname, Age, Sex, Major, Advisor, city_code )
# Faculty ( FacID, Lname, Fname, Rank, Sex, Phone, Room, Building )
# Department ( DNO, Division, DName, Room, Building, DPhone )
# Member_of ( FacID, DNO, Appt_Type )
# Course ( CID, CName, Credits, Instructor, Days, Hours, DNO )
# Minor_in ( StuID, DNO )
# Enrolled_in ( StuID, CID, Grade )
# Gradeconversion ( lettergrade, gradepoint )
#
# Member_of.DNO can be joined with Department.DNO
# Member_of.FacID can be joined with Faculty.FacID
# Course.DNO can be joined with Department.DNO
# Course.Instructor can be joined with Faculty.FacID
# Minor_in.DNO can be joined with Department.DNO
# Minor_in.StuID can be joined with Student.StuID
# Enrolled_in.Grade can be joined with Gradeconversion.lettergrade
# Enrolled_in.CID can be joined with Course.CID
# Enrolled_in.StuID can be joined with Student.StuID
#
### Question:
#
# Find the first names and last names of male (sex is M) faculties who live in building NEB.
#
### SQL:
#
# SELECT Fname , Lname FROM FACULTY WHERE sex = "M" AND Building = "NEB"
#
### End.
|
college_3
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Student ( StuID, LName, Fname, Age, Sex, Major, Advisor, city_code )
# Faculty ( FacID, Lname, Fname, Rank, Sex, Phone, Room, Building )
# Department ( DNO, Division, DName, Room, Building, DPhone )
# Member_of ( FacID, DNO, Appt_Type )
# Course ( CID, CName, Credits, Instructor, Days, Hours, DNO )
# Minor_in ( StuID, DNO )
# Enrolled_in ( StuID, CID, Grade )
# Gradeconversion ( lettergrade, gradepoint )
#
# Member_of.DNO can be joined with Department.DNO
# Member_of.FacID can be joined with Faculty.FacID
# Course.DNO can be joined with Department.DNO
# Course.Instructor can be joined with Faculty.FacID
# Minor_in.DNO can be joined with Department.DNO
# Minor_in.StuID can be joined with Student.StuID
# Enrolled_in.Grade can be joined with Gradeconversion.lettergrade
# Enrolled_in.CID can be joined with Course.CID
# Enrolled_in.StuID can be joined with Student.StuID
#
### Question:
#
# What are the full names of faculties with sex M and who live in building NEB?
#
### SQL:
#
# SELECT Fname , Lname FROM FACULTY WHERE sex = "M" AND Building = "NEB"
#
### End.
|
college_3
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Student ( StuID, LName, Fname, Age, Sex, Major, Advisor, city_code )
# Faculty ( FacID, Lname, Fname, Rank, Sex, Phone, Room, Building )
# Department ( DNO, Division, DName, Room, Building, DPhone )
# Member_of ( FacID, DNO, Appt_Type )
# Course ( CID, CName, Credits, Instructor, Days, Hours, DNO )
# Minor_in ( StuID, DNO )
# Enrolled_in ( StuID, CID, Grade )
# Gradeconversion ( lettergrade, gradepoint )
#
# Member_of.DNO can be joined with Department.DNO
# Member_of.FacID can be joined with Faculty.FacID
# Course.DNO can be joined with Department.DNO
# Course.Instructor can be joined with Faculty.FacID
# Minor_in.DNO can be joined with Department.DNO
# Minor_in.StuID can be joined with Student.StuID
# Enrolled_in.Grade can be joined with Gradeconversion.lettergrade
# Enrolled_in.CID can be joined with Course.CID
# Enrolled_in.StuID can be joined with Student.StuID
#
### Question:
#
# Find the rooms of faculties with rank professor who live in building NEB.
#
### SQL:
#
# SELECT Room FROM FACULTY WHERE Rank = "Professor" AND Building = "NEB"
#
### End.
|
college_3
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Student ( StuID, LName, Fname, Age, Sex, Major, Advisor, city_code )
# Faculty ( FacID, Lname, Fname, Rank, Sex, Phone, Room, Building )
# Department ( DNO, Division, DName, Room, Building, DPhone )
# Member_of ( FacID, DNO, Appt_Type )
# Course ( CID, CName, Credits, Instructor, Days, Hours, DNO )
# Minor_in ( StuID, DNO )
# Enrolled_in ( StuID, CID, Grade )
# Gradeconversion ( lettergrade, gradepoint )
#
# Member_of.DNO can be joined with Department.DNO
# Member_of.FacID can be joined with Faculty.FacID
# Course.DNO can be joined with Department.DNO
# Course.Instructor can be joined with Faculty.FacID
# Minor_in.DNO can be joined with Department.DNO
# Minor_in.StuID can be joined with Student.StuID
# Enrolled_in.Grade can be joined with Gradeconversion.lettergrade
# Enrolled_in.CID can be joined with Course.CID
# Enrolled_in.StuID can be joined with Student.StuID
#
### Question:
#
# What are the rooms for members of the faculty who are professors and who live in building NEB?
#
### SQL:
#
# SELECT Room FROM FACULTY WHERE Rank = "Professor" AND Building = "NEB"
#
### End.
|
college_3
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Student ( StuID, LName, Fname, Age, Sex, Major, Advisor, city_code )
# Faculty ( FacID, Lname, Fname, Rank, Sex, Phone, Room, Building )
# Department ( DNO, Division, DName, Room, Building, DPhone )
# Member_of ( FacID, DNO, Appt_Type )
# Course ( CID, CName, Credits, Instructor, Days, Hours, DNO )
# Minor_in ( StuID, DNO )
# Enrolled_in ( StuID, CID, Grade )
# Gradeconversion ( lettergrade, gradepoint )
#
# Member_of.DNO can be joined with Department.DNO
# Member_of.FacID can be joined with Faculty.FacID
# Course.DNO can be joined with Department.DNO
# Course.Instructor can be joined with Faculty.FacID
# Minor_in.DNO can be joined with Department.DNO
# Minor_in.StuID can be joined with Student.StuID
# Enrolled_in.Grade can be joined with Gradeconversion.lettergrade
# Enrolled_in.CID can be joined with Course.CID
# Enrolled_in.StuID can be joined with Student.StuID
#
### Question:
#
# Find the department name that is in Building "Mergenthaler".
#
### SQL:
#
# SELECT DName FROM DEPARTMENT WHERE Building = "Mergenthaler"
#
### End.
|
college_3
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Student ( StuID, LName, Fname, Age, Sex, Major, Advisor, city_code )
# Faculty ( FacID, Lname, Fname, Rank, Sex, Phone, Room, Building )
# Department ( DNO, Division, DName, Room, Building, DPhone )
# Member_of ( FacID, DNO, Appt_Type )
# Course ( CID, CName, Credits, Instructor, Days, Hours, DNO )
# Minor_in ( StuID, DNO )
# Enrolled_in ( StuID, CID, Grade )
# Gradeconversion ( lettergrade, gradepoint )
#
# Member_of.DNO can be joined with Department.DNO
# Member_of.FacID can be joined with Faculty.FacID
# Course.DNO can be joined with Department.DNO
# Course.Instructor can be joined with Faculty.FacID
# Minor_in.DNO can be joined with Department.DNO
# Minor_in.StuID can be joined with Student.StuID
# Enrolled_in.Grade can be joined with Gradeconversion.lettergrade
# Enrolled_in.CID can be joined with Course.CID
# Enrolled_in.StuID can be joined with Student.StuID
#
### Question:
#
# What is the name of the department in the Building Mergenthaler?
#
### SQL:
#
# SELECT DName FROM DEPARTMENT WHERE Building = "Mergenthaler"
#
### End.
|
college_3
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Student ( StuID, LName, Fname, Age, Sex, Major, Advisor, city_code )
# Faculty ( FacID, Lname, Fname, Rank, Sex, Phone, Room, Building )
# Department ( DNO, Division, DName, Room, Building, DPhone )
# Member_of ( FacID, DNO, Appt_Type )
# Course ( CID, CName, Credits, Instructor, Days, Hours, DNO )
# Minor_in ( StuID, DNO )
# Enrolled_in ( StuID, CID, Grade )
# Gradeconversion ( lettergrade, gradepoint )
#
# Member_of.DNO can be joined with Department.DNO
# Member_of.FacID can be joined with Faculty.FacID
# Course.DNO can be joined with Department.DNO
# Course.Instructor can be joined with Faculty.FacID
# Minor_in.DNO can be joined with Department.DNO
# Minor_in.StuID can be joined with Student.StuID
# Enrolled_in.Grade can be joined with Gradeconversion.lettergrade
# Enrolled_in.CID can be joined with Course.CID
# Enrolled_in.StuID can be joined with Student.StuID
#
### Question:
#
# List all information about courses sorted by credits in the ascending order.
#
### SQL:
#
# SELECT * FROM COURSE ORDER BY Credits
#
### End.
|
college_3
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Student ( StuID, LName, Fname, Age, Sex, Major, Advisor, city_code )
# Faculty ( FacID, Lname, Fname, Rank, Sex, Phone, Room, Building )
# Department ( DNO, Division, DName, Room, Building, DPhone )
# Member_of ( FacID, DNO, Appt_Type )
# Course ( CID, CName, Credits, Instructor, Days, Hours, DNO )
# Minor_in ( StuID, DNO )
# Enrolled_in ( StuID, CID, Grade )
# Gradeconversion ( lettergrade, gradepoint )
#
# Member_of.DNO can be joined with Department.DNO
# Member_of.FacID can be joined with Faculty.FacID
# Course.DNO can be joined with Department.DNO
# Course.Instructor can be joined with Faculty.FacID
# Minor_in.DNO can be joined with Department.DNO
# Minor_in.StuID can be joined with Student.StuID
# Enrolled_in.Grade can be joined with Gradeconversion.lettergrade
# Enrolled_in.CID can be joined with Course.CID
# Enrolled_in.StuID can be joined with Student.StuID
#
### Question:
#
# What is all the information about courses, ordered by credits ascending?
#
### SQL:
#
# SELECT * FROM COURSE ORDER BY Credits
#
### End.
|
college_3
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Student ( StuID, LName, Fname, Age, Sex, Major, Advisor, city_code )
# Faculty ( FacID, Lname, Fname, Rank, Sex, Phone, Room, Building )
# Department ( DNO, Division, DName, Room, Building, DPhone )
# Member_of ( FacID, DNO, Appt_Type )
# Course ( CID, CName, Credits, Instructor, Days, Hours, DNO )
# Minor_in ( StuID, DNO )
# Enrolled_in ( StuID, CID, Grade )
# Gradeconversion ( lettergrade, gradepoint )
#
# Member_of.DNO can be joined with Department.DNO
# Member_of.FacID can be joined with Faculty.FacID
# Course.DNO can be joined with Department.DNO
# Course.Instructor can be joined with Faculty.FacID
# Minor_in.DNO can be joined with Department.DNO
# Minor_in.StuID can be joined with Student.StuID
# Enrolled_in.Grade can be joined with Gradeconversion.lettergrade
# Enrolled_in.CID can be joined with Course.CID
# Enrolled_in.StuID can be joined with Student.StuID
#
### Question:
#
# List the course name of courses sorted by credits.
#
### SQL:
#
# SELECT CName FROM COURSE ORDER BY Credits
#
### End.
|
college_3
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Student ( StuID, LName, Fname, Age, Sex, Major, Advisor, city_code )
# Faculty ( FacID, Lname, Fname, Rank, Sex, Phone, Room, Building )
# Department ( DNO, Division, DName, Room, Building, DPhone )
# Member_of ( FacID, DNO, Appt_Type )
# Course ( CID, CName, Credits, Instructor, Days, Hours, DNO )
# Minor_in ( StuID, DNO )
# Enrolled_in ( StuID, CID, Grade )
# Gradeconversion ( lettergrade, gradepoint )
#
# Member_of.DNO can be joined with Department.DNO
# Member_of.FacID can be joined with Faculty.FacID
# Course.DNO can be joined with Department.DNO
# Course.Instructor can be joined with Faculty.FacID
# Minor_in.DNO can be joined with Department.DNO
# Minor_in.StuID can be joined with Student.StuID
# Enrolled_in.Grade can be joined with Gradeconversion.lettergrade
# Enrolled_in.CID can be joined with Course.CID
# Enrolled_in.StuID can be joined with Student.StuID
#
### Question:
#
# What are the course names, ordered by credits?
#
### SQL:
#
# SELECT CName FROM COURSE ORDER BY Credits
#
### End.
|
college_3
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Student ( StuID, LName, Fname, Age, Sex, Major, Advisor, city_code )
# Faculty ( FacID, Lname, Fname, Rank, Sex, Phone, Room, Building )
# Department ( DNO, Division, DName, Room, Building, DPhone )
# Member_of ( FacID, DNO, Appt_Type )
# Course ( CID, CName, Credits, Instructor, Days, Hours, DNO )
# Minor_in ( StuID, DNO )
# Enrolled_in ( StuID, CID, Grade )
# Gradeconversion ( lettergrade, gradepoint )
#
# Member_of.DNO can be joined with Department.DNO
# Member_of.FacID can be joined with Faculty.FacID
# Course.DNO can be joined with Department.DNO
# Course.Instructor can be joined with Faculty.FacID
# Minor_in.DNO can be joined with Department.DNO
# Minor_in.StuID can be joined with Student.StuID
# Enrolled_in.Grade can be joined with Gradeconversion.lettergrade
# Enrolled_in.CID can be joined with Course.CID
# Enrolled_in.StuID can be joined with Student.StuID
#
### Question:
#
# Find the first name of students in the descending order of age.
#
### SQL:
#
# SELECT Fname FROM STUDENT ORDER BY Age DESC
#
### End.
|
college_3
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Student ( StuID, LName, Fname, Age, Sex, Major, Advisor, city_code )
# Faculty ( FacID, Lname, Fname, Rank, Sex, Phone, Room, Building )
# Department ( DNO, Division, DName, Room, Building, DPhone )
# Member_of ( FacID, DNO, Appt_Type )
# Course ( CID, CName, Credits, Instructor, Days, Hours, DNO )
# Minor_in ( StuID, DNO )
# Enrolled_in ( StuID, CID, Grade )
# Gradeconversion ( lettergrade, gradepoint )
#
# Member_of.DNO can be joined with Department.DNO
# Member_of.FacID can be joined with Faculty.FacID
# Course.DNO can be joined with Department.DNO
# Course.Instructor can be joined with Faculty.FacID
# Minor_in.DNO can be joined with Department.DNO
# Minor_in.StuID can be joined with Student.StuID
# Enrolled_in.Grade can be joined with Gradeconversion.lettergrade
# Enrolled_in.CID can be joined with Course.CID
# Enrolled_in.StuID can be joined with Student.StuID
#
### Question:
#
# What are the first names of students, ordered by age from greatest to least?
#
### SQL:
#
# SELECT Fname FROM STUDENT ORDER BY Age DESC
#
### End.
|
college_3
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Student ( StuID, LName, Fname, Age, Sex, Major, Advisor, city_code )
# Faculty ( FacID, Lname, Fname, Rank, Sex, Phone, Room, Building )
# Department ( DNO, Division, DName, Room, Building, DPhone )
# Member_of ( FacID, DNO, Appt_Type )
# Course ( CID, CName, Credits, Instructor, Days, Hours, DNO )
# Minor_in ( StuID, DNO )
# Enrolled_in ( StuID, CID, Grade )
# Gradeconversion ( lettergrade, gradepoint )
#
# Member_of.DNO can be joined with Department.DNO
# Member_of.FacID can be joined with Faculty.FacID
# Course.DNO can be joined with Department.DNO
# Course.Instructor can be joined with Faculty.FacID
# Minor_in.DNO can be joined with Department.DNO
# Minor_in.StuID can be joined with Student.StuID
# Enrolled_in.Grade can be joined with Gradeconversion.lettergrade
# Enrolled_in.CID can be joined with Course.CID
# Enrolled_in.StuID can be joined with Student.StuID
#
### Question:
#
# Find the last name of female (sex is F) students in the descending order of age.
#
### SQL:
#
# SELECT LName FROM STUDENT WHERE Sex = "F" ORDER BY Age DESC
#
### End.
|
college_3
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Student ( StuID, LName, Fname, Age, Sex, Major, Advisor, city_code )
# Faculty ( FacID, Lname, Fname, Rank, Sex, Phone, Room, Building )
# Department ( DNO, Division, DName, Room, Building, DPhone )
# Member_of ( FacID, DNO, Appt_Type )
# Course ( CID, CName, Credits, Instructor, Days, Hours, DNO )
# Minor_in ( StuID, DNO )
# Enrolled_in ( StuID, CID, Grade )
# Gradeconversion ( lettergrade, gradepoint )
#
# Member_of.DNO can be joined with Department.DNO
# Member_of.FacID can be joined with Faculty.FacID
# Course.DNO can be joined with Department.DNO
# Course.Instructor can be joined with Faculty.FacID
# Minor_in.DNO can be joined with Department.DNO
# Minor_in.StuID can be joined with Student.StuID
# Enrolled_in.Grade can be joined with Gradeconversion.lettergrade
# Enrolled_in.CID can be joined with Course.CID
# Enrolled_in.StuID can be joined with Student.StuID
#
### Question:
#
# What are the last names of female students, ordered by age descending?
#
### SQL:
#
# SELECT LName FROM STUDENT WHERE Sex = "F" ORDER BY Age DESC
#
### End.
|
college_3
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Student ( StuID, LName, Fname, Age, Sex, Major, Advisor, city_code )
# Faculty ( FacID, Lname, Fname, Rank, Sex, Phone, Room, Building )
# Department ( DNO, Division, DName, Room, Building, DPhone )
# Member_of ( FacID, DNO, Appt_Type )
# Course ( CID, CName, Credits, Instructor, Days, Hours, DNO )
# Minor_in ( StuID, DNO )
# Enrolled_in ( StuID, CID, Grade )
# Gradeconversion ( lettergrade, gradepoint )
#
# Member_of.DNO can be joined with Department.DNO
# Member_of.FacID can be joined with Faculty.FacID
# Course.DNO can be joined with Department.DNO
# Course.Instructor can be joined with Faculty.FacID
# Minor_in.DNO can be joined with Department.DNO
# Minor_in.StuID can be joined with Student.StuID
# Enrolled_in.Grade can be joined with Gradeconversion.lettergrade
# Enrolled_in.CID can be joined with Course.CID
# Enrolled_in.StuID can be joined with Student.StuID
#
### Question:
#
# Find the last names of faculties in building Barton in alphabetic order.
#
### SQL:
#
# SELECT Lname FROM FACULTY WHERE Building = "Barton" ORDER BY Lname
#
### End.
|
college_3
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Student ( StuID, LName, Fname, Age, Sex, Major, Advisor, city_code )
# Faculty ( FacID, Lname, Fname, Rank, Sex, Phone, Room, Building )
# Department ( DNO, Division, DName, Room, Building, DPhone )
# Member_of ( FacID, DNO, Appt_Type )
# Course ( CID, CName, Credits, Instructor, Days, Hours, DNO )
# Minor_in ( StuID, DNO )
# Enrolled_in ( StuID, CID, Grade )
# Gradeconversion ( lettergrade, gradepoint )
#
# Member_of.DNO can be joined with Department.DNO
# Member_of.FacID can be joined with Faculty.FacID
# Course.DNO can be joined with Department.DNO
# Course.Instructor can be joined with Faculty.FacID
# Minor_in.DNO can be joined with Department.DNO
# Minor_in.StuID can be joined with Student.StuID
# Enrolled_in.Grade can be joined with Gradeconversion.lettergrade
# Enrolled_in.CID can be joined with Course.CID
# Enrolled_in.StuID can be joined with Student.StuID
#
### Question:
#
# What are the last names of faculty in building Barton, sorted by last name?
#
### SQL:
#
# SELECT Lname FROM FACULTY WHERE Building = "Barton" ORDER BY Lname
#
### End.
|
college_3
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Student ( StuID, LName, Fname, Age, Sex, Major, Advisor, city_code )
# Faculty ( FacID, Lname, Fname, Rank, Sex, Phone, Room, Building )
# Department ( DNO, Division, DName, Room, Building, DPhone )
# Member_of ( FacID, DNO, Appt_Type )
# Course ( CID, CName, Credits, Instructor, Days, Hours, DNO )
# Minor_in ( StuID, DNO )
# Enrolled_in ( StuID, CID, Grade )
# Gradeconversion ( lettergrade, gradepoint )
#
# Member_of.DNO can be joined with Department.DNO
# Member_of.FacID can be joined with Faculty.FacID
# Course.DNO can be joined with Department.DNO
# Course.Instructor can be joined with Faculty.FacID
# Minor_in.DNO can be joined with Department.DNO
# Minor_in.StuID can be joined with Student.StuID
# Enrolled_in.Grade can be joined with Gradeconversion.lettergrade
# Enrolled_in.CID can be joined with Course.CID
# Enrolled_in.StuID can be joined with Student.StuID
#
### Question:
#
# Find the first names of faculties of rank Professor in alphabetic order.
#
### SQL:
#
# SELECT Fname FROM FACULTY WHERE Rank = "Professor" ORDER BY Fname
#
### End.
|
college_3
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Student ( StuID, LName, Fname, Age, Sex, Major, Advisor, city_code )
# Faculty ( FacID, Lname, Fname, Rank, Sex, Phone, Room, Building )
# Department ( DNO, Division, DName, Room, Building, DPhone )
# Member_of ( FacID, DNO, Appt_Type )
# Course ( CID, CName, Credits, Instructor, Days, Hours, DNO )
# Minor_in ( StuID, DNO )
# Enrolled_in ( StuID, CID, Grade )
# Gradeconversion ( lettergrade, gradepoint )
#
# Member_of.DNO can be joined with Department.DNO
# Member_of.FacID can be joined with Faculty.FacID
# Course.DNO can be joined with Department.DNO
# Course.Instructor can be joined with Faculty.FacID
# Minor_in.DNO can be joined with Department.DNO
# Minor_in.StuID can be joined with Student.StuID
# Enrolled_in.Grade can be joined with Gradeconversion.lettergrade
# Enrolled_in.CID can be joined with Course.CID
# Enrolled_in.StuID can be joined with Student.StuID
#
### Question:
#
# What are the first names for all faculty professors, ordered by first name?
#
### SQL:
#
# SELECT Fname FROM FACULTY WHERE Rank = "Professor" ORDER BY Fname
#
### End.
|
college_3
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Student ( StuID, LName, Fname, Age, Sex, Major, Advisor, city_code )
# Faculty ( FacID, Lname, Fname, Rank, Sex, Phone, Room, Building )
# Department ( DNO, Division, DName, Room, Building, DPhone )
# Member_of ( FacID, DNO, Appt_Type )
# Course ( CID, CName, Credits, Instructor, Days, Hours, DNO )
# Minor_in ( StuID, DNO )
# Enrolled_in ( StuID, CID, Grade )
# Gradeconversion ( lettergrade, gradepoint )
#
# Member_of.DNO can be joined with Department.DNO
# Member_of.FacID can be joined with Faculty.FacID
# Course.DNO can be joined with Department.DNO
# Course.Instructor can be joined with Faculty.FacID
# Minor_in.DNO can be joined with Department.DNO
# Minor_in.StuID can be joined with Student.StuID
# Enrolled_in.Grade can be joined with Gradeconversion.lettergrade
# Enrolled_in.CID can be joined with Course.CID
# Enrolled_in.StuID can be joined with Student.StuID
#
### Question:
#
# Find the name of the department that has the biggest number of students minored in?
#
### SQL:
#
# SELECT T1.DName FROM DEPARTMENT AS T1 JOIN MINOR_IN AS T2 ON T1.DNO = T2.DNO GROUP BY T2.DNO ORDER BY count(*) DESC LIMIT 1
#
### End.
|
college_3
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Student ( StuID, LName, Fname, Age, Sex, Major, Advisor, city_code )
# Faculty ( FacID, Lname, Fname, Rank, Sex, Phone, Room, Building )
# Department ( DNO, Division, DName, Room, Building, DPhone )
# Member_of ( FacID, DNO, Appt_Type )
# Course ( CID, CName, Credits, Instructor, Days, Hours, DNO )
# Minor_in ( StuID, DNO )
# Enrolled_in ( StuID, CID, Grade )
# Gradeconversion ( lettergrade, gradepoint )
#
# Member_of.DNO can be joined with Department.DNO
# Member_of.FacID can be joined with Faculty.FacID
# Course.DNO can be joined with Department.DNO
# Course.Instructor can be joined with Faculty.FacID
# Minor_in.DNO can be joined with Department.DNO
# Minor_in.StuID can be joined with Student.StuID
# Enrolled_in.Grade can be joined with Gradeconversion.lettergrade
# Enrolled_in.CID can be joined with Course.CID
# Enrolled_in.StuID can be joined with Student.StuID
#
### Question:
#
# What is the name of the department with the most students minoring in it?
#
### SQL:
#
# SELECT T1.DName FROM DEPARTMENT AS T1 JOIN MINOR_IN AS T2 ON T1.DNO = T2.DNO GROUP BY T2.DNO ORDER BY count(*) DESC LIMIT 1
#
### End.
|
college_3
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Student ( StuID, LName, Fname, Age, Sex, Major, Advisor, city_code )
# Faculty ( FacID, Lname, Fname, Rank, Sex, Phone, Room, Building )
# Department ( DNO, Division, DName, Room, Building, DPhone )
# Member_of ( FacID, DNO, Appt_Type )
# Course ( CID, CName, Credits, Instructor, Days, Hours, DNO )
# Minor_in ( StuID, DNO )
# Enrolled_in ( StuID, CID, Grade )
# Gradeconversion ( lettergrade, gradepoint )
#
# Member_of.DNO can be joined with Department.DNO
# Member_of.FacID can be joined with Faculty.FacID
# Course.DNO can be joined with Department.DNO
# Course.Instructor can be joined with Faculty.FacID
# Minor_in.DNO can be joined with Department.DNO
# Minor_in.StuID can be joined with Student.StuID
# Enrolled_in.Grade can be joined with Gradeconversion.lettergrade
# Enrolled_in.CID can be joined with Course.CID
# Enrolled_in.StuID can be joined with Student.StuID
#
### Question:
#
# Find the name of the department that has no students minored in?
#
### SQL:
#
# SELECT DName FROM DEPARTMENT EXCEPT SELECT T1.DName FROM DEPARTMENT AS T1 JOIN MINOR_IN AS T2 ON T1.DNO = T2.DNO
#
### End.
|
college_3
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Student ( StuID, LName, Fname, Age, Sex, Major, Advisor, city_code )
# Faculty ( FacID, Lname, Fname, Rank, Sex, Phone, Room, Building )
# Department ( DNO, Division, DName, Room, Building, DPhone )
# Member_of ( FacID, DNO, Appt_Type )
# Course ( CID, CName, Credits, Instructor, Days, Hours, DNO )
# Minor_in ( StuID, DNO )
# Enrolled_in ( StuID, CID, Grade )
# Gradeconversion ( lettergrade, gradepoint )
#
# Member_of.DNO can be joined with Department.DNO
# Member_of.FacID can be joined with Faculty.FacID
# Course.DNO can be joined with Department.DNO
# Course.Instructor can be joined with Faculty.FacID
# Minor_in.DNO can be joined with Department.DNO
# Minor_in.StuID can be joined with Student.StuID
# Enrolled_in.Grade can be joined with Gradeconversion.lettergrade
# Enrolled_in.CID can be joined with Course.CID
# Enrolled_in.StuID can be joined with Student.StuID
#
### Question:
#
# What is the name of the department htat has no students minoring in it?
#
### SQL:
#
# SELECT DName FROM DEPARTMENT EXCEPT SELECT T1.DName FROM DEPARTMENT AS T1 JOIN MINOR_IN AS T2 ON T1.DNO = T2.DNO
#
### End.
|
college_3
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Student ( StuID, LName, Fname, Age, Sex, Major, Advisor, city_code )
# Faculty ( FacID, Lname, Fname, Rank, Sex, Phone, Room, Building )
# Department ( DNO, Division, DName, Room, Building, DPhone )
# Member_of ( FacID, DNO, Appt_Type )
# Course ( CID, CName, Credits, Instructor, Days, Hours, DNO )
# Minor_in ( StuID, DNO )
# Enrolled_in ( StuID, CID, Grade )
# Gradeconversion ( lettergrade, gradepoint )
#
# Member_of.DNO can be joined with Department.DNO
# Member_of.FacID can be joined with Faculty.FacID
# Course.DNO can be joined with Department.DNO
# Course.Instructor can be joined with Faculty.FacID
# Minor_in.DNO can be joined with Department.DNO
# Minor_in.StuID can be joined with Student.StuID
# Enrolled_in.Grade can be joined with Gradeconversion.lettergrade
# Enrolled_in.CID can be joined with Course.CID
# Enrolled_in.StuID can be joined with Student.StuID
#
### Question:
#
# Find the name of the department that has the fewest members.
#
### SQL:
#
# SELECT T1.DName FROM DEPARTMENT AS T1 JOIN MEMBER_OF AS T2 ON T1.DNO = T2.DNO GROUP BY T2.DNO ORDER BY count(*) ASC LIMIT 1
#
### End.
|
college_3
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Student ( StuID, LName, Fname, Age, Sex, Major, Advisor, city_code )
# Faculty ( FacID, Lname, Fname, Rank, Sex, Phone, Room, Building )
# Department ( DNO, Division, DName, Room, Building, DPhone )
# Member_of ( FacID, DNO, Appt_Type )
# Course ( CID, CName, Credits, Instructor, Days, Hours, DNO )
# Minor_in ( StuID, DNO )
# Enrolled_in ( StuID, CID, Grade )
# Gradeconversion ( lettergrade, gradepoint )
#
# Member_of.DNO can be joined with Department.DNO
# Member_of.FacID can be joined with Faculty.FacID
# Course.DNO can be joined with Department.DNO
# Course.Instructor can be joined with Faculty.FacID
# Minor_in.DNO can be joined with Department.DNO
# Minor_in.StuID can be joined with Student.StuID
# Enrolled_in.Grade can be joined with Gradeconversion.lettergrade
# Enrolled_in.CID can be joined with Course.CID
# Enrolled_in.StuID can be joined with Student.StuID
#
### Question:
#
# What is the name of the department with the fewest members?
#
### SQL:
#
# SELECT T1.DName FROM DEPARTMENT AS T1 JOIN MEMBER_OF AS T2 ON T1.DNO = T2.DNO GROUP BY T2.DNO ORDER BY count(*) ASC LIMIT 1
#
### End.
|
college_3
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Student ( StuID, LName, Fname, Age, Sex, Major, Advisor, city_code )
# Faculty ( FacID, Lname, Fname, Rank, Sex, Phone, Room, Building )
# Department ( DNO, Division, DName, Room, Building, DPhone )
# Member_of ( FacID, DNO, Appt_Type )
# Course ( CID, CName, Credits, Instructor, Days, Hours, DNO )
# Minor_in ( StuID, DNO )
# Enrolled_in ( StuID, CID, Grade )
# Gradeconversion ( lettergrade, gradepoint )
#
# Member_of.DNO can be joined with Department.DNO
# Member_of.FacID can be joined with Faculty.FacID
# Course.DNO can be joined with Department.DNO
# Course.Instructor can be joined with Faculty.FacID
# Minor_in.DNO can be joined with Department.DNO
# Minor_in.StuID can be joined with Student.StuID
# Enrolled_in.Grade can be joined with Gradeconversion.lettergrade
# Enrolled_in.CID can be joined with Course.CID
# Enrolled_in.StuID can be joined with Student.StuID
#
### Question:
#
# Find the rank of the faculty that the fewest faculties belong to.
#
### SQL:
#
# SELECT Rank FROM FACULTY GROUP BY Rank ORDER BY count(*) ASC LIMIT 1
#
### End.
|
college_3
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Student ( StuID, LName, Fname, Age, Sex, Major, Advisor, city_code )
# Faculty ( FacID, Lname, Fname, Rank, Sex, Phone, Room, Building )
# Department ( DNO, Division, DName, Room, Building, DPhone )
# Member_of ( FacID, DNO, Appt_Type )
# Course ( CID, CName, Credits, Instructor, Days, Hours, DNO )
# Minor_in ( StuID, DNO )
# Enrolled_in ( StuID, CID, Grade )
# Gradeconversion ( lettergrade, gradepoint )
#
# Member_of.DNO can be joined with Department.DNO
# Member_of.FacID can be joined with Faculty.FacID
# Course.DNO can be joined with Department.DNO
# Course.Instructor can be joined with Faculty.FacID
# Minor_in.DNO can be joined with Department.DNO
# Minor_in.StuID can be joined with Student.StuID
# Enrolled_in.Grade can be joined with Gradeconversion.lettergrade
# Enrolled_in.CID can be joined with Course.CID
# Enrolled_in.StuID can be joined with Student.StuID
#
### Question:
#
# What is the least common faculty rank?
#
### SQL:
#
# SELECT Rank FROM FACULTY GROUP BY Rank ORDER BY count(*) ASC LIMIT 1
#
### End.
|
college_3
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Student ( StuID, LName, Fname, Age, Sex, Major, Advisor, city_code )
# Faculty ( FacID, Lname, Fname, Rank, Sex, Phone, Room, Building )
# Department ( DNO, Division, DName, Room, Building, DPhone )
# Member_of ( FacID, DNO, Appt_Type )
# Course ( CID, CName, Credits, Instructor, Days, Hours, DNO )
# Minor_in ( StuID, DNO )
# Enrolled_in ( StuID, CID, Grade )
# Gradeconversion ( lettergrade, gradepoint )
#
# Member_of.DNO can be joined with Department.DNO
# Member_of.FacID can be joined with Faculty.FacID
# Course.DNO can be joined with Department.DNO
# Course.Instructor can be joined with Faculty.FacID
# Minor_in.DNO can be joined with Department.DNO
# Minor_in.StuID can be joined with Student.StuID
# Enrolled_in.Grade can be joined with Gradeconversion.lettergrade
# Enrolled_in.CID can be joined with Course.CID
# Enrolled_in.StuID can be joined with Student.StuID
#
### Question:
#
# What are the first and last names of the instructors who teach the top 3 number of courses?
#
### SQL:
#
# SELECT T2.Fname , T2.Lname FROM COURSE AS T1 JOIN FACULTY AS T2 ON T1.Instructor = T2.FacID GROUP BY T1.Instructor ORDER BY count(*) DESC LIMIT 3
#
### End.
|
college_3
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Student ( StuID, LName, Fname, Age, Sex, Major, Advisor, city_code )
# Faculty ( FacID, Lname, Fname, Rank, Sex, Phone, Room, Building )
# Department ( DNO, Division, DName, Room, Building, DPhone )
# Member_of ( FacID, DNO, Appt_Type )
# Course ( CID, CName, Credits, Instructor, Days, Hours, DNO )
# Minor_in ( StuID, DNO )
# Enrolled_in ( StuID, CID, Grade )
# Gradeconversion ( lettergrade, gradepoint )
#
# Member_of.DNO can be joined with Department.DNO
# Member_of.FacID can be joined with Faculty.FacID
# Course.DNO can be joined with Department.DNO
# Course.Instructor can be joined with Faculty.FacID
# Minor_in.DNO can be joined with Department.DNO
# Minor_in.StuID can be joined with Student.StuID
# Enrolled_in.Grade can be joined with Gradeconversion.lettergrade
# Enrolled_in.CID can be joined with Course.CID
# Enrolled_in.StuID can be joined with Student.StuID
#
### Question:
#
# What are the full names of the 3 instructors who teach the most courses?
#
### SQL:
#
# SELECT T2.Fname , T2.Lname FROM COURSE AS T1 JOIN FACULTY AS T2 ON T1.Instructor = T2.FacID GROUP BY T1.Instructor ORDER BY count(*) DESC LIMIT 3
#
### End.
|
college_3
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Student ( StuID, LName, Fname, Age, Sex, Major, Advisor, city_code )
# Faculty ( FacID, Lname, Fname, Rank, Sex, Phone, Room, Building )
# Department ( DNO, Division, DName, Room, Building, DPhone )
# Member_of ( FacID, DNO, Appt_Type )
# Course ( CID, CName, Credits, Instructor, Days, Hours, DNO )
# Minor_in ( StuID, DNO )
# Enrolled_in ( StuID, CID, Grade )
# Gradeconversion ( lettergrade, gradepoint )
#
# Member_of.DNO can be joined with Department.DNO
# Member_of.FacID can be joined with Faculty.FacID
# Course.DNO can be joined with Department.DNO
# Course.Instructor can be joined with Faculty.FacID
# Minor_in.DNO can be joined with Department.DNO
# Minor_in.StuID can be joined with Student.StuID
# Enrolled_in.Grade can be joined with Gradeconversion.lettergrade
# Enrolled_in.CID can be joined with Course.CID
# Enrolled_in.StuID can be joined with Student.StuID
#
### Question:
#
# Which building does the instructor who teaches the most number of courses live in?
#
### SQL:
#
# SELECT T2.Building FROM COURSE AS T1 JOIN FACULTY AS T2 ON T1.Instructor = T2.FacID GROUP BY T1.Instructor ORDER BY count(*) DESC LIMIT 1
#
### End.
|
college_3
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Student ( StuID, LName, Fname, Age, Sex, Major, Advisor, city_code )
# Faculty ( FacID, Lname, Fname, Rank, Sex, Phone, Room, Building )
# Department ( DNO, Division, DName, Room, Building, DPhone )
# Member_of ( FacID, DNO, Appt_Type )
# Course ( CID, CName, Credits, Instructor, Days, Hours, DNO )
# Minor_in ( StuID, DNO )
# Enrolled_in ( StuID, CID, Grade )
# Gradeconversion ( lettergrade, gradepoint )
#
# Member_of.DNO can be joined with Department.DNO
# Member_of.FacID can be joined with Faculty.FacID
# Course.DNO can be joined with Department.DNO
# Course.Instructor can be joined with Faculty.FacID
# Minor_in.DNO can be joined with Department.DNO
# Minor_in.StuID can be joined with Student.StuID
# Enrolled_in.Grade can be joined with Gradeconversion.lettergrade
# Enrolled_in.CID can be joined with Course.CID
# Enrolled_in.StuID can be joined with Student.StuID
#
### Question:
#
# Give the building that the instructor who teaches the greatest number of courses lives in.
#
### SQL:
#
# SELECT T2.Building FROM COURSE AS T1 JOIN FACULTY AS T2 ON T1.Instructor = T2.FacID GROUP BY T1.Instructor ORDER BY count(*) DESC LIMIT 1
#
### End.
|
college_3
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Student ( StuID, LName, Fname, Age, Sex, Major, Advisor, city_code )
# Faculty ( FacID, Lname, Fname, Rank, Sex, Phone, Room, Building )
# Department ( DNO, Division, DName, Room, Building, DPhone )
# Member_of ( FacID, DNO, Appt_Type )
# Course ( CID, CName, Credits, Instructor, Days, Hours, DNO )
# Minor_in ( StuID, DNO )
# Enrolled_in ( StuID, CID, Grade )
# Gradeconversion ( lettergrade, gradepoint )
#
# Member_of.DNO can be joined with Department.DNO
# Member_of.FacID can be joined with Faculty.FacID
# Course.DNO can be joined with Department.DNO
# Course.Instructor can be joined with Faculty.FacID
# Minor_in.DNO can be joined with Department.DNO
# Minor_in.StuID can be joined with Student.StuID
# Enrolled_in.Grade can be joined with Gradeconversion.lettergrade
# Enrolled_in.CID can be joined with Course.CID
# Enrolled_in.StuID can be joined with Student.StuID
#
### Question:
#
# What are the name of courses that have at least five enrollments?
#
### SQL:
#
# SELECT T1.CName FROM COURSE AS T1 JOIN ENROLLED_IN AS T2 ON T1.CID = T2.CID GROUP BY T2.CID HAVING COUNT(*) >= 5
#
### End.
|
college_3
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Student ( StuID, LName, Fname, Age, Sex, Major, Advisor, city_code )
# Faculty ( FacID, Lname, Fname, Rank, Sex, Phone, Room, Building )
# Department ( DNO, Division, DName, Room, Building, DPhone )
# Member_of ( FacID, DNO, Appt_Type )
# Course ( CID, CName, Credits, Instructor, Days, Hours, DNO )
# Minor_in ( StuID, DNO )
# Enrolled_in ( StuID, CID, Grade )
# Gradeconversion ( lettergrade, gradepoint )
#
# Member_of.DNO can be joined with Department.DNO
# Member_of.FacID can be joined with Faculty.FacID
# Course.DNO can be joined with Department.DNO
# Course.Instructor can be joined with Faculty.FacID
# Minor_in.DNO can be joined with Department.DNO
# Minor_in.StuID can be joined with Student.StuID
# Enrolled_in.Grade can be joined with Gradeconversion.lettergrade
# Enrolled_in.CID can be joined with Course.CID
# Enrolled_in.StuID can be joined with Student.StuID
#
### Question:
#
# Give the names of the courses with at least five enrollments.
#
### SQL:
#
# SELECT T1.CName FROM COURSE AS T1 JOIN ENROLLED_IN AS T2 ON T1.CID = T2.CID GROUP BY T2.CID HAVING COUNT(*) >= 5
#
### End.
|
college_3
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Student ( StuID, LName, Fname, Age, Sex, Major, Advisor, city_code )
# Faculty ( FacID, Lname, Fname, Rank, Sex, Phone, Room, Building )
# Department ( DNO, Division, DName, Room, Building, DPhone )
# Member_of ( FacID, DNO, Appt_Type )
# Course ( CID, CName, Credits, Instructor, Days, Hours, DNO )
# Minor_in ( StuID, DNO )
# Enrolled_in ( StuID, CID, Grade )
# Gradeconversion ( lettergrade, gradepoint )
#
# Member_of.DNO can be joined with Department.DNO
# Member_of.FacID can be joined with Faculty.FacID
# Course.DNO can be joined with Department.DNO
# Course.Instructor can be joined with Faculty.FacID
# Minor_in.DNO can be joined with Department.DNO
# Minor_in.StuID can be joined with Student.StuID
# Enrolled_in.Grade can be joined with Gradeconversion.lettergrade
# Enrolled_in.CID can be joined with Course.CID
# Enrolled_in.StuID can be joined with Student.StuID
#
### Question:
#
# Find the first name and last name of the instructor of course that has course name
#
### SQL:
#
# SELECT T2.Fname , T2.Lname FROM COURSE AS T1 JOIN FACULTY AS T2 ON T1.Instructor = T2.FacID WHERE T1.CName = "COMPUTER LITERACY"
#
### End.
|
college_3
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Student ( StuID, LName, Fname, Age, Sex, Major, Advisor, city_code )
# Faculty ( FacID, Lname, Fname, Rank, Sex, Phone, Room, Building )
# Department ( DNO, Division, DName, Room, Building, DPhone )
# Member_of ( FacID, DNO, Appt_Type )
# Course ( CID, CName, Credits, Instructor, Days, Hours, DNO )
# Minor_in ( StuID, DNO )
# Enrolled_in ( StuID, CID, Grade )
# Gradeconversion ( lettergrade, gradepoint )
#
# Member_of.DNO can be joined with Department.DNO
# Member_of.FacID can be joined with Faculty.FacID
# Course.DNO can be joined with Department.DNO
# Course.Instructor can be joined with Faculty.FacID
# Minor_in.DNO can be joined with Department.DNO
# Minor_in.StuID can be joined with Student.StuID
# Enrolled_in.Grade can be joined with Gradeconversion.lettergrade
# Enrolled_in.CID can be joined with Course.CID
# Enrolled_in.StuID can be joined with Student.StuID
#
### Question:
#
# What is the full name of the instructor who has a course named COMPUTER LITERACY?
#
### SQL:
#
# SELECT T2.Fname , T2.Lname FROM COURSE AS T1 JOIN FACULTY AS T2 ON T1.Instructor = T2.FacID WHERE T1.CName = "COMPUTER LITERACY"
#
### End.
|
college_3
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Student ( StuID, LName, Fname, Age, Sex, Major, Advisor, city_code )
# Faculty ( FacID, Lname, Fname, Rank, Sex, Phone, Room, Building )
# Department ( DNO, Division, DName, Room, Building, DPhone )
# Member_of ( FacID, DNO, Appt_Type )
# Course ( CID, CName, Credits, Instructor, Days, Hours, DNO )
# Minor_in ( StuID, DNO )
# Enrolled_in ( StuID, CID, Grade )
# Gradeconversion ( lettergrade, gradepoint )
#
# Member_of.DNO can be joined with Department.DNO
# Member_of.FacID can be joined with Faculty.FacID
# Course.DNO can be joined with Department.DNO
# Course.Instructor can be joined with Faculty.FacID
# Minor_in.DNO can be joined with Department.DNO
# Minor_in.StuID can be joined with Student.StuID
# Enrolled_in.Grade can be joined with Gradeconversion.lettergrade
# Enrolled_in.CID can be joined with Course.CID
# Enrolled_in.StuID can be joined with Student.StuID
#
### Question:
#
# Find the department name and room of the course INTRODUCTION TO COMPUTER SCIENCE.
#
### SQL:
#
# SELECT T2.Dname , T2.Room FROM COURSE AS T1 JOIN DEPARTMENT AS T2 ON T1.DNO = T2.DNO WHERE T1.CName = "INTRODUCTION TO COMPUTER SCIENCE"
#
### End.
|
college_3
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Student ( StuID, LName, Fname, Age, Sex, Major, Advisor, city_code )
# Faculty ( FacID, Lname, Fname, Rank, Sex, Phone, Room, Building )
# Department ( DNO, Division, DName, Room, Building, DPhone )
# Member_of ( FacID, DNO, Appt_Type )
# Course ( CID, CName, Credits, Instructor, Days, Hours, DNO )
# Minor_in ( StuID, DNO )
# Enrolled_in ( StuID, CID, Grade )
# Gradeconversion ( lettergrade, gradepoint )
#
# Member_of.DNO can be joined with Department.DNO
# Member_of.FacID can be joined with Faculty.FacID
# Course.DNO can be joined with Department.DNO
# Course.Instructor can be joined with Faculty.FacID
# Minor_in.DNO can be joined with Department.DNO
# Minor_in.StuID can be joined with Student.StuID
# Enrolled_in.Grade can be joined with Gradeconversion.lettergrade
# Enrolled_in.CID can be joined with Course.CID
# Enrolled_in.StuID can be joined with Student.StuID
#
### Question:
#
# What are the department name and room for the course INTRODUCTION TO COMPUTER SCIENCE?
#
### SQL:
#
# SELECT T2.Dname , T2.Room FROM COURSE AS T1 JOIN DEPARTMENT AS T2 ON T1.DNO = T2.DNO WHERE T1.CName = "INTRODUCTION TO COMPUTER SCIENCE"
#
### End.
|
college_3
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Student ( StuID, LName, Fname, Age, Sex, Major, Advisor, city_code )
# Faculty ( FacID, Lname, Fname, Rank, Sex, Phone, Room, Building )
# Department ( DNO, Division, DName, Room, Building, DPhone )
# Member_of ( FacID, DNO, Appt_Type )
# Course ( CID, CName, Credits, Instructor, Days, Hours, DNO )
# Minor_in ( StuID, DNO )
# Enrolled_in ( StuID, CID, Grade )
# Gradeconversion ( lettergrade, gradepoint )
#
# Member_of.DNO can be joined with Department.DNO
# Member_of.FacID can be joined with Faculty.FacID
# Course.DNO can be joined with Department.DNO
# Course.Instructor can be joined with Faculty.FacID
# Minor_in.DNO can be joined with Department.DNO
# Minor_in.StuID can be joined with Student.StuID
# Enrolled_in.Grade can be joined with Gradeconversion.lettergrade
# Enrolled_in.CID can be joined with Course.CID
# Enrolled_in.StuID can be joined with Student.StuID
#
### Question:
#
# Find the student first and last names and grade points of all enrollments.
#
### SQL:
#
# SELECT T3.Fname , T3.LName , T2.gradepoint FROM ENROLLED_IN AS T1 JOIN GRADECONVERSION AS T2 JOIN STUDENT AS T3 ON T1.Grade = T2.lettergrade AND T1.StuID = T3.StuID
#
### End.
|
college_3
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Student ( StuID, LName, Fname, Age, Sex, Major, Advisor, city_code )
# Faculty ( FacID, Lname, Fname, Rank, Sex, Phone, Room, Building )
# Department ( DNO, Division, DName, Room, Building, DPhone )
# Member_of ( FacID, DNO, Appt_Type )
# Course ( CID, CName, Credits, Instructor, Days, Hours, DNO )
# Minor_in ( StuID, DNO )
# Enrolled_in ( StuID, CID, Grade )
# Gradeconversion ( lettergrade, gradepoint )
#
# Member_of.DNO can be joined with Department.DNO
# Member_of.FacID can be joined with Faculty.FacID
# Course.DNO can be joined with Department.DNO
# Course.Instructor can be joined with Faculty.FacID
# Minor_in.DNO can be joined with Department.DNO
# Minor_in.StuID can be joined with Student.StuID
# Enrolled_in.Grade can be joined with Gradeconversion.lettergrade
# Enrolled_in.CID can be joined with Course.CID
# Enrolled_in.StuID can be joined with Student.StuID
#
### Question:
#
# What are the full names and gradepoints for all enrollments?
#
### SQL:
#
# SELECT T3.Fname , T3.LName , T2.gradepoint FROM ENROLLED_IN AS T1 JOIN GRADECONVERSION AS T2 JOIN STUDENT AS T3 ON T1.Grade = T2.lettergrade AND T1.StuID = T3.StuID
#
### End.
|
college_3
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Student ( StuID, LName, Fname, Age, Sex, Major, Advisor, city_code )
# Faculty ( FacID, Lname, Fname, Rank, Sex, Phone, Room, Building )
# Department ( DNO, Division, DName, Room, Building, DPhone )
# Member_of ( FacID, DNO, Appt_Type )
# Course ( CID, CName, Credits, Instructor, Days, Hours, DNO )
# Minor_in ( StuID, DNO )
# Enrolled_in ( StuID, CID, Grade )
# Gradeconversion ( lettergrade, gradepoint )
#
# Member_of.DNO can be joined with Department.DNO
# Member_of.FacID can be joined with Faculty.FacID
# Course.DNO can be joined with Department.DNO
# Course.Instructor can be joined with Faculty.FacID
# Minor_in.DNO can be joined with Department.DNO
# Minor_in.StuID can be joined with Student.StuID
# Enrolled_in.Grade can be joined with Gradeconversion.lettergrade
# Enrolled_in.CID can be joined with Course.CID
# Enrolled_in.StuID can be joined with Student.StuID
#
### Question:
#
# Find the distinct student first names of all students that have grade point at least 3.8 in one course.
#
### SQL:
#
# SELECT DISTINCT T3.Fname FROM ENROLLED_IN AS T1 JOIN GRADECONVERSION AS T2 JOIN STUDENT AS T3 ON T1.Grade = T2.lettergrade AND T1.StuID = T3.StuID WHERE T2.gradepoint >= 3.8
#
### End.
|
college_3
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Student ( StuID, LName, Fname, Age, Sex, Major, Advisor, city_code )
# Faculty ( FacID, Lname, Fname, Rank, Sex, Phone, Room, Building )
# Department ( DNO, Division, DName, Room, Building, DPhone )
# Member_of ( FacID, DNO, Appt_Type )
# Course ( CID, CName, Credits, Instructor, Days, Hours, DNO )
# Minor_in ( StuID, DNO )
# Enrolled_in ( StuID, CID, Grade )
# Gradeconversion ( lettergrade, gradepoint )
#
# Member_of.DNO can be joined with Department.DNO
# Member_of.FacID can be joined with Faculty.FacID
# Course.DNO can be joined with Department.DNO
# Course.Instructor can be joined with Faculty.FacID
# Minor_in.DNO can be joined with Department.DNO
# Minor_in.StuID can be joined with Student.StuID
# Enrolled_in.Grade can be joined with Gradeconversion.lettergrade
# Enrolled_in.CID can be joined with Course.CID
# Enrolled_in.StuID can be joined with Student.StuID
#
### Question:
#
# What are the distinct first names for students with a grade point of 3.8 or above in at least one course?
#
### SQL:
#
# SELECT DISTINCT T3.Fname FROM ENROLLED_IN AS T1 JOIN GRADECONVERSION AS T2 JOIN STUDENT AS T3 ON T1.Grade = T2.lettergrade AND T1.StuID = T3.StuID WHERE T2.gradepoint >= 3.8
#
### End.
|
college_3
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Student ( StuID, LName, Fname, Age, Sex, Major, Advisor, city_code )
# Faculty ( FacID, Lname, Fname, Rank, Sex, Phone, Room, Building )
# Department ( DNO, Division, DName, Room, Building, DPhone )
# Member_of ( FacID, DNO, Appt_Type )
# Course ( CID, CName, Credits, Instructor, Days, Hours, DNO )
# Minor_in ( StuID, DNO )
# Enrolled_in ( StuID, CID, Grade )
# Gradeconversion ( lettergrade, gradepoint )
#
# Member_of.DNO can be joined with Department.DNO
# Member_of.FacID can be joined with Faculty.FacID
# Course.DNO can be joined with Department.DNO
# Course.Instructor can be joined with Faculty.FacID
# Minor_in.DNO can be joined with Department.DNO
# Minor_in.StuID can be joined with Student.StuID
# Enrolled_in.Grade can be joined with Gradeconversion.lettergrade
# Enrolled_in.CID can be joined with Course.CID
# Enrolled_in.StuID can be joined with Student.StuID
#
### Question:
#
# Find the full names of faculties who are members of department with department number 520.
#
### SQL:
#
# SELECT T1.Fname , T1.Lname FROM FACULTY AS T1 JOIN MEMBER_OF AS T2 ON T1.FacID = T2.FacID WHERE T2.DNO = 520
#
### End.
|
college_3
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Student ( StuID, LName, Fname, Age, Sex, Major, Advisor, city_code )
# Faculty ( FacID, Lname, Fname, Rank, Sex, Phone, Room, Building )
# Department ( DNO, Division, DName, Room, Building, DPhone )
# Member_of ( FacID, DNO, Appt_Type )
# Course ( CID, CName, Credits, Instructor, Days, Hours, DNO )
# Minor_in ( StuID, DNO )
# Enrolled_in ( StuID, CID, Grade )
# Gradeconversion ( lettergrade, gradepoint )
#
# Member_of.DNO can be joined with Department.DNO
# Member_of.FacID can be joined with Faculty.FacID
# Course.DNO can be joined with Department.DNO
# Course.Instructor can be joined with Faculty.FacID
# Minor_in.DNO can be joined with Department.DNO
# Minor_in.StuID can be joined with Student.StuID
# Enrolled_in.Grade can be joined with Gradeconversion.lettergrade
# Enrolled_in.CID can be joined with Course.CID
# Enrolled_in.StuID can be joined with Student.StuID
#
### Question:
#
# What are the full names of faculty members who are a part of department 520?
#
### SQL:
#
# SELECT T1.Fname , T1.Lname FROM FACULTY AS T1 JOIN MEMBER_OF AS T2 ON T1.FacID = T2.FacID WHERE T2.DNO = 520
#
### End.
|
college_3
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Student ( StuID, LName, Fname, Age, Sex, Major, Advisor, city_code )
# Faculty ( FacID, Lname, Fname, Rank, Sex, Phone, Room, Building )
# Department ( DNO, Division, DName, Room, Building, DPhone )
# Member_of ( FacID, DNO, Appt_Type )
# Course ( CID, CName, Credits, Instructor, Days, Hours, DNO )
# Minor_in ( StuID, DNO )
# Enrolled_in ( StuID, CID, Grade )
# Gradeconversion ( lettergrade, gradepoint )
#
# Member_of.DNO can be joined with Department.DNO
# Member_of.FacID can be joined with Faculty.FacID
# Course.DNO can be joined with Department.DNO
# Course.Instructor can be joined with Faculty.FacID
# Minor_in.DNO can be joined with Department.DNO
# Minor_in.StuID can be joined with Student.StuID
# Enrolled_in.Grade can be joined with Gradeconversion.lettergrade
# Enrolled_in.CID can be joined with Course.CID
# Enrolled_in.StuID can be joined with Student.StuID
#
### Question:
#
# What are the first names and last names of the students that minor in the department with DNO 140.
#
### SQL:
#
# SELECT T2.Fname , T2.Lname FROM MINOR_IN AS T1 JOIN STUDENT AS T2 ON T1.StuID = T2.StuID WHERE T1.DNO = 140
#
### End.
|
college_3
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Student ( StuID, LName, Fname, Age, Sex, Major, Advisor, city_code )
# Faculty ( FacID, Lname, Fname, Rank, Sex, Phone, Room, Building )
# Department ( DNO, Division, DName, Room, Building, DPhone )
# Member_of ( FacID, DNO, Appt_Type )
# Course ( CID, CName, Credits, Instructor, Days, Hours, DNO )
# Minor_in ( StuID, DNO )
# Enrolled_in ( StuID, CID, Grade )
# Gradeconversion ( lettergrade, gradepoint )
#
# Member_of.DNO can be joined with Department.DNO
# Member_of.FacID can be joined with Faculty.FacID
# Course.DNO can be joined with Department.DNO
# Course.Instructor can be joined with Faculty.FacID
# Minor_in.DNO can be joined with Department.DNO
# Minor_in.StuID can be joined with Student.StuID
# Enrolled_in.Grade can be joined with Gradeconversion.lettergrade
# Enrolled_in.CID can be joined with Course.CID
# Enrolled_in.StuID can be joined with Student.StuID
#
### Question:
#
# What are the full names of students minoring in department 140?
#
### SQL:
#
# SELECT T2.Fname , T2.Lname FROM MINOR_IN AS T1 JOIN STUDENT AS T2 ON T1.StuID = T2.StuID WHERE T1.DNO = 140
#
### End.
|
college_3
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Student ( StuID, LName, Fname, Age, Sex, Major, Advisor, city_code )
# Faculty ( FacID, Lname, Fname, Rank, Sex, Phone, Room, Building )
# Department ( DNO, Division, DName, Room, Building, DPhone )
# Member_of ( FacID, DNO, Appt_Type )
# Course ( CID, CName, Credits, Instructor, Days, Hours, DNO )
# Minor_in ( StuID, DNO )
# Enrolled_in ( StuID, CID, Grade )
# Gradeconversion ( lettergrade, gradepoint )
#
# Member_of.DNO can be joined with Department.DNO
# Member_of.FacID can be joined with Faculty.FacID
# Course.DNO can be joined with Department.DNO
# Course.Instructor can be joined with Faculty.FacID
# Minor_in.DNO can be joined with Department.DNO
# Minor_in.StuID can be joined with Student.StuID
# Enrolled_in.Grade can be joined with Gradeconversion.lettergrade
# Enrolled_in.CID can be joined with Course.CID
# Enrolled_in.StuID can be joined with Student.StuID
#
### Question:
#
# Find the last names of faculties who are members of computer science department.
#
### SQL:
#
# SELECT T2.Lname FROM DEPARTMENT AS T1 JOIN FACULTY AS T2 ON T1.DNO = T3.DNO JOIN MEMBER_OF AS T3 ON T2.FacID = T3.FacID WHERE T1.DName = "Computer Science"
#
### End.
|
college_3
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Student ( StuID, LName, Fname, Age, Sex, Major, Advisor, city_code )
# Faculty ( FacID, Lname, Fname, Rank, Sex, Phone, Room, Building )
# Department ( DNO, Division, DName, Room, Building, DPhone )
# Member_of ( FacID, DNO, Appt_Type )
# Course ( CID, CName, Credits, Instructor, Days, Hours, DNO )
# Minor_in ( StuID, DNO )
# Enrolled_in ( StuID, CID, Grade )
# Gradeconversion ( lettergrade, gradepoint )
#
# Member_of.DNO can be joined with Department.DNO
# Member_of.FacID can be joined with Faculty.FacID
# Course.DNO can be joined with Department.DNO
# Course.Instructor can be joined with Faculty.FacID
# Minor_in.DNO can be joined with Department.DNO
# Minor_in.StuID can be joined with Student.StuID
# Enrolled_in.Grade can be joined with Gradeconversion.lettergrade
# Enrolled_in.CID can be joined with Course.CID
# Enrolled_in.StuID can be joined with Student.StuID
#
### Question:
#
# What are the last names of faculty who are part of the computer science department?
#
### SQL:
#
# SELECT T2.Lname FROM DEPARTMENT AS T1 JOIN FACULTY AS T2 ON T1.DNO = T3.DNO JOIN MEMBER_OF AS T3 ON T2.FacID = T3.FacID WHERE T1.DName = "Computer Science"
#
### End.
|
college_3
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Student ( StuID, LName, Fname, Age, Sex, Major, Advisor, city_code )
# Faculty ( FacID, Lname, Fname, Rank, Sex, Phone, Room, Building )
# Department ( DNO, Division, DName, Room, Building, DPhone )
# Member_of ( FacID, DNO, Appt_Type )
# Course ( CID, CName, Credits, Instructor, Days, Hours, DNO )
# Minor_in ( StuID, DNO )
# Enrolled_in ( StuID, CID, Grade )
# Gradeconversion ( lettergrade, gradepoint )
#
# Member_of.DNO can be joined with Department.DNO
# Member_of.FacID can be joined with Faculty.FacID
# Course.DNO can be joined with Department.DNO
# Course.Instructor can be joined with Faculty.FacID
# Minor_in.DNO can be joined with Department.DNO
# Minor_in.StuID can be joined with Student.StuID
# Enrolled_in.Grade can be joined with Gradeconversion.lettergrade
# Enrolled_in.CID can be joined with Course.CID
# Enrolled_in.StuID can be joined with Student.StuID
#
### Question:
#
# Find the average grade point of student whose last name is Smith.
#
### SQL:
#
# SELECT avg(T2.gradepoint) FROM ENROLLED_IN AS T1 JOIN GRADECONVERSION AS T2 JOIN STUDENT AS T3 ON T1.Grade = T2.lettergrade AND T1.StuID = T3.StuID WHERE T3.LName = "Smith"
#
### End.
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.