db_id
stringlengths 3
31
| query
stringlengths 18
577
| question
stringlengths 3
224
| schema
stringlengths 177
6.14k
| primary_keys
stringlengths 16
545
| foreign_keys
stringlengths 16
1.48k
|
|---|---|---|---|---|---|
customer_complaints
|
SELECT count(*) FROM customers GROUP BY customer_type_code ORDER BY count(*) DESC LIMIT 1
|
How many customers are there in the customer type with the most customers?
|
[Schema (values) (types)]: | customer_complaints | Staff : staff_id (text) , gender (number) , first_name (text) , last_name (text) , email_address (text) , phone_number (text) | Customers : customer_id (text) , customer_type_code (number) , address_line_1 (text) , address_line_2 (text) , town_city (text) , state (text) , email_address (text) , phone_number (number) | Products : product_id (text) , parent_product_id (number) , product_category_code (text) , date_product_first_available (text) , date_product_discontinued (text) , product_name (text) , product_description (text) , product_price (number) | Complaints : complaint_id (text) , product_id (number) , customer_id (text) , complaint_outcome_code (text) , complaint_status_code (text) , complaint_type_code (text) , date_complaint_raised (text) , date_complaint_closed (number) , staff_id (text);
|
[Primary Keys]: staff : staff_id, customers : customer_id, products : product_id
|
[Foreign Keys]: complaints : customer_id = customers : customer_id | complaints : product_id = products : product_id | complaints : staff_id = staff : staff_id
|
customer_complaints
|
SELECT count(*) FROM customers GROUP BY customer_type_code ORDER BY count(*) DESC LIMIT 1
|
Count the number of customers that have the customer type that is most common.
|
[Schema (values) (types)]: | customer_complaints | Staff : staff_id (text) , gender (number) , first_name (text) , last_name (text) , email_address (text) , phone_number (text) | Customers : customer_id (text) , customer_type_code (number) , address_line_1 (text) , address_line_2 (text) , town_city (text) , state (text) , email_address (text) , phone_number (number) | Products : product_id (text) , parent_product_id (number) , product_category_code (text) , date_product_first_available (text) , date_product_discontinued (text) , product_name (text) , product_description (text) , product_price (number) | Complaints : complaint_id (text) , product_id (number) , customer_id (text) , complaint_outcome_code (text) , complaint_status_code (text) , complaint_type_code (text) , date_complaint_raised (text) , date_complaint_closed (number) , staff_id (text);
|
[Primary Keys]: staff : staff_id, customers : customer_id, products : product_id
|
[Foreign Keys]: complaints : customer_id = customers : customer_id | complaints : product_id = products : product_id | complaints : staff_id = staff : staff_id
|
customer_complaints
|
SELECT t1.last_name FROM staff AS t1 JOIN complaints AS t2 ON t1.staff_id = t2.staff_id ORDER BY t2.date_complaint_raised LIMIT 1
|
What is the last name of the staff who has handled the first ever complaint?
|
[Schema (values) (types)]: | customer_complaints | Staff : staff_id (text) , gender (number) , first_name (text) , last_name (text) , email_address (text) , phone_number (text) | Customers : customer_id (text) , customer_type_code (number) , address_line_1 (text) , address_line_2 (text) , town_city (text) , state (text) , email_address (text) , phone_number (number) | Products : product_id (text) , parent_product_id (number) , product_category_code (text) , date_product_first_available (text) , date_product_discontinued (text) , product_name (text) , product_description (text) , product_price (number) | Complaints : complaint_id (text) , product_id (number) , customer_id (text) , complaint_outcome_code (text) , complaint_status_code (text) , complaint_type_code (text) , date_complaint_raised (text) , date_complaint_closed (number) , staff_id (text);
|
[Primary Keys]: staff : staff_id, customers : customer_id, products : product_id
|
[Foreign Keys]: complaints : customer_id = customers : customer_id | complaints : product_id = products : product_id | complaints : staff_id = staff : staff_id
|
customer_complaints
|
SELECT t1.last_name FROM staff AS t1 JOIN complaints AS t2 ON t1.staff_id = t2.staff_id ORDER BY t2.date_complaint_raised LIMIT 1
|
Return the last name of the staff member who handled the complaint with the earliest date raised.
|
[Schema (values) (types)]: | customer_complaints | Staff : staff_id (text) , gender (number) , first_name (text) , last_name (text) , email_address (text) , phone_number (text) | Customers : customer_id (text) , customer_type_code (number) , address_line_1 (text) , address_line_2 (text) , town_city (text) , state (text) , email_address (text) , phone_number (number) | Products : product_id (text) , parent_product_id (number) , product_category_code (text) , date_product_first_available (text) , date_product_discontinued (text) , product_name (text) , product_description (text) , product_price (number) | Complaints : complaint_id (text) , product_id (number) , customer_id (text) , complaint_outcome_code (text) , complaint_status_code (text) , complaint_type_code (text) , date_complaint_raised (text) , date_complaint_closed (number) , staff_id (text);
|
[Primary Keys]: staff : staff_id, customers : customer_id, products : product_id
|
[Foreign Keys]: complaints : customer_id = customers : customer_id | complaints : product_id = products : product_id | complaints : staff_id = staff : staff_id
|
customer_complaints
|
SELECT count(DISTINCT complaint_type_code) FROM complaints
|
How many distinct complaint type codes are there in the database?
|
[Schema (values) (types)]: | customer_complaints | Staff : staff_id (text) , gender (number) , first_name (text) , last_name (text) , email_address (text) , phone_number (text) | Customers : customer_id (text) , customer_type_code (number) , address_line_1 (text) , address_line_2 (text) , town_city (text) , state (text) , email_address (text) , phone_number (number) | Products : product_id (text) , parent_product_id (number) , product_category_code (text) , date_product_first_available (text) , date_product_discontinued (text) , product_name (text) , product_description (text) , product_price (number) | Complaints : complaint_id (text) , product_id (number) , customer_id (text) , complaint_outcome_code (text) , complaint_status_code (text) , complaint_type_code (text) , date_complaint_raised (text) , date_complaint_closed (number) , staff_id (text);
|
[Primary Keys]: staff : staff_id, customers : customer_id, products : product_id
|
[Foreign Keys]: complaints : customer_id = customers : customer_id | complaints : product_id = products : product_id | complaints : staff_id = staff : staff_id
|
customer_complaints
|
SELECT count(DISTINCT complaint_type_code) FROM complaints
|
Count the number of different complaint type codes.
|
[Schema (values) (types)]: | customer_complaints | Staff : staff_id (text) , gender (number) , first_name (text) , last_name (text) , email_address (text) , phone_number (text) | Customers : customer_id (text) , customer_type_code (number) , address_line_1 (text) , address_line_2 (text) , town_city (text) , state (text) , email_address (text) , phone_number (number) | Products : product_id (text) , parent_product_id (number) , product_category_code (text) , date_product_first_available (text) , date_product_discontinued (text) , product_name (text) , product_description (text) , product_price (number) | Complaints : complaint_id (text) , product_id (number) , customer_id (text) , complaint_outcome_code (text) , complaint_status_code (text) , complaint_type_code (text) , date_complaint_raised (text) , date_complaint_closed (number) , staff_id (text);
|
[Primary Keys]: staff : staff_id, customers : customer_id, products : product_id
|
[Foreign Keys]: complaints : customer_id = customers : customer_id | complaints : product_id = products : product_id | complaints : staff_id = staff : staff_id
|
customer_complaints
|
SELECT address_line_1 , address_line_2 FROM customers WHERE email_address = "vbogisich@example.org"
|
Find the address line 1 and 2 of the customer with email "vbogisich@example.org".
|
[Schema (values) (types)]: | customer_complaints | Staff : staff_id (text) , gender (number) , first_name (text) , last_name (text) , email_address (text) , phone_number (text) | Customers : customer_id (text) , customer_type_code (number) , address_line_1 (text) , address_line_2 (text) , town_city (text) , state (text) , email_address (text) , phone_number (number) | Products : product_id (text) , parent_product_id (number) , product_category_code (text) , date_product_first_available (text) , date_product_discontinued (text) , product_name (text) , product_description (text) , product_price (number) | Complaints : complaint_id (text) , product_id (number) , customer_id (text) , complaint_outcome_code (text) , complaint_status_code (text) , complaint_type_code (text) , date_complaint_raised (text) , date_complaint_closed (number) , staff_id (text);
|
[Primary Keys]: staff : staff_id, customers : customer_id, products : product_id
|
[Foreign Keys]: complaints : customer_id = customers : customer_id | complaints : product_id = products : product_id | complaints : staff_id = staff : staff_id
|
customer_complaints
|
SELECT address_line_1 , address_line_2 FROM customers WHERE email_address = "vbogisich@example.org"
|
What are lines 1 and 2 of the addressed of the customer with the email "vbogisich@example.org"?
|
[Schema (values) (types)]: | customer_complaints | Staff : staff_id (text) , gender (number) , first_name (text) , last_name (text) , email_address (text) , phone_number (text) | Customers : customer_id (text) , customer_type_code (number) , address_line_1 (text) , address_line_2 (text) , town_city (text) , state (text) , email_address (text) , phone_number (number) | Products : product_id (text) , parent_product_id (number) , product_category_code (text) , date_product_first_available (text) , date_product_discontinued (text) , product_name (text) , product_description (text) , product_price (number) | Complaints : complaint_id (text) , product_id (number) , customer_id (text) , complaint_outcome_code (text) , complaint_status_code (text) , complaint_type_code (text) , date_complaint_raised (text) , date_complaint_closed (number) , staff_id (text);
|
[Primary Keys]: staff : staff_id, customers : customer_id, products : product_id
|
[Foreign Keys]: complaints : customer_id = customers : customer_id | complaints : product_id = products : product_id | complaints : staff_id = staff : staff_id
|
customer_complaints
|
SELECT complaint_status_code , count(*) FROM complaints WHERE complaint_type_code = "Product Failure" GROUP BY complaint_status_code
|
Find the number of complaints with Product Failure type for each complaint status.
|
[Schema (values) (types)]: | customer_complaints | Staff : staff_id (text) , gender (number) , first_name (text) , last_name (text) , email_address (text) , phone_number (text) | Customers : customer_id (text) , customer_type_code (number) , address_line_1 (text) , address_line_2 (text) , town_city (text) , state (text) , email_address (text) , phone_number (number) | Products : product_id (text) , parent_product_id (number) , product_category_code (text) , date_product_first_available (text) , date_product_discontinued (text) , product_name (text) , product_description (text) , product_price (number) | Complaints : complaint_id (text) , product_id (number) , customer_id (text) , complaint_outcome_code (text) , complaint_status_code (text) , complaint_type_code (text) , date_complaint_raised (text) , date_complaint_closed (number) , staff_id (text);
|
[Primary Keys]: staff : staff_id, customers : customer_id, products : product_id
|
[Foreign Keys]: complaints : customer_id = customers : customer_id | complaints : product_id = products : product_id | complaints : staff_id = staff : staff_id
|
customer_complaints
|
SELECT complaint_status_code , count(*) FROM complaints WHERE complaint_type_code = "Product Failure" GROUP BY complaint_status_code
|
Of complaints with the type code "Product Failure", how many had each different status code?
|
[Schema (values) (types)]: | customer_complaints | Staff : staff_id (text) , gender (number) , first_name (text) , last_name (text) , email_address (text) , phone_number (text) | Customers : customer_id (text) , customer_type_code (number) , address_line_1 (text) , address_line_2 (text) , town_city (text) , state (text) , email_address (text) , phone_number (number) | Products : product_id (text) , parent_product_id (number) , product_category_code (text) , date_product_first_available (text) , date_product_discontinued (text) , product_name (text) , product_description (text) , product_price (number) | Complaints : complaint_id (text) , product_id (number) , customer_id (text) , complaint_outcome_code (text) , complaint_status_code (text) , complaint_type_code (text) , date_complaint_raised (text) , date_complaint_closed (number) , staff_id (text);
|
[Primary Keys]: staff : staff_id, customers : customer_id, products : product_id
|
[Foreign Keys]: complaints : customer_id = customers : customer_id | complaints : product_id = products : product_id | complaints : staff_id = staff : staff_id
|
customer_complaints
|
SELECT t1.first_name FROM staff AS t1 JOIN complaints AS t2 ON t1.staff_id = t2.staff_id GROUP BY t2.staff_id ORDER BY count(*) LIMIT 5
|
What is first names of the top 5 staff who have handled the greatest number of complaints?
|
[Schema (values) (types)]: | customer_complaints | Staff : staff_id (text) , gender (number) , first_name (text) , last_name (text) , email_address (text) , phone_number (text) | Customers : customer_id (text) , customer_type_code (number) , address_line_1 (text) , address_line_2 (text) , town_city (text) , state (text) , email_address (text) , phone_number (number) | Products : product_id (text) , parent_product_id (number) , product_category_code (text) , date_product_first_available (text) , date_product_discontinued (text) , product_name (text) , product_description (text) , product_price (number) | Complaints : complaint_id (text) , product_id (number) , customer_id (text) , complaint_outcome_code (text) , complaint_status_code (text) , complaint_type_code (text) , date_complaint_raised (text) , date_complaint_closed (number) , staff_id (text);
|
[Primary Keys]: staff : staff_id, customers : customer_id, products : product_id
|
[Foreign Keys]: complaints : customer_id = customers : customer_id | complaints : product_id = products : product_id | complaints : staff_id = staff : staff_id
|
customer_complaints
|
SELECT t1.first_name FROM staff AS t1 JOIN complaints AS t2 ON t1.staff_id = t2.staff_id GROUP BY t2.staff_id ORDER BY count(*) LIMIT 5
|
Return the first names of the 5 staff members who have handled the most complaints.
|
[Schema (values) (types)]: | customer_complaints | Staff : staff_id (text) , gender (number) , first_name (text) , last_name (text) , email_address (text) , phone_number (text) | Customers : customer_id (text) , customer_type_code (number) , address_line_1 (text) , address_line_2 (text) , town_city (text) , state (text) , email_address (text) , phone_number (number) | Products : product_id (text) , parent_product_id (number) , product_category_code (text) , date_product_first_available (text) , date_product_discontinued (text) , product_name (text) , product_description (text) , product_price (number) | Complaints : complaint_id (text) , product_id (number) , customer_id (text) , complaint_outcome_code (text) , complaint_status_code (text) , complaint_type_code (text) , date_complaint_raised (text) , date_complaint_closed (number) , staff_id (text);
|
[Primary Keys]: staff : staff_id, customers : customer_id, products : product_id
|
[Foreign Keys]: complaints : customer_id = customers : customer_id | complaints : product_id = products : product_id | complaints : staff_id = staff : staff_id
|
customer_complaints
|
SELECT state FROM customers GROUP BY state ORDER BY count(*) LIMIT 1
|
Which state has the most customers?
|
[Schema (values) (types)]: | customer_complaints | Staff : staff_id (text) , gender (number) , first_name (text) , last_name (text) , email_address (text) , phone_number (text) | Customers : customer_id (text) , customer_type_code (number) , address_line_1 (text) , address_line_2 (text) , town_city (text) , state (text) , email_address (text) , phone_number (number) | Products : product_id (text) , parent_product_id (number) , product_category_code (text) , date_product_first_available (text) , date_product_discontinued (text) , product_name (text) , product_description (text) , product_price (number) | Complaints : complaint_id (text) , product_id (number) , customer_id (text) , complaint_outcome_code (text) , complaint_status_code (text) , complaint_type_code (text) , date_complaint_raised (text) , date_complaint_closed (number) , staff_id (text);
|
[Primary Keys]: staff : staff_id, customers : customer_id, products : product_id
|
[Foreign Keys]: complaints : customer_id = customers : customer_id | complaints : product_id = products : product_id | complaints : staff_id = staff : staff_id
|
customer_complaints
|
SELECT state FROM customers GROUP BY state ORDER BY count(*) LIMIT 1
|
Give the state that has the most customers.
|
[Schema (values) (types)]: | customer_complaints | Staff : staff_id (text) , gender (number) , first_name (text) , last_name (text) , email_address (text) , phone_number (text) | Customers : customer_id (text) , customer_type_code (number) , address_line_1 (text) , address_line_2 (text) , town_city (text) , state (text) , email_address (text) , phone_number (number) | Products : product_id (text) , parent_product_id (number) , product_category_code (text) , date_product_first_available (text) , date_product_discontinued (text) , product_name (text) , product_description (text) , product_price (number) | Complaints : complaint_id (text) , product_id (number) , customer_id (text) , complaint_outcome_code (text) , complaint_status_code (text) , complaint_type_code (text) , date_complaint_raised (text) , date_complaint_closed (number) , staff_id (text);
|
[Primary Keys]: staff : staff_id, customers : customer_id, products : product_id
|
[Foreign Keys]: complaints : customer_id = customers : customer_id | complaints : product_id = products : product_id | complaints : staff_id = staff : staff_id
|
workshop_paper
|
SELECT count(*) FROM submission
|
How many submissions are there?
|
[Schema (values) (types)]: | workshop_paper | workshop : workshop_id (text) , date (number) , venue (text) , name (text) | submission : submission_id (text) , scores (number) , author (text) , college (text) | Acceptance : submission_id (text) , workshop_id (number) , result (text);
|
[Primary Keys]: workshop : workshop_id, submission : submission_id, acceptance : submission_id
|
[Foreign Keys]: acceptance : workshop_id = workshop : workshop_id | acceptance : submission_id = submission : submission_id
|
workshop_paper
|
SELECT count(*) FROM submission
|
Count the number of submissions.
|
[Schema (values) (types)]: | workshop_paper | workshop : workshop_id (text) , date (number) , venue (text) , name (text) | submission : submission_id (text) , scores (number) , author (text) , college (text) | Acceptance : submission_id (text) , workshop_id (number) , result (text);
|
[Primary Keys]: workshop : workshop_id, submission : submission_id, acceptance : submission_id
|
[Foreign Keys]: acceptance : workshop_id = workshop : workshop_id | acceptance : submission_id = submission : submission_id
|
workshop_paper
|
SELECT Author FROM submission ORDER BY Scores ASC
|
List the authors of submissions in ascending order of scores.
|
[Schema (values) (types)]: | workshop_paper | workshop : workshop_id (text) , date (number) , venue (text) , name (text) | submission : submission_id (text) , scores (number) , author (text) , college (text) | Acceptance : submission_id (text) , workshop_id (number) , result (text);
|
[Primary Keys]: workshop : workshop_id, submission : submission_id, acceptance : submission_id
|
[Foreign Keys]: acceptance : workshop_id = workshop : workshop_id | acceptance : submission_id = submission : submission_id
|
workshop_paper
|
SELECT Author FROM submission ORDER BY Scores ASC
|
Find the author for each submission and list them in ascending order of submission score.
|
[Schema (values) (types)]: | workshop_paper | workshop : workshop_id (text) , date (number) , venue (text) , name (text) | submission : submission_id (text) , scores (number) , author (text) , college (text) | Acceptance : submission_id (text) , workshop_id (number) , result (text);
|
[Primary Keys]: workshop : workshop_id, submission : submission_id, acceptance : submission_id
|
[Foreign Keys]: acceptance : workshop_id = workshop : workshop_id | acceptance : submission_id = submission : submission_id
|
workshop_paper
|
SELECT Author , College FROM submission
|
What are the authors of submissions and their colleges?
|
[Schema (values) (types)]: | workshop_paper | workshop : workshop_id (text) , date (number) , venue (text) , name (text) | submission : submission_id (text) , scores (number) , author (text) , college (text) | Acceptance : submission_id (text) , workshop_id (number) , result (text);
|
[Primary Keys]: workshop : workshop_id, submission : submission_id, acceptance : submission_id
|
[Foreign Keys]: acceptance : workshop_id = workshop : workshop_id | acceptance : submission_id = submission : submission_id
|
workshop_paper
|
SELECT Author , College FROM submission
|
For each submission, show the author and their affiliated college.
|
[Schema (values) (types)]: | workshop_paper | workshop : workshop_id (text) , date (number) , venue (text) , name (text) | submission : submission_id (text) , scores (number) , author (text) , college (text) | Acceptance : submission_id (text) , workshop_id (number) , result (text);
|
[Primary Keys]: workshop : workshop_id, submission : submission_id, acceptance : submission_id
|
[Foreign Keys]: acceptance : workshop_id = workshop : workshop_id | acceptance : submission_id = submission : submission_id
|
workshop_paper
|
SELECT Author FROM submission WHERE College = "Florida" OR College = "Temple"
|
Show the names of authors from college "Florida" or "Temple"
|
[Schema (values) (types)]: | workshop_paper | workshop : workshop_id (text) , date (number) , venue (text) , name (text) | submission : submission_id (text) , scores (number) , author (text) , college (text) | Acceptance : submission_id (text) , workshop_id (number) , result (text);
|
[Primary Keys]: workshop : workshop_id, submission : submission_id, acceptance : submission_id
|
[Foreign Keys]: acceptance : workshop_id = workshop : workshop_id | acceptance : submission_id = submission : submission_id
|
workshop_paper
|
SELECT Author FROM submission WHERE College = "Florida" OR College = "Temple"
|
Which authors with submissions are from college "Florida" or "Temple"?
|
[Schema (values) (types)]: | workshop_paper | workshop : workshop_id (text) , date (number) , venue (text) , name (text) | submission : submission_id (text) , scores (number) , author (text) , college (text) | Acceptance : submission_id (text) , workshop_id (number) , result (text);
|
[Primary Keys]: workshop : workshop_id, submission : submission_id, acceptance : submission_id
|
[Foreign Keys]: acceptance : workshop_id = workshop : workshop_id | acceptance : submission_id = submission : submission_id
|
workshop_paper
|
SELECT avg(Scores) FROM submission
|
What is the average score of submissions?
|
[Schema (values) (types)]: | workshop_paper | workshop : workshop_id (text) , date (number) , venue (text) , name (text) | submission : submission_id (text) , scores (number) , author (text) , college (text) | Acceptance : submission_id (text) , workshop_id (number) , result (text);
|
[Primary Keys]: workshop : workshop_id, submission : submission_id, acceptance : submission_id
|
[Foreign Keys]: acceptance : workshop_id = workshop : workshop_id | acceptance : submission_id = submission : submission_id
|
workshop_paper
|
SELECT avg(Scores) FROM submission
|
Compute the average score of submissions.
|
[Schema (values) (types)]: | workshop_paper | workshop : workshop_id (text) , date (number) , venue (text) , name (text) | submission : submission_id (text) , scores (number) , author (text) , college (text) | Acceptance : submission_id (text) , workshop_id (number) , result (text);
|
[Primary Keys]: workshop : workshop_id, submission : submission_id, acceptance : submission_id
|
[Foreign Keys]: acceptance : workshop_id = workshop : workshop_id | acceptance : submission_id = submission : submission_id
|
workshop_paper
|
SELECT Author FROM submission ORDER BY Scores DESC LIMIT 1
|
What is the author of the submission with the highest score?
|
[Schema (values) (types)]: | workshop_paper | workshop : workshop_id (text) , date (number) , venue (text) , name (text) | submission : submission_id (text) , scores (number) , author (text) , college (text) | Acceptance : submission_id (text) , workshop_id (number) , result (text);
|
[Primary Keys]: workshop : workshop_id, submission : submission_id, acceptance : submission_id
|
[Foreign Keys]: acceptance : workshop_id = workshop : workshop_id | acceptance : submission_id = submission : submission_id
|
workshop_paper
|
SELECT Author FROM submission ORDER BY Scores DESC LIMIT 1
|
Find the author who achieved the highest score in a submission.
|
[Schema (values) (types)]: | workshop_paper | workshop : workshop_id (text) , date (number) , venue (text) , name (text) | submission : submission_id (text) , scores (number) , author (text) , college (text) | Acceptance : submission_id (text) , workshop_id (number) , result (text);
|
[Primary Keys]: workshop : workshop_id, submission : submission_id, acceptance : submission_id
|
[Foreign Keys]: acceptance : workshop_id = workshop : workshop_id | acceptance : submission_id = submission : submission_id
|
workshop_paper
|
SELECT College , COUNT(*) FROM submission GROUP BY College
|
Show different colleges along with the number of authors of submission from each college.
|
[Schema (values) (types)]: | workshop_paper | workshop : workshop_id (text) , date (number) , venue (text) , name (text) | submission : submission_id (text) , scores (number) , author (text) , college (text) | Acceptance : submission_id (text) , workshop_id (number) , result (text);
|
[Primary Keys]: workshop : workshop_id, submission : submission_id, acceptance : submission_id
|
[Foreign Keys]: acceptance : workshop_id = workshop : workshop_id | acceptance : submission_id = submission : submission_id
|
workshop_paper
|
SELECT College , COUNT(*) FROM submission GROUP BY College
|
For each college, return the college name and the count of authors with submissions from that college.
|
[Schema (values) (types)]: | workshop_paper | workshop : workshop_id (text) , date (number) , venue (text) , name (text) | submission : submission_id (text) , scores (number) , author (text) , college (text) | Acceptance : submission_id (text) , workshop_id (number) , result (text);
|
[Primary Keys]: workshop : workshop_id, submission : submission_id, acceptance : submission_id
|
[Foreign Keys]: acceptance : workshop_id = workshop : workshop_id | acceptance : submission_id = submission : submission_id
|
workshop_paper
|
SELECT College FROM submission GROUP BY College ORDER BY COUNT(*) DESC LIMIT 1
|
Show the most common college of authors of submissions.
|
[Schema (values) (types)]: | workshop_paper | workshop : workshop_id (text) , date (number) , venue (text) , name (text) | submission : submission_id (text) , scores (number) , author (text) , college (text) | Acceptance : submission_id (text) , workshop_id (number) , result (text);
|
[Primary Keys]: workshop : workshop_id, submission : submission_id, acceptance : submission_id
|
[Foreign Keys]: acceptance : workshop_id = workshop : workshop_id | acceptance : submission_id = submission : submission_id
|
workshop_paper
|
SELECT College FROM submission GROUP BY College ORDER BY COUNT(*) DESC LIMIT 1
|
Which college has the most authors with submissions?
|
[Schema (values) (types)]: | workshop_paper | workshop : workshop_id (text) , date (number) , venue (text) , name (text) | submission : submission_id (text) , scores (number) , author (text) , college (text) | Acceptance : submission_id (text) , workshop_id (number) , result (text);
|
[Primary Keys]: workshop : workshop_id, submission : submission_id, acceptance : submission_id
|
[Foreign Keys]: acceptance : workshop_id = workshop : workshop_id | acceptance : submission_id = submission : submission_id
|
workshop_paper
|
SELECT College FROM submission WHERE Scores > 90 INTERSECT SELECT College FROM submission WHERE Scores < 80
|
Show the colleges that have both authors with submission score larger than 90 and authors with submission score smaller than 80.
|
[Schema (values) (types)]: | workshop_paper | workshop : workshop_id (text) , date (number) , venue (text) , name (text) | submission : submission_id (text) , scores (number) , author (text) , college (text) | Acceptance : submission_id (text) , workshop_id (number) , result (text);
|
[Primary Keys]: workshop : workshop_id, submission : submission_id, acceptance : submission_id
|
[Foreign Keys]: acceptance : workshop_id = workshop : workshop_id | acceptance : submission_id = submission : submission_id
|
workshop_paper
|
SELECT College FROM submission WHERE Scores > 90 INTERSECT SELECT College FROM submission WHERE Scores < 80
|
Which colleges have both authors with submission score above 90 and authors with submission score below 80?
|
[Schema (values) (types)]: | workshop_paper | workshop : workshop_id (text) , date (number) , venue (text) , name (text) | submission : submission_id (text) , scores (number) , author (text) , college (text) | Acceptance : submission_id (text) , workshop_id (number) , result (text);
|
[Primary Keys]: workshop : workshop_id, submission : submission_id, acceptance : submission_id
|
[Foreign Keys]: acceptance : workshop_id = workshop : workshop_id | acceptance : submission_id = submission : submission_id
|
workshop_paper
|
SELECT T2.Author , T1.Result FROM acceptance AS T1 JOIN submission AS T2 ON T1.Submission_ID = T2.Submission_ID
|
Show the authors of submissions and the acceptance results of their submissions.
|
[Schema (values) (types)]: | workshop_paper | workshop : workshop_id (text) , date (number) , venue (text) , name (text) | submission : submission_id (text) , scores (number) , author (text) , college (text) | Acceptance : submission_id (text) , workshop_id (number) , result (text);
|
[Primary Keys]: workshop : workshop_id, submission : submission_id, acceptance : submission_id
|
[Foreign Keys]: acceptance : workshop_id = workshop : workshop_id | acceptance : submission_id = submission : submission_id
|
workshop_paper
|
SELECT T2.Author , T1.Result FROM acceptance AS T1 JOIN submission AS T2 ON T1.Submission_ID = T2.Submission_ID
|
For each submission, find its author and acceptance result.
|
[Schema (values) (types)]: | workshop_paper | workshop : workshop_id (text) , date (number) , venue (text) , name (text) | submission : submission_id (text) , scores (number) , author (text) , college (text) | Acceptance : submission_id (text) , workshop_id (number) , result (text);
|
[Primary Keys]: workshop : workshop_id, submission : submission_id, acceptance : submission_id
|
[Foreign Keys]: acceptance : workshop_id = workshop : workshop_id | acceptance : submission_id = submission : submission_id
|
workshop_paper
|
SELECT T1.Result FROM acceptance AS T1 JOIN submission AS T2 ON T1.Submission_ID = T2.Submission_ID ORDER BY T2.Scores DESC LIMIT 1
|
Show the result of the submission with the highest score.
|
[Schema (values) (types)]: | workshop_paper | workshop : workshop_id (text) , date (number) , venue (text) , name (text) | submission : submission_id (text) , scores (number) , author (text) , college (text) | Acceptance : submission_id (text) , workshop_id (number) , result (text);
|
[Primary Keys]: workshop : workshop_id, submission : submission_id, acceptance : submission_id
|
[Foreign Keys]: acceptance : workshop_id = workshop : workshop_id | acceptance : submission_id = submission : submission_id
|
workshop_paper
|
SELECT T1.Result FROM acceptance AS T1 JOIN submission AS T2 ON T1.Submission_ID = T2.Submission_ID ORDER BY T2.Scores DESC LIMIT 1
|
Which submission received the highest score in acceptance result. Show me the result.
|
[Schema (values) (types)]: | workshop_paper | workshop : workshop_id (text) , date (number) , venue (text) , name (text) | submission : submission_id (text) , scores (number) , author (text) , college (text) | Acceptance : submission_id (text) , workshop_id (number) , result (text);
|
[Primary Keys]: workshop : workshop_id, submission : submission_id, acceptance : submission_id
|
[Foreign Keys]: acceptance : workshop_id = workshop : workshop_id | acceptance : submission_id = submission : submission_id
|
workshop_paper
|
SELECT T2.Author , COUNT(DISTINCT T1.workshop_id) FROM acceptance AS T1 JOIN submission AS T2 ON T1.Submission_ID = T2.Submission_ID GROUP BY T2.Author
|
Show each author and the number of workshops they submitted to.
|
[Schema (values) (types)]: | workshop_paper | workshop : workshop_id (text) , date (number) , venue (text) , name (text) | submission : submission_id (text) , scores (number) , author (text) , college (text) | Acceptance : submission_id (text) , workshop_id (number) , result (text);
|
[Primary Keys]: workshop : workshop_id, submission : submission_id, acceptance : submission_id
|
[Foreign Keys]: acceptance : workshop_id = workshop : workshop_id | acceptance : submission_id = submission : submission_id
|
workshop_paper
|
SELECT T2.Author , COUNT(DISTINCT T1.workshop_id) FROM acceptance AS T1 JOIN submission AS T2 ON T1.Submission_ID = T2.Submission_ID GROUP BY T2.Author
|
How many workshops did each author submit to? Return the author name and the number of workshops.
|
[Schema (values) (types)]: | workshop_paper | workshop : workshop_id (text) , date (number) , venue (text) , name (text) | submission : submission_id (text) , scores (number) , author (text) , college (text) | Acceptance : submission_id (text) , workshop_id (number) , result (text);
|
[Primary Keys]: workshop : workshop_id, submission : submission_id, acceptance : submission_id
|
[Foreign Keys]: acceptance : workshop_id = workshop : workshop_id | acceptance : submission_id = submission : submission_id
|
workshop_paper
|
SELECT T2.Author FROM acceptance AS T1 JOIN submission AS T2 ON T1.Submission_ID = T2.Submission_ID GROUP BY T2.Author HAVING COUNT(DISTINCT T1.workshop_id) > 1
|
Show the authors who have submissions to more than one workshop.
|
[Schema (values) (types)]: | workshop_paper | workshop : workshop_id (text) , date (number) , venue (text) , name (text) | submission : submission_id (text) , scores (number) , author (text) , college (text) | Acceptance : submission_id (text) , workshop_id (number) , result (text);
|
[Primary Keys]: workshop : workshop_id, submission : submission_id, acceptance : submission_id
|
[Foreign Keys]: acceptance : workshop_id = workshop : workshop_id | acceptance : submission_id = submission : submission_id
|
workshop_paper
|
SELECT T2.Author FROM acceptance AS T1 JOIN submission AS T2 ON T1.Submission_ID = T2.Submission_ID GROUP BY T2.Author HAVING COUNT(DISTINCT T1.workshop_id) > 1
|
Which authors have submitted to more than one workshop?
|
[Schema (values) (types)]: | workshop_paper | workshop : workshop_id (text) , date (number) , venue (text) , name (text) | submission : submission_id (text) , scores (number) , author (text) , college (text) | Acceptance : submission_id (text) , workshop_id (number) , result (text);
|
[Primary Keys]: workshop : workshop_id, submission : submission_id, acceptance : submission_id
|
[Foreign Keys]: acceptance : workshop_id = workshop : workshop_id | acceptance : submission_id = submission : submission_id
|
workshop_paper
|
SELECT Date , Venue FROM workshop ORDER BY Venue
|
Show the date and venue of each workshop in ascending alphabetical order of the venue.
|
[Schema (values) (types)]: | workshop_paper | workshop : workshop_id (text) , date (number) , venue (text) , name (text) | submission : submission_id (text) , scores (number) , author (text) , college (text) | Acceptance : submission_id (text) , workshop_id (number) , result (text);
|
[Primary Keys]: workshop : workshop_id, submission : submission_id, acceptance : submission_id
|
[Foreign Keys]: acceptance : workshop_id = workshop : workshop_id | acceptance : submission_id = submission : submission_id
|
workshop_paper
|
SELECT Date , Venue FROM workshop ORDER BY Venue
|
Sort the each workshop in alphabetical order of the venue. Return the date and venue of each workshop.
|
[Schema (values) (types)]: | workshop_paper | workshop : workshop_id (text) , date (number) , venue (text) , name (text) | submission : submission_id (text) , scores (number) , author (text) , college (text) | Acceptance : submission_id (text) , workshop_id (number) , result (text);
|
[Primary Keys]: workshop : workshop_id, submission : submission_id, acceptance : submission_id
|
[Foreign Keys]: acceptance : workshop_id = workshop : workshop_id | acceptance : submission_id = submission : submission_id
|
workshop_paper
|
SELECT Author FROM submission WHERE Submission_ID NOT IN (SELECT Submission_ID FROM acceptance)
|
List the authors who do not have submission to any workshop.
|
[Schema (values) (types)]: | workshop_paper | workshop : workshop_id (text) , date (number) , venue (text) , name (text) | submission : submission_id (text) , scores (number) , author (text) , college (text) | Acceptance : submission_id (text) , workshop_id (number) , result (text);
|
[Primary Keys]: workshop : workshop_id, submission : submission_id, acceptance : submission_id
|
[Foreign Keys]: acceptance : workshop_id = workshop : workshop_id | acceptance : submission_id = submission : submission_id
|
workshop_paper
|
SELECT Author FROM submission WHERE Submission_ID NOT IN (SELECT Submission_ID FROM acceptance)
|
Which authors did not submit to any workshop?
|
[Schema (values) (types)]: | workshop_paper | workshop : workshop_id (text) , date (number) , venue (text) , name (text) | submission : submission_id (text) , scores (number) , author (text) , college (text) | Acceptance : submission_id (text) , workshop_id (number) , result (text);
|
[Primary Keys]: workshop : workshop_id, submission : submission_id, acceptance : submission_id
|
[Foreign Keys]: acceptance : workshop_id = workshop : workshop_id | acceptance : submission_id = submission : submission_id
|
tracking_share_transactions
|
SELECT count(*) FROM INVESTORS
|
Find the number of investors in total.
|
[Schema (values) (types)]: | tracking_share_transactions | Investors : investor_id (text) , investor_details (number) | Lots : lot_id (text) , investor_id (number) , lot_details (text) | Ref_Transaction_Types : transaction_type_code (text) , transaction_type_description (number) | Transactions : transaction_id (text) , investor_id (number) , transaction_type_code (text) , date_of_transaction (number) , amount_of_transaction (number) , share_count (text) , other_details (text) | Sales : sales_transaction_id (text) , sales_details (number) | Purchases : purchase_transaction_id (text) , purchase_details (number) | Transactions_Lots : transaction_id (text) , lot_id (number);
|
[Primary Keys]: investors : investor_id, lots : lot_id, ref_transaction_types : transaction_type_code, transactions : transaction_id, sales : sales_transaction_id
|
[Foreign Keys]: lots : investor_id = investors : investor_id | transactions : transaction_type_code = ref_transaction_types : transaction_type_code | transactions : investor_id = investors : investor_id | sales : sales_transaction_id = transactions : transaction_id | purchases : purchase_transaction_id = transactions : transaction_id | transactions_lots : transaction_id = transactions : transaction_id | transactions_lots : lot_id = lots : lot_id
|
tracking_share_transactions
|
SELECT Investor_details FROM INVESTORS
|
Show all investor details.
|
[Schema (values) (types)]: | tracking_share_transactions | Investors : investor_id (text) , investor_details (number) | Lots : lot_id (text) , investor_id (number) , lot_details (text) | Ref_Transaction_Types : transaction_type_code (text) , transaction_type_description (number) | Transactions : transaction_id (text) , investor_id (number) , transaction_type_code (text) , date_of_transaction (number) , amount_of_transaction (number) , share_count (text) , other_details (text) | Sales : sales_transaction_id (text) , sales_details (number) | Purchases : purchase_transaction_id (text) , purchase_details (number) | Transactions_Lots : transaction_id (text) , lot_id (number);
|
[Primary Keys]: investors : investor_id, lots : lot_id, ref_transaction_types : transaction_type_code, transactions : transaction_id, sales : sales_transaction_id
|
[Foreign Keys]: lots : investor_id = investors : investor_id | transactions : transaction_type_code = ref_transaction_types : transaction_type_code | transactions : investor_id = investors : investor_id | sales : sales_transaction_id = transactions : transaction_id | purchases : purchase_transaction_id = transactions : transaction_id | transactions_lots : transaction_id = transactions : transaction_id | transactions_lots : lot_id = lots : lot_id
|
tracking_share_transactions
|
SELECT DISTINCT lot_details FROM LOTS
|
Show all distinct lot details.
|
[Schema (values) (types)]: | tracking_share_transactions | Investors : investor_id (text) , investor_details (number) | Lots : lot_id (text) , investor_id (number) , lot_details (text) | Ref_Transaction_Types : transaction_type_code (text) , transaction_type_description (number) | Transactions : transaction_id (text) , investor_id (number) , transaction_type_code (text) , date_of_transaction (number) , amount_of_transaction (number) , share_count (text) , other_details (text) | Sales : sales_transaction_id (text) , sales_details (number) | Purchases : purchase_transaction_id (text) , purchase_details (number) | Transactions_Lots : transaction_id (text) , lot_id (number);
|
[Primary Keys]: investors : investor_id, lots : lot_id, ref_transaction_types : transaction_type_code, transactions : transaction_id, sales : sales_transaction_id
|
[Foreign Keys]: lots : investor_id = investors : investor_id | transactions : transaction_type_code = ref_transaction_types : transaction_type_code | transactions : investor_id = investors : investor_id | sales : sales_transaction_id = transactions : transaction_id | purchases : purchase_transaction_id = transactions : transaction_id | transactions_lots : transaction_id = transactions : transaction_id | transactions_lots : lot_id = lots : lot_id
|
tracking_share_transactions
|
SELECT max(amount_of_transaction) FROM TRANSACTIONS
|
Show the maximum amount of transaction.
|
[Schema (values) (types)]: | tracking_share_transactions | Investors : investor_id (text) , investor_details (number) | Lots : lot_id (text) , investor_id (number) , lot_details (text) | Ref_Transaction_Types : transaction_type_code (text) , transaction_type_description (number) | Transactions : transaction_id (text) , investor_id (number) , transaction_type_code (text) , date_of_transaction (number) , amount_of_transaction (number) , share_count (text) , other_details (text) | Sales : sales_transaction_id (text) , sales_details (number) | Purchases : purchase_transaction_id (text) , purchase_details (number) | Transactions_Lots : transaction_id (text) , lot_id (number);
|
[Primary Keys]: investors : investor_id, lots : lot_id, ref_transaction_types : transaction_type_code, transactions : transaction_id, sales : sales_transaction_id
|
[Foreign Keys]: lots : investor_id = investors : investor_id | transactions : transaction_type_code = ref_transaction_types : transaction_type_code | transactions : investor_id = investors : investor_id | sales : sales_transaction_id = transactions : transaction_id | purchases : purchase_transaction_id = transactions : transaction_id | transactions_lots : transaction_id = transactions : transaction_id | transactions_lots : lot_id = lots : lot_id
|
tracking_share_transactions
|
SELECT date_of_transaction , share_count FROM TRANSACTIONS
|
Show all date and share count of transactions.
|
[Schema (values) (types)]: | tracking_share_transactions | Investors : investor_id (text) , investor_details (number) | Lots : lot_id (text) , investor_id (number) , lot_details (text) | Ref_Transaction_Types : transaction_type_code (text) , transaction_type_description (number) | Transactions : transaction_id (text) , investor_id (number) , transaction_type_code (text) , date_of_transaction (number) , amount_of_transaction (number) , share_count (text) , other_details (text) | Sales : sales_transaction_id (text) , sales_details (number) | Purchases : purchase_transaction_id (text) , purchase_details (number) | Transactions_Lots : transaction_id (text) , lot_id (number);
|
[Primary Keys]: investors : investor_id, lots : lot_id, ref_transaction_types : transaction_type_code, transactions : transaction_id, sales : sales_transaction_id
|
[Foreign Keys]: lots : investor_id = investors : investor_id | transactions : transaction_type_code = ref_transaction_types : transaction_type_code | transactions : investor_id = investors : investor_id | sales : sales_transaction_id = transactions : transaction_id | purchases : purchase_transaction_id = transactions : transaction_id | transactions_lots : transaction_id = transactions : transaction_id | transactions_lots : lot_id = lots : lot_id
|
tracking_share_transactions
|
SELECT sum(share_count) FROM TRANSACTIONS
|
What is the total share of transactions?
|
[Schema (values) (types)]: | tracking_share_transactions | Investors : investor_id (text) , investor_details (number) | Lots : lot_id (text) , investor_id (number) , lot_details (text) | Ref_Transaction_Types : transaction_type_code (text) , transaction_type_description (number) | Transactions : transaction_id (text) , investor_id (number) , transaction_type_code (text) , date_of_transaction (number) , amount_of_transaction (number) , share_count (text) , other_details (text) | Sales : sales_transaction_id (text) , sales_details (number) | Purchases : purchase_transaction_id (text) , purchase_details (number) | Transactions_Lots : transaction_id (text) , lot_id (number);
|
[Primary Keys]: investors : investor_id, lots : lot_id, ref_transaction_types : transaction_type_code, transactions : transaction_id, sales : sales_transaction_id
|
[Foreign Keys]: lots : investor_id = investors : investor_id | transactions : transaction_type_code = ref_transaction_types : transaction_type_code | transactions : investor_id = investors : investor_id | sales : sales_transaction_id = transactions : transaction_id | purchases : purchase_transaction_id = transactions : transaction_id | transactions_lots : transaction_id = transactions : transaction_id | transactions_lots : lot_id = lots : lot_id
|
tracking_share_transactions
|
SELECT transaction_id FROM TRANSACTIONS WHERE transaction_type_code = 'PUR'
|
Show all transaction ids with transaction code 'PUR'.
|
[Schema (values) (types)]: | tracking_share_transactions | Investors : investor_id (text) , investor_details (number) | Lots : lot_id (text) , investor_id (number) , lot_details (text) | Ref_Transaction_Types : transaction_type_code (text) , transaction_type_description (number) | Transactions : transaction_id (text) , investor_id (number) , transaction_type_code (text) , date_of_transaction (number) , amount_of_transaction (number) , share_count (text) , other_details (text) | Sales : sales_transaction_id (text) , sales_details (number) | Purchases : purchase_transaction_id (text) , purchase_details (number) | Transactions_Lots : transaction_id (text) , lot_id (number);
|
[Primary Keys]: investors : investor_id, lots : lot_id, ref_transaction_types : transaction_type_code, transactions : transaction_id, sales : sales_transaction_id
|
[Foreign Keys]: lots : investor_id = investors : investor_id | transactions : transaction_type_code = ref_transaction_types : transaction_type_code | transactions : investor_id = investors : investor_id | sales : sales_transaction_id = transactions : transaction_id | purchases : purchase_transaction_id = transactions : transaction_id | transactions_lots : transaction_id = transactions : transaction_id | transactions_lots : lot_id = lots : lot_id
|
tracking_share_transactions
|
SELECT date_of_transaction FROM TRANSACTIONS WHERE transaction_type_code = "SALE"
|
Show all dates of transactions whose type code is "SALE".
|
[Schema (values) (types)]: | tracking_share_transactions | Investors : investor_id (text) , investor_details (number) | Lots : lot_id (text) , investor_id (number) , lot_details (text) | Ref_Transaction_Types : transaction_type_code (text) , transaction_type_description (number) | Transactions : transaction_id (text) , investor_id (number) , transaction_type_code (text) , date_of_transaction (number) , amount_of_transaction (number) , share_count (text) , other_details (text) | Sales : sales_transaction_id (text) , sales_details (number) | Purchases : purchase_transaction_id (text) , purchase_details (number) | Transactions_Lots : transaction_id (text) , lot_id (number);
|
[Primary Keys]: investors : investor_id, lots : lot_id, ref_transaction_types : transaction_type_code, transactions : transaction_id, sales : sales_transaction_id
|
[Foreign Keys]: lots : investor_id = investors : investor_id | transactions : transaction_type_code = ref_transaction_types : transaction_type_code | transactions : investor_id = investors : investor_id | sales : sales_transaction_id = transactions : transaction_id | purchases : purchase_transaction_id = transactions : transaction_id | transactions_lots : transaction_id = transactions : transaction_id | transactions_lots : lot_id = lots : lot_id
|
tracking_share_transactions
|
SELECT avg(amount_of_transaction) FROM TRANSACTIONS WHERE transaction_type_code = "SALE"
|
Show the average amount of transactions with type code "SALE".
|
[Schema (values) (types)]: | tracking_share_transactions | Investors : investor_id (text) , investor_details (number) | Lots : lot_id (text) , investor_id (number) , lot_details (text) | Ref_Transaction_Types : transaction_type_code (text) , transaction_type_description (number) | Transactions : transaction_id (text) , investor_id (number) , transaction_type_code (text) , date_of_transaction (number) , amount_of_transaction (number) , share_count (text) , other_details (text) | Sales : sales_transaction_id (text) , sales_details (number) | Purchases : purchase_transaction_id (text) , purchase_details (number) | Transactions_Lots : transaction_id (text) , lot_id (number);
|
[Primary Keys]: investors : investor_id, lots : lot_id, ref_transaction_types : transaction_type_code, transactions : transaction_id, sales : sales_transaction_id
|
[Foreign Keys]: lots : investor_id = investors : investor_id | transactions : transaction_type_code = ref_transaction_types : transaction_type_code | transactions : investor_id = investors : investor_id | sales : sales_transaction_id = transactions : transaction_id | purchases : purchase_transaction_id = transactions : transaction_id | transactions_lots : transaction_id = transactions : transaction_id | transactions_lots : lot_id = lots : lot_id
|
tracking_share_transactions
|
SELECT transaction_type_description FROM Ref_Transaction_Types WHERE transaction_type_code = "PUR"
|
Show the description of transaction type with code "PUR".
|
[Schema (values) (types)]: | tracking_share_transactions | Investors : investor_id (text) , investor_details (number) | Lots : lot_id (text) , investor_id (number) , lot_details (text) | Ref_Transaction_Types : transaction_type_code (text) , transaction_type_description (number) | Transactions : transaction_id (text) , investor_id (number) , transaction_type_code (text) , date_of_transaction (number) , amount_of_transaction (number) , share_count (text) , other_details (text) | Sales : sales_transaction_id (text) , sales_details (number) | Purchases : purchase_transaction_id (text) , purchase_details (number) | Transactions_Lots : transaction_id (text) , lot_id (number);
|
[Primary Keys]: investors : investor_id, lots : lot_id, ref_transaction_types : transaction_type_code, transactions : transaction_id, sales : sales_transaction_id
|
[Foreign Keys]: lots : investor_id = investors : investor_id | transactions : transaction_type_code = ref_transaction_types : transaction_type_code | transactions : investor_id = investors : investor_id | sales : sales_transaction_id = transactions : transaction_id | purchases : purchase_transaction_id = transactions : transaction_id | transactions_lots : transaction_id = transactions : transaction_id | transactions_lots : lot_id = lots : lot_id
|
tracking_share_transactions
|
SELECT min(amount_of_transaction) FROM TRANSACTIONS WHERE transaction_type_code = "PUR" AND share_count > 50
|
Show the minimum amount of transactions whose type code is "PUR" and whose share count is bigger than 50.
|
[Schema (values) (types)]: | tracking_share_transactions | Investors : investor_id (text) , investor_details (number) | Lots : lot_id (text) , investor_id (number) , lot_details (text) | Ref_Transaction_Types : transaction_type_code (text) , transaction_type_description (number) | Transactions : transaction_id (text) , investor_id (number) , transaction_type_code (text) , date_of_transaction (number) , amount_of_transaction (number) , share_count (text) , other_details (text) | Sales : sales_transaction_id (text) , sales_details (number) | Purchases : purchase_transaction_id (text) , purchase_details (number) | Transactions_Lots : transaction_id (text) , lot_id (number);
|
[Primary Keys]: investors : investor_id, lots : lot_id, ref_transaction_types : transaction_type_code, transactions : transaction_id, sales : sales_transaction_id
|
[Foreign Keys]: lots : investor_id = investors : investor_id | transactions : transaction_type_code = ref_transaction_types : transaction_type_code | transactions : investor_id = investors : investor_id | sales : sales_transaction_id = transactions : transaction_id | purchases : purchase_transaction_id = transactions : transaction_id | transactions_lots : transaction_id = transactions : transaction_id | transactions_lots : lot_id = lots : lot_id
|
tracking_share_transactions
|
SELECT max(share_count) FROM TRANSACTIONS WHERE amount_of_transaction < 10000
|
Show the maximum share count of transactions where the amount is smaller than 10000
|
[Schema (values) (types)]: | tracking_share_transactions | Investors : investor_id (text) , investor_details (number) | Lots : lot_id (text) , investor_id (number) , lot_details (text) | Ref_Transaction_Types : transaction_type_code (text) , transaction_type_description (number) | Transactions : transaction_id (text) , investor_id (number) , transaction_type_code (text) , date_of_transaction (number) , amount_of_transaction (number) , share_count (text) , other_details (text) | Sales : sales_transaction_id (text) , sales_details (number) | Purchases : purchase_transaction_id (text) , purchase_details (number) | Transactions_Lots : transaction_id (text) , lot_id (number);
|
[Primary Keys]: investors : investor_id, lots : lot_id, ref_transaction_types : transaction_type_code, transactions : transaction_id, sales : sales_transaction_id
|
[Foreign Keys]: lots : investor_id = investors : investor_id | transactions : transaction_type_code = ref_transaction_types : transaction_type_code | transactions : investor_id = investors : investor_id | sales : sales_transaction_id = transactions : transaction_id | purchases : purchase_transaction_id = transactions : transaction_id | transactions_lots : transaction_id = transactions : transaction_id | transactions_lots : lot_id = lots : lot_id
|
tracking_share_transactions
|
SELECT date_of_transaction FROM TRANSACTIONS WHERE share_count > 100 OR amount_of_transaction > 1000
|
Show the dates of transactions if the share count is bigger than 100 or the amount is bigger than 1000.
|
[Schema (values) (types)]: | tracking_share_transactions | Investors : investor_id (text) , investor_details (number) | Lots : lot_id (text) , investor_id (number) , lot_details (text) | Ref_Transaction_Types : transaction_type_code (text) , transaction_type_description (number) | Transactions : transaction_id (text) , investor_id (number) , transaction_type_code (text) , date_of_transaction (number) , amount_of_transaction (number) , share_count (text) , other_details (text) | Sales : sales_transaction_id (text) , sales_details (number) | Purchases : purchase_transaction_id (text) , purchase_details (number) | Transactions_Lots : transaction_id (text) , lot_id (number);
|
[Primary Keys]: investors : investor_id, lots : lot_id, ref_transaction_types : transaction_type_code, transactions : transaction_id, sales : sales_transaction_id
|
[Foreign Keys]: lots : investor_id = investors : investor_id | transactions : transaction_type_code = ref_transaction_types : transaction_type_code | transactions : investor_id = investors : investor_id | sales : sales_transaction_id = transactions : transaction_id | purchases : purchase_transaction_id = transactions : transaction_id | transactions_lots : transaction_id = transactions : transaction_id | transactions_lots : lot_id = lots : lot_id
|
tracking_share_transactions
|
SELECT T1.transaction_type_description , T2.date_of_transaction FROM Ref_Transaction_Types AS T1 JOIN TRANSACTIONS AS T2 ON T1.transaction_type_code = T2.transaction_type_code WHERE T2.share_count < 10
|
Show the transaction type descriptions and dates if the share count is smaller than 10.
|
[Schema (values) (types)]: | tracking_share_transactions | Investors : investor_id (text) , investor_details (number) | Lots : lot_id (text) , investor_id (number) , lot_details (text) | Ref_Transaction_Types : transaction_type_code (text) , transaction_type_description (number) | Transactions : transaction_id (text) , investor_id (number) , transaction_type_code (text) , date_of_transaction (number) , amount_of_transaction (number) , share_count (text) , other_details (text) | Sales : sales_transaction_id (text) , sales_details (number) | Purchases : purchase_transaction_id (text) , purchase_details (number) | Transactions_Lots : transaction_id (text) , lot_id (number);
|
[Primary Keys]: investors : investor_id, lots : lot_id, ref_transaction_types : transaction_type_code, transactions : transaction_id, sales : sales_transaction_id
|
[Foreign Keys]: lots : investor_id = investors : investor_id | transactions : transaction_type_code = ref_transaction_types : transaction_type_code | transactions : investor_id = investors : investor_id | sales : sales_transaction_id = transactions : transaction_id | purchases : purchase_transaction_id = transactions : transaction_id | transactions_lots : transaction_id = transactions : transaction_id | transactions_lots : lot_id = lots : lot_id
|
tracking_share_transactions
|
SELECT T1.Investor_details FROM INVESTORS AS T1 JOIN TRANSACTIONS AS T2 ON T1.investor_id = T2.investor_id WHERE T2.share_count > 100
|
Show details of all investors if they make any transaction with share count greater than 100.
|
[Schema (values) (types)]: | tracking_share_transactions | Investors : investor_id (text) , investor_details (number) | Lots : lot_id (text) , investor_id (number) , lot_details (text) | Ref_Transaction_Types : transaction_type_code (text) , transaction_type_description (number) | Transactions : transaction_id (text) , investor_id (number) , transaction_type_code (text) , date_of_transaction (number) , amount_of_transaction (number) , share_count (text) , other_details (text) | Sales : sales_transaction_id (text) , sales_details (number) | Purchases : purchase_transaction_id (text) , purchase_details (number) | Transactions_Lots : transaction_id (text) , lot_id (number);
|
[Primary Keys]: investors : investor_id, lots : lot_id, ref_transaction_types : transaction_type_code, transactions : transaction_id, sales : sales_transaction_id
|
[Foreign Keys]: lots : investor_id = investors : investor_id | transactions : transaction_type_code = ref_transaction_types : transaction_type_code | transactions : investor_id = investors : investor_id | sales : sales_transaction_id = transactions : transaction_id | purchases : purchase_transaction_id = transactions : transaction_id | transactions_lots : transaction_id = transactions : transaction_id | transactions_lots : lot_id = lots : lot_id
|
tracking_share_transactions
|
SELECT COUNT(DISTINCT transaction_type_code) FROM TRANSACTIONS
|
How many distinct transaction types are used in the transactions?
|
[Schema (values) (types)]: | tracking_share_transactions | Investors : investor_id (text) , investor_details (number) | Lots : lot_id (text) , investor_id (number) , lot_details (text) | Ref_Transaction_Types : transaction_type_code (text) , transaction_type_description (number) | Transactions : transaction_id (text) , investor_id (number) , transaction_type_code (text) , date_of_transaction (number) , amount_of_transaction (number) , share_count (text) , other_details (text) | Sales : sales_transaction_id (text) , sales_details (number) | Purchases : purchase_transaction_id (text) , purchase_details (number) | Transactions_Lots : transaction_id (text) , lot_id (number);
|
[Primary Keys]: investors : investor_id, lots : lot_id, ref_transaction_types : transaction_type_code, transactions : transaction_id, sales : sales_transaction_id
|
[Foreign Keys]: lots : investor_id = investors : investor_id | transactions : transaction_type_code = ref_transaction_types : transaction_type_code | transactions : investor_id = investors : investor_id | sales : sales_transaction_id = transactions : transaction_id | purchases : purchase_transaction_id = transactions : transaction_id | transactions_lots : transaction_id = transactions : transaction_id | transactions_lots : lot_id = lots : lot_id
|
tracking_share_transactions
|
SELECT lot_details , investor_id FROM LOTS
|
Return the lot details and investor ids.
|
[Schema (values) (types)]: | tracking_share_transactions | Investors : investor_id (text) , investor_details (number) | Lots : lot_id (text) , investor_id (number) , lot_details (text) | Ref_Transaction_Types : transaction_type_code (text) , transaction_type_description (number) | Transactions : transaction_id (text) , investor_id (number) , transaction_type_code (text) , date_of_transaction (number) , amount_of_transaction (number) , share_count (text) , other_details (text) | Sales : sales_transaction_id (text) , sales_details (number) | Purchases : purchase_transaction_id (text) , purchase_details (number) | Transactions_Lots : transaction_id (text) , lot_id (number);
|
[Primary Keys]: investors : investor_id, lots : lot_id, ref_transaction_types : transaction_type_code, transactions : transaction_id, sales : sales_transaction_id
|
[Foreign Keys]: lots : investor_id = investors : investor_id | transactions : transaction_type_code = ref_transaction_types : transaction_type_code | transactions : investor_id = investors : investor_id | sales : sales_transaction_id = transactions : transaction_id | purchases : purchase_transaction_id = transactions : transaction_id | transactions_lots : transaction_id = transactions : transaction_id | transactions_lots : lot_id = lots : lot_id
|
tracking_share_transactions
|
SELECT T2.lot_details FROM INVESTORS AS T1 JOIN LOTS AS T2 ON T1.investor_id = T2.investor_id WHERE T1.Investor_details = "l"
|
Return the lot details of lots that belong to investors with details "l"?
|
[Schema (values) (types)]: | tracking_share_transactions | Investors : investor_id (text) , investor_details (number) | Lots : lot_id (text) , investor_id (number) , lot_details (text) | Ref_Transaction_Types : transaction_type_code (text) , transaction_type_description (number) | Transactions : transaction_id (text) , investor_id (number) , transaction_type_code (text) , date_of_transaction (number) , amount_of_transaction (number) , share_count (text) , other_details (text) | Sales : sales_transaction_id (text) , sales_details (number) | Purchases : purchase_transaction_id (text) , purchase_details (number) | Transactions_Lots : transaction_id (text) , lot_id (number);
|
[Primary Keys]: investors : investor_id, lots : lot_id, ref_transaction_types : transaction_type_code, transactions : transaction_id, sales : sales_transaction_id
|
[Foreign Keys]: lots : investor_id = investors : investor_id | transactions : transaction_type_code = ref_transaction_types : transaction_type_code | transactions : investor_id = investors : investor_id | sales : sales_transaction_id = transactions : transaction_id | purchases : purchase_transaction_id = transactions : transaction_id | transactions_lots : transaction_id = transactions : transaction_id | transactions_lots : lot_id = lots : lot_id
|
tracking_share_transactions
|
SELECT T1.purchase_details FROM PURCHASES AS T1 JOIN TRANSACTIONS AS T2 ON T1.purchase_transaction_id = T2.transaction_id WHERE T2.amount_of_transaction > 10000
|
What are the purchase details of transactions with amount bigger than 10000?
|
[Schema (values) (types)]: | tracking_share_transactions | Investors : investor_id (text) , investor_details (number) | Lots : lot_id (text) , investor_id (number) , lot_details (text) | Ref_Transaction_Types : transaction_type_code (text) , transaction_type_description (number) | Transactions : transaction_id (text) , investor_id (number) , transaction_type_code (text) , date_of_transaction (number) , amount_of_transaction (number) , share_count (text) , other_details (text) | Sales : sales_transaction_id (text) , sales_details (number) | Purchases : purchase_transaction_id (text) , purchase_details (number) | Transactions_Lots : transaction_id (text) , lot_id (number);
|
[Primary Keys]: investors : investor_id, lots : lot_id, ref_transaction_types : transaction_type_code, transactions : transaction_id, sales : sales_transaction_id
|
[Foreign Keys]: lots : investor_id = investors : investor_id | transactions : transaction_type_code = ref_transaction_types : transaction_type_code | transactions : investor_id = investors : investor_id | sales : sales_transaction_id = transactions : transaction_id | purchases : purchase_transaction_id = transactions : transaction_id | transactions_lots : transaction_id = transactions : transaction_id | transactions_lots : lot_id = lots : lot_id
|
tracking_share_transactions
|
SELECT T1.sales_details , T2.date_of_transaction FROM SALES AS T1 JOIN TRANSACTIONS AS T2 ON T1.sales_transaction_id = T2.transaction_id WHERE T2.amount_of_transaction < 3000
|
What are the sale details and dates of transactions with amount smaller than 3000?
|
[Schema (values) (types)]: | tracking_share_transactions | Investors : investor_id (text) , investor_details (number) | Lots : lot_id (text) , investor_id (number) , lot_details (text) | Ref_Transaction_Types : transaction_type_code (text) , transaction_type_description (number) | Transactions : transaction_id (text) , investor_id (number) , transaction_type_code (text) , date_of_transaction (number) , amount_of_transaction (number) , share_count (text) , other_details (text) | Sales : sales_transaction_id (text) , sales_details (number) | Purchases : purchase_transaction_id (text) , purchase_details (number) | Transactions_Lots : transaction_id (text) , lot_id (number);
|
[Primary Keys]: investors : investor_id, lots : lot_id, ref_transaction_types : transaction_type_code, transactions : transaction_id, sales : sales_transaction_id
|
[Foreign Keys]: lots : investor_id = investors : investor_id | transactions : transaction_type_code = ref_transaction_types : transaction_type_code | transactions : investor_id = investors : investor_id | sales : sales_transaction_id = transactions : transaction_id | purchases : purchase_transaction_id = transactions : transaction_id | transactions_lots : transaction_id = transactions : transaction_id | transactions_lots : lot_id = lots : lot_id
|
tracking_share_transactions
|
SELECT T1.lot_details FROM LOTS AS T1 JOIN TRANSACTIONS_LOTS AS T2 ON T1.lot_id = T2.transaction_id JOIN TRANSACTIONS AS T3 ON T2.transaction_id = T3.transaction_id WHERE T3.share_count < 50
|
What are the lot details of lots associated with transactions with share count smaller than 50?
|
[Schema (values) (types)]: | tracking_share_transactions | Investors : investor_id (text) , investor_details (number) | Lots : lot_id (text) , investor_id (number) , lot_details (text) | Ref_Transaction_Types : transaction_type_code (text) , transaction_type_description (number) | Transactions : transaction_id (text) , investor_id (number) , transaction_type_code (text) , date_of_transaction (number) , amount_of_transaction (number) , share_count (text) , other_details (text) | Sales : sales_transaction_id (text) , sales_details (number) | Purchases : purchase_transaction_id (text) , purchase_details (number) | Transactions_Lots : transaction_id (text) , lot_id (number);
|
[Primary Keys]: investors : investor_id, lots : lot_id, ref_transaction_types : transaction_type_code, transactions : transaction_id, sales : sales_transaction_id
|
[Foreign Keys]: lots : investor_id = investors : investor_id | transactions : transaction_type_code = ref_transaction_types : transaction_type_code | transactions : investor_id = investors : investor_id | sales : sales_transaction_id = transactions : transaction_id | purchases : purchase_transaction_id = transactions : transaction_id | transactions_lots : transaction_id = transactions : transaction_id | transactions_lots : lot_id = lots : lot_id
|
tracking_share_transactions
|
SELECT T1.lot_details FROM LOTS AS T1 JOIN TRANSACTIONS_LOTS AS T2 ON T1.lot_id = T2.transaction_id JOIN TRANSACTIONS AS T3 ON T2.transaction_id = T3.transaction_id WHERE T3.share_count > 100 AND T3.transaction_type_code = "PUR"
|
What are the lot details of lots associated with transactions whose share count is bigger than 100 and whose type code is "PUR"?
|
[Schema (values) (types)]: | tracking_share_transactions | Investors : investor_id (text) , investor_details (number) | Lots : lot_id (text) , investor_id (number) , lot_details (text) | Ref_Transaction_Types : transaction_type_code (text) , transaction_type_description (number) | Transactions : transaction_id (text) , investor_id (number) , transaction_type_code (text) , date_of_transaction (number) , amount_of_transaction (number) , share_count (text) , other_details (text) | Sales : sales_transaction_id (text) , sales_details (number) | Purchases : purchase_transaction_id (text) , purchase_details (number) | Transactions_Lots : transaction_id (text) , lot_id (number);
|
[Primary Keys]: investors : investor_id, lots : lot_id, ref_transaction_types : transaction_type_code, transactions : transaction_id, sales : sales_transaction_id
|
[Foreign Keys]: lots : investor_id = investors : investor_id | transactions : transaction_type_code = ref_transaction_types : transaction_type_code | transactions : investor_id = investors : investor_id | sales : sales_transaction_id = transactions : transaction_id | purchases : purchase_transaction_id = transactions : transaction_id | transactions_lots : transaction_id = transactions : transaction_id | transactions_lots : lot_id = lots : lot_id
|
tracking_share_transactions
|
SELECT transaction_type_code , avg(amount_of_transaction) FROM TRANSACTIONS GROUP BY transaction_type_code
|
Show the average transaction amount for different transaction types.
|
[Schema (values) (types)]: | tracking_share_transactions | Investors : investor_id (text) , investor_details (number) | Lots : lot_id (text) , investor_id (number) , lot_details (text) | Ref_Transaction_Types : transaction_type_code (text) , transaction_type_description (number) | Transactions : transaction_id (text) , investor_id (number) , transaction_type_code (text) , date_of_transaction (number) , amount_of_transaction (number) , share_count (text) , other_details (text) | Sales : sales_transaction_id (text) , sales_details (number) | Purchases : purchase_transaction_id (text) , purchase_details (number) | Transactions_Lots : transaction_id (text) , lot_id (number);
|
[Primary Keys]: investors : investor_id, lots : lot_id, ref_transaction_types : transaction_type_code, transactions : transaction_id, sales : sales_transaction_id
|
[Foreign Keys]: lots : investor_id = investors : investor_id | transactions : transaction_type_code = ref_transaction_types : transaction_type_code | transactions : investor_id = investors : investor_id | sales : sales_transaction_id = transactions : transaction_id | purchases : purchase_transaction_id = transactions : transaction_id | transactions_lots : transaction_id = transactions : transaction_id | transactions_lots : lot_id = lots : lot_id
|
tracking_share_transactions
|
SELECT transaction_type_code , max(share_count) , min(share_count) FROM TRANSACTIONS GROUP BY transaction_type_code
|
Show the maximum and minimum share count of different transaction types.
|
[Schema (values) (types)]: | tracking_share_transactions | Investors : investor_id (text) , investor_details (number) | Lots : lot_id (text) , investor_id (number) , lot_details (text) | Ref_Transaction_Types : transaction_type_code (text) , transaction_type_description (number) | Transactions : transaction_id (text) , investor_id (number) , transaction_type_code (text) , date_of_transaction (number) , amount_of_transaction (number) , share_count (text) , other_details (text) | Sales : sales_transaction_id (text) , sales_details (number) | Purchases : purchase_transaction_id (text) , purchase_details (number) | Transactions_Lots : transaction_id (text) , lot_id (number);
|
[Primary Keys]: investors : investor_id, lots : lot_id, ref_transaction_types : transaction_type_code, transactions : transaction_id, sales : sales_transaction_id
|
[Foreign Keys]: lots : investor_id = investors : investor_id | transactions : transaction_type_code = ref_transaction_types : transaction_type_code | transactions : investor_id = investors : investor_id | sales : sales_transaction_id = transactions : transaction_id | purchases : purchase_transaction_id = transactions : transaction_id | transactions_lots : transaction_id = transactions : transaction_id | transactions_lots : lot_id = lots : lot_id
|
tracking_share_transactions
|
SELECT investor_id , avg(share_count) FROM TRANSACTIONS GROUP BY investor_id
|
Show the average share count of transactions for different investors.
|
[Schema (values) (types)]: | tracking_share_transactions | Investors : investor_id (text) , investor_details (number) | Lots : lot_id (text) , investor_id (number) , lot_details (text) | Ref_Transaction_Types : transaction_type_code (text) , transaction_type_description (number) | Transactions : transaction_id (text) , investor_id (number) , transaction_type_code (text) , date_of_transaction (number) , amount_of_transaction (number) , share_count (text) , other_details (text) | Sales : sales_transaction_id (text) , sales_details (number) | Purchases : purchase_transaction_id (text) , purchase_details (number) | Transactions_Lots : transaction_id (text) , lot_id (number);
|
[Primary Keys]: investors : investor_id, lots : lot_id, ref_transaction_types : transaction_type_code, transactions : transaction_id, sales : sales_transaction_id
|
[Foreign Keys]: lots : investor_id = investors : investor_id | transactions : transaction_type_code = ref_transaction_types : transaction_type_code | transactions : investor_id = investors : investor_id | sales : sales_transaction_id = transactions : transaction_id | purchases : purchase_transaction_id = transactions : transaction_id | transactions_lots : transaction_id = transactions : transaction_id | transactions_lots : lot_id = lots : lot_id
|
tracking_share_transactions
|
SELECT investor_id , avg(share_count) FROM TRANSACTIONS GROUP BY investor_id ORDER BY avg(share_count)
|
Show the average share count of transactions each each investor, ordered by average share count.
|
[Schema (values) (types)]: | tracking_share_transactions | Investors : investor_id (text) , investor_details (number) | Lots : lot_id (text) , investor_id (number) , lot_details (text) | Ref_Transaction_Types : transaction_type_code (text) , transaction_type_description (number) | Transactions : transaction_id (text) , investor_id (number) , transaction_type_code (text) , date_of_transaction (number) , amount_of_transaction (number) , share_count (text) , other_details (text) | Sales : sales_transaction_id (text) , sales_details (number) | Purchases : purchase_transaction_id (text) , purchase_details (number) | Transactions_Lots : transaction_id (text) , lot_id (number);
|
[Primary Keys]: investors : investor_id, lots : lot_id, ref_transaction_types : transaction_type_code, transactions : transaction_id, sales : sales_transaction_id
|
[Foreign Keys]: lots : investor_id = investors : investor_id | transactions : transaction_type_code = ref_transaction_types : transaction_type_code | transactions : investor_id = investors : investor_id | sales : sales_transaction_id = transactions : transaction_id | purchases : purchase_transaction_id = transactions : transaction_id | transactions_lots : transaction_id = transactions : transaction_id | transactions_lots : lot_id = lots : lot_id
|
tracking_share_transactions
|
SELECT investor_id , avg(amount_of_transaction) FROM TRANSACTIONS GROUP BY investor_id
|
Show the average amount of transactions for different investors.
|
[Schema (values) (types)]: | tracking_share_transactions | Investors : investor_id (text) , investor_details (number) | Lots : lot_id (text) , investor_id (number) , lot_details (text) | Ref_Transaction_Types : transaction_type_code (text) , transaction_type_description (number) | Transactions : transaction_id (text) , investor_id (number) , transaction_type_code (text) , date_of_transaction (number) , amount_of_transaction (number) , share_count (text) , other_details (text) | Sales : sales_transaction_id (text) , sales_details (number) | Purchases : purchase_transaction_id (text) , purchase_details (number) | Transactions_Lots : transaction_id (text) , lot_id (number);
|
[Primary Keys]: investors : investor_id, lots : lot_id, ref_transaction_types : transaction_type_code, transactions : transaction_id, sales : sales_transaction_id
|
[Foreign Keys]: lots : investor_id = investors : investor_id | transactions : transaction_type_code = ref_transaction_types : transaction_type_code | transactions : investor_id = investors : investor_id | sales : sales_transaction_id = transactions : transaction_id | purchases : purchase_transaction_id = transactions : transaction_id | transactions_lots : transaction_id = transactions : transaction_id | transactions_lots : lot_id = lots : lot_id
|
tracking_share_transactions
|
SELECT T2.lot_id , avg(amount_of_transaction) FROM TRANSACTIONS AS T1 JOIN Transactions_Lots AS T2 ON T1.transaction_id = T2.transaction_id GROUP BY T2.lot_id
|
Show the average amount of transactions for different lots.
|
[Schema (values) (types)]: | tracking_share_transactions | Investors : investor_id (text) , investor_details (number) | Lots : lot_id (text) , investor_id (number) , lot_details (text) | Ref_Transaction_Types : transaction_type_code (text) , transaction_type_description (number) | Transactions : transaction_id (text) , investor_id (number) , transaction_type_code (text) , date_of_transaction (number) , amount_of_transaction (number) , share_count (text) , other_details (text) | Sales : sales_transaction_id (text) , sales_details (number) | Purchases : purchase_transaction_id (text) , purchase_details (number) | Transactions_Lots : transaction_id (text) , lot_id (number);
|
[Primary Keys]: investors : investor_id, lots : lot_id, ref_transaction_types : transaction_type_code, transactions : transaction_id, sales : sales_transaction_id
|
[Foreign Keys]: lots : investor_id = investors : investor_id | transactions : transaction_type_code = ref_transaction_types : transaction_type_code | transactions : investor_id = investors : investor_id | sales : sales_transaction_id = transactions : transaction_id | purchases : purchase_transaction_id = transactions : transaction_id | transactions_lots : transaction_id = transactions : transaction_id | transactions_lots : lot_id = lots : lot_id
|
tracking_share_transactions
|
SELECT T2.lot_id , avg(amount_of_transaction) FROM TRANSACTIONS AS T1 JOIN Transactions_Lots AS T2 ON T1.transaction_id = T2.transaction_id GROUP BY T2.lot_id ORDER BY avg(amount_of_transaction)
|
Show the average amount of transactions for different lots, ordered by average amount of transactions.
|
[Schema (values) (types)]: | tracking_share_transactions | Investors : investor_id (text) , investor_details (number) | Lots : lot_id (text) , investor_id (number) , lot_details (text) | Ref_Transaction_Types : transaction_type_code (text) , transaction_type_description (number) | Transactions : transaction_id (text) , investor_id (number) , transaction_type_code (text) , date_of_transaction (number) , amount_of_transaction (number) , share_count (text) , other_details (text) | Sales : sales_transaction_id (text) , sales_details (number) | Purchases : purchase_transaction_id (text) , purchase_details (number) | Transactions_Lots : transaction_id (text) , lot_id (number);
|
[Primary Keys]: investors : investor_id, lots : lot_id, ref_transaction_types : transaction_type_code, transactions : transaction_id, sales : sales_transaction_id
|
[Foreign Keys]: lots : investor_id = investors : investor_id | transactions : transaction_type_code = ref_transaction_types : transaction_type_code | transactions : investor_id = investors : investor_id | sales : sales_transaction_id = transactions : transaction_id | purchases : purchase_transaction_id = transactions : transaction_id | transactions_lots : transaction_id = transactions : transaction_id | transactions_lots : lot_id = lots : lot_id
|
tracking_share_transactions
|
SELECT investor_id , COUNT(*) FROM TRANSACTIONS WHERE transaction_type_code = "SALE" GROUP BY investor_id
|
Show the number of transactions with transaction type code "SALE" for different investors if it is larger than 0.
|
[Schema (values) (types)]: | tracking_share_transactions | Investors : investor_id (text) , investor_details (number) | Lots : lot_id (text) , investor_id (number) , lot_details (text) | Ref_Transaction_Types : transaction_type_code (text) , transaction_type_description (number) | Transactions : transaction_id (text) , investor_id (number) , transaction_type_code (text) , date_of_transaction (number) , amount_of_transaction (number) , share_count (text) , other_details (text) | Sales : sales_transaction_id (text) , sales_details (number) | Purchases : purchase_transaction_id (text) , purchase_details (number) | Transactions_Lots : transaction_id (text) , lot_id (number);
|
[Primary Keys]: investors : investor_id, lots : lot_id, ref_transaction_types : transaction_type_code, transactions : transaction_id, sales : sales_transaction_id
|
[Foreign Keys]: lots : investor_id = investors : investor_id | transactions : transaction_type_code = ref_transaction_types : transaction_type_code | transactions : investor_id = investors : investor_id | sales : sales_transaction_id = transactions : transaction_id | purchases : purchase_transaction_id = transactions : transaction_id | transactions_lots : transaction_id = transactions : transaction_id | transactions_lots : lot_id = lots : lot_id
|
tracking_share_transactions
|
SELECT investor_id , COUNT(*) FROM TRANSACTIONS GROUP BY investor_id
|
Show the number of transactions for different investors.
|
[Schema (values) (types)]: | tracking_share_transactions | Investors : investor_id (text) , investor_details (number) | Lots : lot_id (text) , investor_id (number) , lot_details (text) | Ref_Transaction_Types : transaction_type_code (text) , transaction_type_description (number) | Transactions : transaction_id (text) , investor_id (number) , transaction_type_code (text) , date_of_transaction (number) , amount_of_transaction (number) , share_count (text) , other_details (text) | Sales : sales_transaction_id (text) , sales_details (number) | Purchases : purchase_transaction_id (text) , purchase_details (number) | Transactions_Lots : transaction_id (text) , lot_id (number);
|
[Primary Keys]: investors : investor_id, lots : lot_id, ref_transaction_types : transaction_type_code, transactions : transaction_id, sales : sales_transaction_id
|
[Foreign Keys]: lots : investor_id = investors : investor_id | transactions : transaction_type_code = ref_transaction_types : transaction_type_code | transactions : investor_id = investors : investor_id | sales : sales_transaction_id = transactions : transaction_id | purchases : purchase_transaction_id = transactions : transaction_id | transactions_lots : transaction_id = transactions : transaction_id | transactions_lots : lot_id = lots : lot_id
|
tracking_share_transactions
|
SELECT transaction_type_code FROM TRANSACTIONS GROUP BY transaction_type_code ORDER BY COUNT(*) ASC LIMIT 1
|
Show the transaction type code that occurs the fewest times.
|
[Schema (values) (types)]: | tracking_share_transactions | Investors : investor_id (text) , investor_details (number) | Lots : lot_id (text) , investor_id (number) , lot_details (text) | Ref_Transaction_Types : transaction_type_code (text) , transaction_type_description (number) | Transactions : transaction_id (text) , investor_id (number) , transaction_type_code (text) , date_of_transaction (number) , amount_of_transaction (number) , share_count (text) , other_details (text) | Sales : sales_transaction_id (text) , sales_details (number) | Purchases : purchase_transaction_id (text) , purchase_details (number) | Transactions_Lots : transaction_id (text) , lot_id (number);
|
[Primary Keys]: investors : investor_id, lots : lot_id, ref_transaction_types : transaction_type_code, transactions : transaction_id, sales : sales_transaction_id
|
[Foreign Keys]: lots : investor_id = investors : investor_id | transactions : transaction_type_code = ref_transaction_types : transaction_type_code | transactions : investor_id = investors : investor_id | sales : sales_transaction_id = transactions : transaction_id | purchases : purchase_transaction_id = transactions : transaction_id | transactions_lots : transaction_id = transactions : transaction_id | transactions_lots : lot_id = lots : lot_id
|
tracking_share_transactions
|
SELECT transaction_type_code FROM TRANSACTIONS GROUP BY transaction_type_code ORDER BY COUNT(*) DESC LIMIT 1
|
Show the transaction type code that occurs the most frequently.
|
[Schema (values) (types)]: | tracking_share_transactions | Investors : investor_id (text) , investor_details (number) | Lots : lot_id (text) , investor_id (number) , lot_details (text) | Ref_Transaction_Types : transaction_type_code (text) , transaction_type_description (number) | Transactions : transaction_id (text) , investor_id (number) , transaction_type_code (text) , date_of_transaction (number) , amount_of_transaction (number) , share_count (text) , other_details (text) | Sales : sales_transaction_id (text) , sales_details (number) | Purchases : purchase_transaction_id (text) , purchase_details (number) | Transactions_Lots : transaction_id (text) , lot_id (number);
|
[Primary Keys]: investors : investor_id, lots : lot_id, ref_transaction_types : transaction_type_code, transactions : transaction_id, sales : sales_transaction_id
|
[Foreign Keys]: lots : investor_id = investors : investor_id | transactions : transaction_type_code = ref_transaction_types : transaction_type_code | transactions : investor_id = investors : investor_id | sales : sales_transaction_id = transactions : transaction_id | purchases : purchase_transaction_id = transactions : transaction_id | transactions_lots : transaction_id = transactions : transaction_id | transactions_lots : lot_id = lots : lot_id
|
tracking_share_transactions
|
SELECT T1.transaction_type_description FROM Ref_Transaction_Types AS T1 JOIN TRANSACTIONS AS T2 ON T1.transaction_type_code = T2.transaction_type_code GROUP BY T1.transaction_type_code ORDER BY COUNT(*) DESC LIMIT 1
|
Show the description of the transaction type that occurs most frequently.
|
[Schema (values) (types)]: | tracking_share_transactions | Investors : investor_id (text) , investor_details (number) | Lots : lot_id (text) , investor_id (number) , lot_details (text) | Ref_Transaction_Types : transaction_type_code (text) , transaction_type_description (number) | Transactions : transaction_id (text) , investor_id (number) , transaction_type_code (text) , date_of_transaction (number) , amount_of_transaction (number) , share_count (text) , other_details (text) | Sales : sales_transaction_id (text) , sales_details (number) | Purchases : purchase_transaction_id (text) , purchase_details (number) | Transactions_Lots : transaction_id (text) , lot_id (number);
|
[Primary Keys]: investors : investor_id, lots : lot_id, ref_transaction_types : transaction_type_code, transactions : transaction_id, sales : sales_transaction_id
|
[Foreign Keys]: lots : investor_id = investors : investor_id | transactions : transaction_type_code = ref_transaction_types : transaction_type_code | transactions : investor_id = investors : investor_id | sales : sales_transaction_id = transactions : transaction_id | purchases : purchase_transaction_id = transactions : transaction_id | transactions_lots : transaction_id = transactions : transaction_id | transactions_lots : lot_id = lots : lot_id
|
tracking_share_transactions
|
SELECT T2.investor_id , T1.Investor_details FROM INVESTORS AS T1 JOIN TRANSACTIONS AS T2 ON T1.investor_id = T2.investor_id GROUP BY T2.investor_id ORDER BY COUNT(*) DESC LIMIT 1
|
Show the id and details of the investor that has the largest number of transactions.
|
[Schema (values) (types)]: | tracking_share_transactions | Investors : investor_id (text) , investor_details (number) | Lots : lot_id (text) , investor_id (number) , lot_details (text) | Ref_Transaction_Types : transaction_type_code (text) , transaction_type_description (number) | Transactions : transaction_id (text) , investor_id (number) , transaction_type_code (text) , date_of_transaction (number) , amount_of_transaction (number) , share_count (text) , other_details (text) | Sales : sales_transaction_id (text) , sales_details (number) | Purchases : purchase_transaction_id (text) , purchase_details (number) | Transactions_Lots : transaction_id (text) , lot_id (number);
|
[Primary Keys]: investors : investor_id, lots : lot_id, ref_transaction_types : transaction_type_code, transactions : transaction_id, sales : sales_transaction_id
|
[Foreign Keys]: lots : investor_id = investors : investor_id | transactions : transaction_type_code = ref_transaction_types : transaction_type_code | transactions : investor_id = investors : investor_id | sales : sales_transaction_id = transactions : transaction_id | purchases : purchase_transaction_id = transactions : transaction_id | transactions_lots : transaction_id = transactions : transaction_id | transactions_lots : lot_id = lots : lot_id
|
tracking_share_transactions
|
SELECT T2.investor_id , T1.Investor_details FROM INVESTORS AS T1 JOIN TRANSACTIONS AS T2 ON T1.investor_id = T2.investor_id GROUP BY T2.investor_id ORDER BY COUNT(*) DESC LIMIT 3
|
Show the id and details for the investors who have the top 3 number of transactions.
|
[Schema (values) (types)]: | tracking_share_transactions | Investors : investor_id (text) , investor_details (number) | Lots : lot_id (text) , investor_id (number) , lot_details (text) | Ref_Transaction_Types : transaction_type_code (text) , transaction_type_description (number) | Transactions : transaction_id (text) , investor_id (number) , transaction_type_code (text) , date_of_transaction (number) , amount_of_transaction (number) , share_count (text) , other_details (text) | Sales : sales_transaction_id (text) , sales_details (number) | Purchases : purchase_transaction_id (text) , purchase_details (number) | Transactions_Lots : transaction_id (text) , lot_id (number);
|
[Primary Keys]: investors : investor_id, lots : lot_id, ref_transaction_types : transaction_type_code, transactions : transaction_id, sales : sales_transaction_id
|
[Foreign Keys]: lots : investor_id = investors : investor_id | transactions : transaction_type_code = ref_transaction_types : transaction_type_code | transactions : investor_id = investors : investor_id | sales : sales_transaction_id = transactions : transaction_id | purchases : purchase_transaction_id = transactions : transaction_id | transactions_lots : transaction_id = transactions : transaction_id | transactions_lots : lot_id = lots : lot_id
|
tracking_share_transactions
|
SELECT T2.investor_id FROM INVESTORS AS T1 JOIN TRANSACTIONS AS T2 ON T1.investor_id = T2.investor_id GROUP BY T2.investor_id HAVING COUNT(*) >= 2
|
Show the ids of the investors who have at least two transactions.
|
[Schema (values) (types)]: | tracking_share_transactions | Investors : investor_id (text) , investor_details (number) | Lots : lot_id (text) , investor_id (number) , lot_details (text) | Ref_Transaction_Types : transaction_type_code (text) , transaction_type_description (number) | Transactions : transaction_id (text) , investor_id (number) , transaction_type_code (text) , date_of_transaction (number) , amount_of_transaction (number) , share_count (text) , other_details (text) | Sales : sales_transaction_id (text) , sales_details (number) | Purchases : purchase_transaction_id (text) , purchase_details (number) | Transactions_Lots : transaction_id (text) , lot_id (number);
|
[Primary Keys]: investors : investor_id, lots : lot_id, ref_transaction_types : transaction_type_code, transactions : transaction_id, sales : sales_transaction_id
|
[Foreign Keys]: lots : investor_id = investors : investor_id | transactions : transaction_type_code = ref_transaction_types : transaction_type_code | transactions : investor_id = investors : investor_id | sales : sales_transaction_id = transactions : transaction_id | purchases : purchase_transaction_id = transactions : transaction_id | transactions_lots : transaction_id = transactions : transaction_id | transactions_lots : lot_id = lots : lot_id
|
tracking_share_transactions
|
SELECT T2.investor_id , T1.Investor_details FROM INVESTORS AS T1 JOIN TRANSACTIONS AS T2 ON T1.investor_id = T2.investor_id WHERE T2.transaction_type_code = "SALE" GROUP BY T2.investor_id HAVING COUNT(*) >= 2
|
Show the ids and details of the investors who have at least two transactions with type code "SALE".
|
[Schema (values) (types)]: | tracking_share_transactions | Investors : investor_id (text) , investor_details (number) | Lots : lot_id (text) , investor_id (number) , lot_details (text) | Ref_Transaction_Types : transaction_type_code (text) , transaction_type_description (number) | Transactions : transaction_id (text) , investor_id (number) , transaction_type_code (text) , date_of_transaction (number) , amount_of_transaction (number) , share_count (text) , other_details (text) | Sales : sales_transaction_id (text) , sales_details (number) | Purchases : purchase_transaction_id (text) , purchase_details (number) | Transactions_Lots : transaction_id (text) , lot_id (number);
|
[Primary Keys]: investors : investor_id, lots : lot_id, ref_transaction_types : transaction_type_code, transactions : transaction_id, sales : sales_transaction_id
|
[Foreign Keys]: lots : investor_id = investors : investor_id | transactions : transaction_type_code = ref_transaction_types : transaction_type_code | transactions : investor_id = investors : investor_id | sales : sales_transaction_id = transactions : transaction_id | purchases : purchase_transaction_id = transactions : transaction_id | transactions_lots : transaction_id = transactions : transaction_id | transactions_lots : lot_id = lots : lot_id
|
tracking_share_transactions
|
SELECT date_of_transaction FROM TRANSACTIONS WHERE share_count >= 100 OR amount_of_transaction >= 100
|
What are the dates of transactions with at least 100 share count or amount bigger than 100?
|
[Schema (values) (types)]: | tracking_share_transactions | Investors : investor_id (text) , investor_details (number) | Lots : lot_id (text) , investor_id (number) , lot_details (text) | Ref_Transaction_Types : transaction_type_code (text) , transaction_type_description (number) | Transactions : transaction_id (text) , investor_id (number) , transaction_type_code (text) , date_of_transaction (number) , amount_of_transaction (number) , share_count (text) , other_details (text) | Sales : sales_transaction_id (text) , sales_details (number) | Purchases : purchase_transaction_id (text) , purchase_details (number) | Transactions_Lots : transaction_id (text) , lot_id (number);
|
[Primary Keys]: investors : investor_id, lots : lot_id, ref_transaction_types : transaction_type_code, transactions : transaction_id, sales : sales_transaction_id
|
[Foreign Keys]: lots : investor_id = investors : investor_id | transactions : transaction_type_code = ref_transaction_types : transaction_type_code | transactions : investor_id = investors : investor_id | sales : sales_transaction_id = transactions : transaction_id | purchases : purchase_transaction_id = transactions : transaction_id | transactions_lots : transaction_id = transactions : transaction_id | transactions_lots : lot_id = lots : lot_id
|
tracking_share_transactions
|
SELECT sales_details FROM sales UNION SELECT purchase_details FROM purchases
|
What are the details of all sales and purchases?
|
[Schema (values) (types)]: | tracking_share_transactions | Investors : investor_id (text) , investor_details (number) | Lots : lot_id (text) , investor_id (number) , lot_details (text) | Ref_Transaction_Types : transaction_type_code (text) , transaction_type_description (number) | Transactions : transaction_id (text) , investor_id (number) , transaction_type_code (text) , date_of_transaction (number) , amount_of_transaction (number) , share_count (text) , other_details (text) | Sales : sales_transaction_id (text) , sales_details (number) | Purchases : purchase_transaction_id (text) , purchase_details (number) | Transactions_Lots : transaction_id (text) , lot_id (number);
|
[Primary Keys]: investors : investor_id, lots : lot_id, ref_transaction_types : transaction_type_code, transactions : transaction_id, sales : sales_transaction_id
|
[Foreign Keys]: lots : investor_id = investors : investor_id | transactions : transaction_type_code = ref_transaction_types : transaction_type_code | transactions : investor_id = investors : investor_id | sales : sales_transaction_id = transactions : transaction_id | purchases : purchase_transaction_id = transactions : transaction_id | transactions_lots : transaction_id = transactions : transaction_id | transactions_lots : lot_id = lots : lot_id
|
tracking_share_transactions
|
SELECT lot_details FROM Lots EXCEPT SELECT T1.lot_details FROM Lots AS T1 JOIN transactions_lots AS T2 ON T1.lot_id = T2.lot_id
|
What are the details of the lots which are not used in any transactions?
|
[Schema (values) (types)]: | tracking_share_transactions | Investors : investor_id (text) , investor_details (number) | Lots : lot_id (text) , investor_id (number) , lot_details (text) | Ref_Transaction_Types : transaction_type_code (text) , transaction_type_description (number) | Transactions : transaction_id (text) , investor_id (number) , transaction_type_code (text) , date_of_transaction (number) , amount_of_transaction (number) , share_count (text) , other_details (text) | Sales : sales_transaction_id (text) , sales_details (number) | Purchases : purchase_transaction_id (text) , purchase_details (number) | Transactions_Lots : transaction_id (text) , lot_id (number);
|
[Primary Keys]: investors : investor_id, lots : lot_id, ref_transaction_types : transaction_type_code, transactions : transaction_id, sales : sales_transaction_id
|
[Foreign Keys]: lots : investor_id = investors : investor_id | transactions : transaction_type_code = ref_transaction_types : transaction_type_code | transactions : investor_id = investors : investor_id | sales : sales_transaction_id = transactions : transaction_id | purchases : purchase_transaction_id = transactions : transaction_id | transactions_lots : transaction_id = transactions : transaction_id | transactions_lots : lot_id = lots : lot_id
|
cre_Theme_park
|
SELECT count(*) FROM HOTELS
|
How many available hotels are there in total?
|
[Schema (values) (types)]: | cre_Theme_park | Ref_Hotel_Star_Ratings : star_rating_code (text) , star_rating_description (text) | Locations : location_id (text) , location_name (text) , address (text) , other_details (number) | Ref_Attraction_Types : attraction_type_code (text) , attraction_type_description (text) | Visitors : tourist_id (text) , tourist_details (text) | Features : feature_id (text) , feature_details (text) | Hotels : hotel_id (text) , star_rating_code (text) , pets_allowed_yn (text) , price_range (number) , other_hotel_details (text) | Tourist_Attractions : tourist_attraction_id (text) , attraction_type_code (text) , location_id (text) , how_to_get_there (number) , name (text) , description (text) , opening_hours (text) , other_details (text) | Street_Markets : market_id (text) , market_details (text) | Shops : shop_id (text) , shop_details (text) | Museums : museum_id (text) , museum_details (text) | Royal_Family : royal_family_id (text) , royal_family_details (text) | Theme_Parks : theme_park_id (text) , theme_park_details (text) | Visits : visit_id (text) , tourist_attraction_id (text) , tourist_id (text) , visit_date (number) , visit_details (text) | Photos : photo_id (text) , tourist_attraction_id (text) , name (text) , description (number) , filename (text) , other_details (text) | Staff : staff_id (text) , tourist_attraction_id (text) , name (text) , other_details (number) | Tourist_Attraction_Features : tourist_attraction_id (text) , feature_id (text);
|
[Primary Keys]: ref_hotel_star_ratings : star_rating_code, locations : location_id, ref_attraction_types : attraction_type_code, visitors : tourist_id, features : feature_id, hotels : hotel_id, tourist_attractions : tourist_attraction_id, street_markets : market_id, shops : shop_id, museums : museum_id, royal_family : royal_family_id, theme_parks : theme_park_id, visits : visit_id, photos : photo_id, staff : staff_id, tourist_attraction_features : tourist_attraction_id
|
[Foreign Keys]: hotels : star_rating_code = ref_hotel_star_ratings : star_rating_code | tourist_attractions : attraction_type_code = ref_attraction_types : attraction_type_code | tourist_attractions : location_id = locations : location_id | street_markets : market_id = tourist_attractions : tourist_attraction_id | shops : shop_id = tourist_attractions : tourist_attraction_id | museums : museum_id = tourist_attractions : tourist_attraction_id | royal_family : royal_family_id = tourist_attractions : tourist_attraction_id | theme_parks : theme_park_id = tourist_attractions : tourist_attraction_id | visits : tourist_id = visitors : tourist_id | visits : tourist_attraction_id = tourist_attractions : tourist_attraction_id | photos : tourist_attraction_id = tourist_attractions : tourist_attraction_id | staff : tourist_attraction_id = tourist_attractions : tourist_attraction_id | tourist_attraction_features : feature_id = features : feature_id | tourist_attraction_features : tourist_attraction_id = tourist_attractions : tourist_attraction_id
|
cre_Theme_park
|
SELECT count(*) FROM HOTELS
|
Find the total number of available hotels.
|
[Schema (values) (types)]: | cre_Theme_park | Ref_Hotel_Star_Ratings : star_rating_code (text) , star_rating_description (text) | Locations : location_id (text) , location_name (text) , address (text) , other_details (number) | Ref_Attraction_Types : attraction_type_code (text) , attraction_type_description (text) | Visitors : tourist_id (text) , tourist_details (text) | Features : feature_id (text) , feature_details (text) | Hotels : hotel_id (text) , star_rating_code (text) , pets_allowed_yn (text) , price_range (number) , other_hotel_details (text) | Tourist_Attractions : tourist_attraction_id (text) , attraction_type_code (text) , location_id (text) , how_to_get_there (number) , name (text) , description (text) , opening_hours (text) , other_details (text) | Street_Markets : market_id (text) , market_details (text) | Shops : shop_id (text) , shop_details (text) | Museums : museum_id (text) , museum_details (text) | Royal_Family : royal_family_id (text) , royal_family_details (text) | Theme_Parks : theme_park_id (text) , theme_park_details (text) | Visits : visit_id (text) , tourist_attraction_id (text) , tourist_id (text) , visit_date (number) , visit_details (text) | Photos : photo_id (text) , tourist_attraction_id (text) , name (text) , description (number) , filename (text) , other_details (text) | Staff : staff_id (text) , tourist_attraction_id (text) , name (text) , other_details (number) | Tourist_Attraction_Features : tourist_attraction_id (text) , feature_id (text);
|
[Primary Keys]: ref_hotel_star_ratings : star_rating_code, locations : location_id, ref_attraction_types : attraction_type_code, visitors : tourist_id, features : feature_id, hotels : hotel_id, tourist_attractions : tourist_attraction_id, street_markets : market_id, shops : shop_id, museums : museum_id, royal_family : royal_family_id, theme_parks : theme_park_id, visits : visit_id, photos : photo_id, staff : staff_id, tourist_attraction_features : tourist_attraction_id
|
[Foreign Keys]: hotels : star_rating_code = ref_hotel_star_ratings : star_rating_code | tourist_attractions : attraction_type_code = ref_attraction_types : attraction_type_code | tourist_attractions : location_id = locations : location_id | street_markets : market_id = tourist_attractions : tourist_attraction_id | shops : shop_id = tourist_attractions : tourist_attraction_id | museums : museum_id = tourist_attractions : tourist_attraction_id | royal_family : royal_family_id = tourist_attractions : tourist_attraction_id | theme_parks : theme_park_id = tourist_attractions : tourist_attraction_id | visits : tourist_id = visitors : tourist_id | visits : tourist_attraction_id = tourist_attractions : tourist_attraction_id | photos : tourist_attraction_id = tourist_attractions : tourist_attraction_id | staff : tourist_attraction_id = tourist_attractions : tourist_attraction_id | tourist_attraction_features : feature_id = features : feature_id | tourist_attraction_features : tourist_attraction_id = tourist_attractions : tourist_attraction_id
|
cre_Theme_park
|
SELECT price_range FROM HOTELS
|
What are the price ranges of hotels?
|
[Schema (values) (types)]: | cre_Theme_park | Ref_Hotel_Star_Ratings : star_rating_code (text) , star_rating_description (text) | Locations : location_id (text) , location_name (text) , address (text) , other_details (number) | Ref_Attraction_Types : attraction_type_code (text) , attraction_type_description (text) | Visitors : tourist_id (text) , tourist_details (text) | Features : feature_id (text) , feature_details (text) | Hotels : hotel_id (text) , star_rating_code (text) , pets_allowed_yn (text) , price_range (number) , other_hotel_details (text) | Tourist_Attractions : tourist_attraction_id (text) , attraction_type_code (text) , location_id (text) , how_to_get_there (number) , name (text) , description (text) , opening_hours (text) , other_details (text) | Street_Markets : market_id (text) , market_details (text) | Shops : shop_id (text) , shop_details (text) | Museums : museum_id (text) , museum_details (text) | Royal_Family : royal_family_id (text) , royal_family_details (text) | Theme_Parks : theme_park_id (text) , theme_park_details (text) | Visits : visit_id (text) , tourist_attraction_id (text) , tourist_id (text) , visit_date (number) , visit_details (text) | Photos : photo_id (text) , tourist_attraction_id (text) , name (text) , description (number) , filename (text) , other_details (text) | Staff : staff_id (text) , tourist_attraction_id (text) , name (text) , other_details (number) | Tourist_Attraction_Features : tourist_attraction_id (text) , feature_id (text);
|
[Primary Keys]: ref_hotel_star_ratings : star_rating_code, locations : location_id, ref_attraction_types : attraction_type_code, visitors : tourist_id, features : feature_id, hotels : hotel_id, tourist_attractions : tourist_attraction_id, street_markets : market_id, shops : shop_id, museums : museum_id, royal_family : royal_family_id, theme_parks : theme_park_id, visits : visit_id, photos : photo_id, staff : staff_id, tourist_attraction_features : tourist_attraction_id
|
[Foreign Keys]: hotels : star_rating_code = ref_hotel_star_ratings : star_rating_code | tourist_attractions : attraction_type_code = ref_attraction_types : attraction_type_code | tourist_attractions : location_id = locations : location_id | street_markets : market_id = tourist_attractions : tourist_attraction_id | shops : shop_id = tourist_attractions : tourist_attraction_id | museums : museum_id = tourist_attractions : tourist_attraction_id | royal_family : royal_family_id = tourist_attractions : tourist_attraction_id | theme_parks : theme_park_id = tourist_attractions : tourist_attraction_id | visits : tourist_id = visitors : tourist_id | visits : tourist_attraction_id = tourist_attractions : tourist_attraction_id | photos : tourist_attraction_id = tourist_attractions : tourist_attraction_id | staff : tourist_attraction_id = tourist_attractions : tourist_attraction_id | tourist_attraction_features : feature_id = features : feature_id | tourist_attraction_features : tourist_attraction_id = tourist_attractions : tourist_attraction_id
|
cre_Theme_park
|
SELECT price_range FROM HOTELS
|
Tell me the price ranges for all the hotels.
|
[Schema (values) (types)]: | cre_Theme_park | Ref_Hotel_Star_Ratings : star_rating_code (text) , star_rating_description (text) | Locations : location_id (text) , location_name (text) , address (text) , other_details (number) | Ref_Attraction_Types : attraction_type_code (text) , attraction_type_description (text) | Visitors : tourist_id (text) , tourist_details (text) | Features : feature_id (text) , feature_details (text) | Hotels : hotel_id (text) , star_rating_code (text) , pets_allowed_yn (text) , price_range (number) , other_hotel_details (text) | Tourist_Attractions : tourist_attraction_id (text) , attraction_type_code (text) , location_id (text) , how_to_get_there (number) , name (text) , description (text) , opening_hours (text) , other_details (text) | Street_Markets : market_id (text) , market_details (text) | Shops : shop_id (text) , shop_details (text) | Museums : museum_id (text) , museum_details (text) | Royal_Family : royal_family_id (text) , royal_family_details (text) | Theme_Parks : theme_park_id (text) , theme_park_details (text) | Visits : visit_id (text) , tourist_attraction_id (text) , tourist_id (text) , visit_date (number) , visit_details (text) | Photos : photo_id (text) , tourist_attraction_id (text) , name (text) , description (number) , filename (text) , other_details (text) | Staff : staff_id (text) , tourist_attraction_id (text) , name (text) , other_details (number) | Tourist_Attraction_Features : tourist_attraction_id (text) , feature_id (text);
|
[Primary Keys]: ref_hotel_star_ratings : star_rating_code, locations : location_id, ref_attraction_types : attraction_type_code, visitors : tourist_id, features : feature_id, hotels : hotel_id, tourist_attractions : tourist_attraction_id, street_markets : market_id, shops : shop_id, museums : museum_id, royal_family : royal_family_id, theme_parks : theme_park_id, visits : visit_id, photos : photo_id, staff : staff_id, tourist_attraction_features : tourist_attraction_id
|
[Foreign Keys]: hotels : star_rating_code = ref_hotel_star_ratings : star_rating_code | tourist_attractions : attraction_type_code = ref_attraction_types : attraction_type_code | tourist_attractions : location_id = locations : location_id | street_markets : market_id = tourist_attractions : tourist_attraction_id | shops : shop_id = tourist_attractions : tourist_attraction_id | museums : museum_id = tourist_attractions : tourist_attraction_id | royal_family : royal_family_id = tourist_attractions : tourist_attraction_id | theme_parks : theme_park_id = tourist_attractions : tourist_attraction_id | visits : tourist_id = visitors : tourist_id | visits : tourist_attraction_id = tourist_attractions : tourist_attraction_id | photos : tourist_attraction_id = tourist_attractions : tourist_attraction_id | staff : tourist_attraction_id = tourist_attractions : tourist_attraction_id | tourist_attraction_features : feature_id = features : feature_id | tourist_attraction_features : tourist_attraction_id = tourist_attractions : tourist_attraction_id
|
cre_Theme_park
|
SELECT DISTINCT Location_Name FROM LOCATIONS
|
Show all distinct location names.
|
[Schema (values) (types)]: | cre_Theme_park | Ref_Hotel_Star_Ratings : star_rating_code (text) , star_rating_description (text) | Locations : location_id (text) , location_name (text) , address (text) , other_details (number) | Ref_Attraction_Types : attraction_type_code (text) , attraction_type_description (text) | Visitors : tourist_id (text) , tourist_details (text) | Features : feature_id (text) , feature_details (text) | Hotels : hotel_id (text) , star_rating_code (text) , pets_allowed_yn (text) , price_range (number) , other_hotel_details (text) | Tourist_Attractions : tourist_attraction_id (text) , attraction_type_code (text) , location_id (text) , how_to_get_there (number) , name (text) , description (text) , opening_hours (text) , other_details (text) | Street_Markets : market_id (text) , market_details (text) | Shops : shop_id (text) , shop_details (text) | Museums : museum_id (text) , museum_details (text) | Royal_Family : royal_family_id (text) , royal_family_details (text) | Theme_Parks : theme_park_id (text) , theme_park_details (text) | Visits : visit_id (text) , tourist_attraction_id (text) , tourist_id (text) , visit_date (number) , visit_details (text) | Photos : photo_id (text) , tourist_attraction_id (text) , name (text) , description (number) , filename (text) , other_details (text) | Staff : staff_id (text) , tourist_attraction_id (text) , name (text) , other_details (number) | Tourist_Attraction_Features : tourist_attraction_id (text) , feature_id (text);
|
[Primary Keys]: ref_hotel_star_ratings : star_rating_code, locations : location_id, ref_attraction_types : attraction_type_code, visitors : tourist_id, features : feature_id, hotels : hotel_id, tourist_attractions : tourist_attraction_id, street_markets : market_id, shops : shop_id, museums : museum_id, royal_family : royal_family_id, theme_parks : theme_park_id, visits : visit_id, photos : photo_id, staff : staff_id, tourist_attraction_features : tourist_attraction_id
|
[Foreign Keys]: hotels : star_rating_code = ref_hotel_star_ratings : star_rating_code | tourist_attractions : attraction_type_code = ref_attraction_types : attraction_type_code | tourist_attractions : location_id = locations : location_id | street_markets : market_id = tourist_attractions : tourist_attraction_id | shops : shop_id = tourist_attractions : tourist_attraction_id | museums : museum_id = tourist_attractions : tourist_attraction_id | royal_family : royal_family_id = tourist_attractions : tourist_attraction_id | theme_parks : theme_park_id = tourist_attractions : tourist_attraction_id | visits : tourist_id = visitors : tourist_id | visits : tourist_attraction_id = tourist_attractions : tourist_attraction_id | photos : tourist_attraction_id = tourist_attractions : tourist_attraction_id | staff : tourist_attraction_id = tourist_attractions : tourist_attraction_id | tourist_attraction_features : feature_id = features : feature_id | tourist_attraction_features : tourist_attraction_id = tourist_attractions : tourist_attraction_id
|
cre_Theme_park
|
SELECT DISTINCT Location_Name FROM LOCATIONS
|
What are the distinct location names?
|
[Schema (values) (types)]: | cre_Theme_park | Ref_Hotel_Star_Ratings : star_rating_code (text) , star_rating_description (text) | Locations : location_id (text) , location_name (text) , address (text) , other_details (number) | Ref_Attraction_Types : attraction_type_code (text) , attraction_type_description (text) | Visitors : tourist_id (text) , tourist_details (text) | Features : feature_id (text) , feature_details (text) | Hotels : hotel_id (text) , star_rating_code (text) , pets_allowed_yn (text) , price_range (number) , other_hotel_details (text) | Tourist_Attractions : tourist_attraction_id (text) , attraction_type_code (text) , location_id (text) , how_to_get_there (number) , name (text) , description (text) , opening_hours (text) , other_details (text) | Street_Markets : market_id (text) , market_details (text) | Shops : shop_id (text) , shop_details (text) | Museums : museum_id (text) , museum_details (text) | Royal_Family : royal_family_id (text) , royal_family_details (text) | Theme_Parks : theme_park_id (text) , theme_park_details (text) | Visits : visit_id (text) , tourist_attraction_id (text) , tourist_id (text) , visit_date (number) , visit_details (text) | Photos : photo_id (text) , tourist_attraction_id (text) , name (text) , description (number) , filename (text) , other_details (text) | Staff : staff_id (text) , tourist_attraction_id (text) , name (text) , other_details (number) | Tourist_Attraction_Features : tourist_attraction_id (text) , feature_id (text);
|
[Primary Keys]: ref_hotel_star_ratings : star_rating_code, locations : location_id, ref_attraction_types : attraction_type_code, visitors : tourist_id, features : feature_id, hotels : hotel_id, tourist_attractions : tourist_attraction_id, street_markets : market_id, shops : shop_id, museums : museum_id, royal_family : royal_family_id, theme_parks : theme_park_id, visits : visit_id, photos : photo_id, staff : staff_id, tourist_attraction_features : tourist_attraction_id
|
[Foreign Keys]: hotels : star_rating_code = ref_hotel_star_ratings : star_rating_code | tourist_attractions : attraction_type_code = ref_attraction_types : attraction_type_code | tourist_attractions : location_id = locations : location_id | street_markets : market_id = tourist_attractions : tourist_attraction_id | shops : shop_id = tourist_attractions : tourist_attraction_id | museums : museum_id = tourist_attractions : tourist_attraction_id | royal_family : royal_family_id = tourist_attractions : tourist_attraction_id | theme_parks : theme_park_id = tourist_attractions : tourist_attraction_id | visits : tourist_id = visitors : tourist_id | visits : tourist_attraction_id = tourist_attractions : tourist_attraction_id | photos : tourist_attraction_id = tourist_attractions : tourist_attraction_id | staff : tourist_attraction_id = tourist_attractions : tourist_attraction_id | tourist_attraction_features : feature_id = features : feature_id | tourist_attraction_features : tourist_attraction_id = tourist_attractions : tourist_attraction_id
|
cre_Theme_park
|
SELECT Name , Other_Details FROM Staff
|
Show the names and details of all the staff members.
|
[Schema (values) (types)]: | cre_Theme_park | Ref_Hotel_Star_Ratings : star_rating_code (text) , star_rating_description (text) | Locations : location_id (text) , location_name (text) , address (text) , other_details (number) | Ref_Attraction_Types : attraction_type_code (text) , attraction_type_description (text) | Visitors : tourist_id (text) , tourist_details (text) | Features : feature_id (text) , feature_details (text) | Hotels : hotel_id (text) , star_rating_code (text) , pets_allowed_yn (text) , price_range (number) , other_hotel_details (text) | Tourist_Attractions : tourist_attraction_id (text) , attraction_type_code (text) , location_id (text) , how_to_get_there (number) , name (text) , description (text) , opening_hours (text) , other_details (text) | Street_Markets : market_id (text) , market_details (text) | Shops : shop_id (text) , shop_details (text) | Museums : museum_id (text) , museum_details (text) | Royal_Family : royal_family_id (text) , royal_family_details (text) | Theme_Parks : theme_park_id (text) , theme_park_details (text) | Visits : visit_id (text) , tourist_attraction_id (text) , tourist_id (text) , visit_date (number) , visit_details (text) | Photos : photo_id (text) , tourist_attraction_id (text) , name (text) , description (number) , filename (text) , other_details (text) | Staff : staff_id (text) , tourist_attraction_id (text) , name (text) , other_details (number) | Tourist_Attraction_Features : tourist_attraction_id (text) , feature_id (text);
|
[Primary Keys]: ref_hotel_star_ratings : star_rating_code, locations : location_id, ref_attraction_types : attraction_type_code, visitors : tourist_id, features : feature_id, hotels : hotel_id, tourist_attractions : tourist_attraction_id, street_markets : market_id, shops : shop_id, museums : museum_id, royal_family : royal_family_id, theme_parks : theme_park_id, visits : visit_id, photos : photo_id, staff : staff_id, tourist_attraction_features : tourist_attraction_id
|
[Foreign Keys]: hotels : star_rating_code = ref_hotel_star_ratings : star_rating_code | tourist_attractions : attraction_type_code = ref_attraction_types : attraction_type_code | tourist_attractions : location_id = locations : location_id | street_markets : market_id = tourist_attractions : tourist_attraction_id | shops : shop_id = tourist_attractions : tourist_attraction_id | museums : museum_id = tourist_attractions : tourist_attraction_id | royal_family : royal_family_id = tourist_attractions : tourist_attraction_id | theme_parks : theme_park_id = tourist_attractions : tourist_attraction_id | visits : tourist_id = visitors : tourist_id | visits : tourist_attraction_id = tourist_attractions : tourist_attraction_id | photos : tourist_attraction_id = tourist_attractions : tourist_attraction_id | staff : tourist_attraction_id = tourist_attractions : tourist_attraction_id | tourist_attraction_features : feature_id = features : feature_id | tourist_attraction_features : tourist_attraction_id = tourist_attractions : tourist_attraction_id
|
cre_Theme_park
|
SELECT Name , Other_Details FROM Staff
|
What is the name and detail of each staff member?
|
[Schema (values) (types)]: | cre_Theme_park | Ref_Hotel_Star_Ratings : star_rating_code (text) , star_rating_description (text) | Locations : location_id (text) , location_name (text) , address (text) , other_details (number) | Ref_Attraction_Types : attraction_type_code (text) , attraction_type_description (text) | Visitors : tourist_id (text) , tourist_details (text) | Features : feature_id (text) , feature_details (text) | Hotels : hotel_id (text) , star_rating_code (text) , pets_allowed_yn (text) , price_range (number) , other_hotel_details (text) | Tourist_Attractions : tourist_attraction_id (text) , attraction_type_code (text) , location_id (text) , how_to_get_there (number) , name (text) , description (text) , opening_hours (text) , other_details (text) | Street_Markets : market_id (text) , market_details (text) | Shops : shop_id (text) , shop_details (text) | Museums : museum_id (text) , museum_details (text) | Royal_Family : royal_family_id (text) , royal_family_details (text) | Theme_Parks : theme_park_id (text) , theme_park_details (text) | Visits : visit_id (text) , tourist_attraction_id (text) , tourist_id (text) , visit_date (number) , visit_details (text) | Photos : photo_id (text) , tourist_attraction_id (text) , name (text) , description (number) , filename (text) , other_details (text) | Staff : staff_id (text) , tourist_attraction_id (text) , name (text) , other_details (number) | Tourist_Attraction_Features : tourist_attraction_id (text) , feature_id (text);
|
[Primary Keys]: ref_hotel_star_ratings : star_rating_code, locations : location_id, ref_attraction_types : attraction_type_code, visitors : tourist_id, features : feature_id, hotels : hotel_id, tourist_attractions : tourist_attraction_id, street_markets : market_id, shops : shop_id, museums : museum_id, royal_family : royal_family_id, theme_parks : theme_park_id, visits : visit_id, photos : photo_id, staff : staff_id, tourist_attraction_features : tourist_attraction_id
|
[Foreign Keys]: hotels : star_rating_code = ref_hotel_star_ratings : star_rating_code | tourist_attractions : attraction_type_code = ref_attraction_types : attraction_type_code | tourist_attractions : location_id = locations : location_id | street_markets : market_id = tourist_attractions : tourist_attraction_id | shops : shop_id = tourist_attractions : tourist_attraction_id | museums : museum_id = tourist_attractions : tourist_attraction_id | royal_family : royal_family_id = tourist_attractions : tourist_attraction_id | theme_parks : theme_park_id = tourist_attractions : tourist_attraction_id | visits : tourist_id = visitors : tourist_id | visits : tourist_attraction_id = tourist_attractions : tourist_attraction_id | photos : tourist_attraction_id = tourist_attractions : tourist_attraction_id | staff : tourist_attraction_id = tourist_attractions : tourist_attraction_id | tourist_attraction_features : feature_id = features : feature_id | tourist_attraction_features : tourist_attraction_id = tourist_attractions : tourist_attraction_id
|
cre_Theme_park
|
SELECT Tourist_Details FROM VISITORS
|
Show details of all visitors.
|
[Schema (values) (types)]: | cre_Theme_park | Ref_Hotel_Star_Ratings : star_rating_code (text) , star_rating_description (text) | Locations : location_id (text) , location_name (text) , address (text) , other_details (number) | Ref_Attraction_Types : attraction_type_code (text) , attraction_type_description (text) | Visitors : tourist_id (text) , tourist_details (text) | Features : feature_id (text) , feature_details (text) | Hotels : hotel_id (text) , star_rating_code (text) , pets_allowed_yn (text) , price_range (number) , other_hotel_details (text) | Tourist_Attractions : tourist_attraction_id (text) , attraction_type_code (text) , location_id (text) , how_to_get_there (number) , name (text) , description (text) , opening_hours (text) , other_details (text) | Street_Markets : market_id (text) , market_details (text) | Shops : shop_id (text) , shop_details (text) | Museums : museum_id (text) , museum_details (text) | Royal_Family : royal_family_id (text) , royal_family_details (text) | Theme_Parks : theme_park_id (text) , theme_park_details (text) | Visits : visit_id (text) , tourist_attraction_id (text) , tourist_id (text) , visit_date (number) , visit_details (text) | Photos : photo_id (text) , tourist_attraction_id (text) , name (text) , description (number) , filename (text) , other_details (text) | Staff : staff_id (text) , tourist_attraction_id (text) , name (text) , other_details (number) | Tourist_Attraction_Features : tourist_attraction_id (text) , feature_id (text);
|
[Primary Keys]: ref_hotel_star_ratings : star_rating_code, locations : location_id, ref_attraction_types : attraction_type_code, visitors : tourist_id, features : feature_id, hotels : hotel_id, tourist_attractions : tourist_attraction_id, street_markets : market_id, shops : shop_id, museums : museum_id, royal_family : royal_family_id, theme_parks : theme_park_id, visits : visit_id, photos : photo_id, staff : staff_id, tourist_attraction_features : tourist_attraction_id
|
[Foreign Keys]: hotels : star_rating_code = ref_hotel_star_ratings : star_rating_code | tourist_attractions : attraction_type_code = ref_attraction_types : attraction_type_code | tourist_attractions : location_id = locations : location_id | street_markets : market_id = tourist_attractions : tourist_attraction_id | shops : shop_id = tourist_attractions : tourist_attraction_id | museums : museum_id = tourist_attractions : tourist_attraction_id | royal_family : royal_family_id = tourist_attractions : tourist_attraction_id | theme_parks : theme_park_id = tourist_attractions : tourist_attraction_id | visits : tourist_id = visitors : tourist_id | visits : tourist_attraction_id = tourist_attractions : tourist_attraction_id | photos : tourist_attraction_id = tourist_attractions : tourist_attraction_id | staff : tourist_attraction_id = tourist_attractions : tourist_attraction_id | tourist_attraction_features : feature_id = features : feature_id | tourist_attraction_features : tourist_attraction_id = tourist_attractions : tourist_attraction_id
|
cre_Theme_park
|
SELECT Tourist_Details FROM VISITORS
|
What is the detail of each visitor?
|
[Schema (values) (types)]: | cre_Theme_park | Ref_Hotel_Star_Ratings : star_rating_code (text) , star_rating_description (text) | Locations : location_id (text) , location_name (text) , address (text) , other_details (number) | Ref_Attraction_Types : attraction_type_code (text) , attraction_type_description (text) | Visitors : tourist_id (text) , tourist_details (text) | Features : feature_id (text) , feature_details (text) | Hotels : hotel_id (text) , star_rating_code (text) , pets_allowed_yn (text) , price_range (number) , other_hotel_details (text) | Tourist_Attractions : tourist_attraction_id (text) , attraction_type_code (text) , location_id (text) , how_to_get_there (number) , name (text) , description (text) , opening_hours (text) , other_details (text) | Street_Markets : market_id (text) , market_details (text) | Shops : shop_id (text) , shop_details (text) | Museums : museum_id (text) , museum_details (text) | Royal_Family : royal_family_id (text) , royal_family_details (text) | Theme_Parks : theme_park_id (text) , theme_park_details (text) | Visits : visit_id (text) , tourist_attraction_id (text) , tourist_id (text) , visit_date (number) , visit_details (text) | Photos : photo_id (text) , tourist_attraction_id (text) , name (text) , description (number) , filename (text) , other_details (text) | Staff : staff_id (text) , tourist_attraction_id (text) , name (text) , other_details (number) | Tourist_Attraction_Features : tourist_attraction_id (text) , feature_id (text);
|
[Primary Keys]: ref_hotel_star_ratings : star_rating_code, locations : location_id, ref_attraction_types : attraction_type_code, visitors : tourist_id, features : feature_id, hotels : hotel_id, tourist_attractions : tourist_attraction_id, street_markets : market_id, shops : shop_id, museums : museum_id, royal_family : royal_family_id, theme_parks : theme_park_id, visits : visit_id, photos : photo_id, staff : staff_id, tourist_attraction_features : tourist_attraction_id
|
[Foreign Keys]: hotels : star_rating_code = ref_hotel_star_ratings : star_rating_code | tourist_attractions : attraction_type_code = ref_attraction_types : attraction_type_code | tourist_attractions : location_id = locations : location_id | street_markets : market_id = tourist_attractions : tourist_attraction_id | shops : shop_id = tourist_attractions : tourist_attraction_id | museums : museum_id = tourist_attractions : tourist_attraction_id | royal_family : royal_family_id = tourist_attractions : tourist_attraction_id | theme_parks : theme_park_id = tourist_attractions : tourist_attraction_id | visits : tourist_id = visitors : tourist_id | visits : tourist_attraction_id = tourist_attractions : tourist_attraction_id | photos : tourist_attraction_id = tourist_attractions : tourist_attraction_id | staff : tourist_attraction_id = tourist_attractions : tourist_attraction_id | tourist_attraction_features : feature_id = features : feature_id | tourist_attraction_features : tourist_attraction_id = tourist_attractions : tourist_attraction_id
|
cre_Theme_park
|
SELECT price_range FROM HOTELS WHERE star_rating_code = "5"
|
Show the price ranges of hotels with 5 star ratings.
|
[Schema (values) (types)]: | cre_Theme_park | Ref_Hotel_Star_Ratings : star_rating_code (text) , star_rating_description (text) | Locations : location_id (text) , location_name (text) , address (text) , other_details (number) | Ref_Attraction_Types : attraction_type_code (text) , attraction_type_description (text) | Visitors : tourist_id (text) , tourist_details (text) | Features : feature_id (text) , feature_details (text) | Hotels : hotel_id (text) , star_rating_code (text) , pets_allowed_yn (text) , price_range (number) , other_hotel_details (text) | Tourist_Attractions : tourist_attraction_id (text) , attraction_type_code (text) , location_id (text) , how_to_get_there (number) , name (text) , description (text) , opening_hours (text) , other_details (text) | Street_Markets : market_id (text) , market_details (text) | Shops : shop_id (text) , shop_details (text) | Museums : museum_id (text) , museum_details (text) | Royal_Family : royal_family_id (text) , royal_family_details (text) | Theme_Parks : theme_park_id (text) , theme_park_details (text) | Visits : visit_id (text) , tourist_attraction_id (text) , tourist_id (text) , visit_date (number) , visit_details (text) | Photos : photo_id (text) , tourist_attraction_id (text) , name (text) , description (number) , filename (text) , other_details (text) | Staff : staff_id (text) , tourist_attraction_id (text) , name (text) , other_details (number) | Tourist_Attraction_Features : tourist_attraction_id (text) , feature_id (text);
|
[Primary Keys]: ref_hotel_star_ratings : star_rating_code, locations : location_id, ref_attraction_types : attraction_type_code, visitors : tourist_id, features : feature_id, hotels : hotel_id, tourist_attractions : tourist_attraction_id, street_markets : market_id, shops : shop_id, museums : museum_id, royal_family : royal_family_id, theme_parks : theme_park_id, visits : visit_id, photos : photo_id, staff : staff_id, tourist_attraction_features : tourist_attraction_id
|
[Foreign Keys]: hotels : star_rating_code = ref_hotel_star_ratings : star_rating_code | tourist_attractions : attraction_type_code = ref_attraction_types : attraction_type_code | tourist_attractions : location_id = locations : location_id | street_markets : market_id = tourist_attractions : tourist_attraction_id | shops : shop_id = tourist_attractions : tourist_attraction_id | museums : museum_id = tourist_attractions : tourist_attraction_id | royal_family : royal_family_id = tourist_attractions : tourist_attraction_id | theme_parks : theme_park_id = tourist_attractions : tourist_attraction_id | visits : tourist_id = visitors : tourist_id | visits : tourist_attraction_id = tourist_attractions : tourist_attraction_id | photos : tourist_attraction_id = tourist_attractions : tourist_attraction_id | staff : tourist_attraction_id = tourist_attractions : tourist_attraction_id | tourist_attraction_features : feature_id = features : feature_id | tourist_attraction_features : tourist_attraction_id = tourist_attractions : tourist_attraction_id
|
cre_Theme_park
|
SELECT price_range FROM HOTELS WHERE star_rating_code = "5"
|
What are the price ranges of five star hotels?
|
[Schema (values) (types)]: | cre_Theme_park | Ref_Hotel_Star_Ratings : star_rating_code (text) , star_rating_description (text) | Locations : location_id (text) , location_name (text) , address (text) , other_details (number) | Ref_Attraction_Types : attraction_type_code (text) , attraction_type_description (text) | Visitors : tourist_id (text) , tourist_details (text) | Features : feature_id (text) , feature_details (text) | Hotels : hotel_id (text) , star_rating_code (text) , pets_allowed_yn (text) , price_range (number) , other_hotel_details (text) | Tourist_Attractions : tourist_attraction_id (text) , attraction_type_code (text) , location_id (text) , how_to_get_there (number) , name (text) , description (text) , opening_hours (text) , other_details (text) | Street_Markets : market_id (text) , market_details (text) | Shops : shop_id (text) , shop_details (text) | Museums : museum_id (text) , museum_details (text) | Royal_Family : royal_family_id (text) , royal_family_details (text) | Theme_Parks : theme_park_id (text) , theme_park_details (text) | Visits : visit_id (text) , tourist_attraction_id (text) , tourist_id (text) , visit_date (number) , visit_details (text) | Photos : photo_id (text) , tourist_attraction_id (text) , name (text) , description (number) , filename (text) , other_details (text) | Staff : staff_id (text) , tourist_attraction_id (text) , name (text) , other_details (number) | Tourist_Attraction_Features : tourist_attraction_id (text) , feature_id (text);
|
[Primary Keys]: ref_hotel_star_ratings : star_rating_code, locations : location_id, ref_attraction_types : attraction_type_code, visitors : tourist_id, features : feature_id, hotels : hotel_id, tourist_attractions : tourist_attraction_id, street_markets : market_id, shops : shop_id, museums : museum_id, royal_family : royal_family_id, theme_parks : theme_park_id, visits : visit_id, photos : photo_id, staff : staff_id, tourist_attraction_features : tourist_attraction_id
|
[Foreign Keys]: hotels : star_rating_code = ref_hotel_star_ratings : star_rating_code | tourist_attractions : attraction_type_code = ref_attraction_types : attraction_type_code | tourist_attractions : location_id = locations : location_id | street_markets : market_id = tourist_attractions : tourist_attraction_id | shops : shop_id = tourist_attractions : tourist_attraction_id | museums : museum_id = tourist_attractions : tourist_attraction_id | royal_family : royal_family_id = tourist_attractions : tourist_attraction_id | theme_parks : theme_park_id = tourist_attractions : tourist_attraction_id | visits : tourist_id = visitors : tourist_id | visits : tourist_attraction_id = tourist_attractions : tourist_attraction_id | photos : tourist_attraction_id = tourist_attractions : tourist_attraction_id | staff : tourist_attraction_id = tourist_attractions : tourist_attraction_id | tourist_attraction_features : feature_id = features : feature_id | tourist_attraction_features : tourist_attraction_id = tourist_attractions : tourist_attraction_id
|
cre_Theme_park
|
SELECT avg(price_range) FROM HOTELS WHERE star_rating_code = "5" AND pets_allowed_yn = 1
|
Show the average price range of hotels that have 5 star ratings and allow pets.
|
[Schema (values) (types)]: | cre_Theme_park | Ref_Hotel_Star_Ratings : star_rating_code (text) , star_rating_description (text) | Locations : location_id (text) , location_name (text) , address (text) , other_details (number) | Ref_Attraction_Types : attraction_type_code (text) , attraction_type_description (text) | Visitors : tourist_id (text) , tourist_details (text) | Features : feature_id (text) , feature_details (text) | Hotels : hotel_id (text) , star_rating_code (text) , pets_allowed_yn (text) , price_range (number) , other_hotel_details (text) | Tourist_Attractions : tourist_attraction_id (text) , attraction_type_code (text) , location_id (text) , how_to_get_there (number) , name (text) , description (text) , opening_hours (text) , other_details (text) | Street_Markets : market_id (text) , market_details (text) | Shops : shop_id (text) , shop_details (text) | Museums : museum_id (text) , museum_details (text) | Royal_Family : royal_family_id (text) , royal_family_details (text) | Theme_Parks : theme_park_id (text) , theme_park_details (text) | Visits : visit_id (text) , tourist_attraction_id (text) , tourist_id (text) , visit_date (number) , visit_details (text) | Photos : photo_id (text) , tourist_attraction_id (text) , name (text) , description (number) , filename (text) , other_details (text) | Staff : staff_id (text) , tourist_attraction_id (text) , name (text) , other_details (number) | Tourist_Attraction_Features : tourist_attraction_id (text) , feature_id (text);
|
[Primary Keys]: ref_hotel_star_ratings : star_rating_code, locations : location_id, ref_attraction_types : attraction_type_code, visitors : tourist_id, features : feature_id, hotels : hotel_id, tourist_attractions : tourist_attraction_id, street_markets : market_id, shops : shop_id, museums : museum_id, royal_family : royal_family_id, theme_parks : theme_park_id, visits : visit_id, photos : photo_id, staff : staff_id, tourist_attraction_features : tourist_attraction_id
|
[Foreign Keys]: hotels : star_rating_code = ref_hotel_star_ratings : star_rating_code | tourist_attractions : attraction_type_code = ref_attraction_types : attraction_type_code | tourist_attractions : location_id = locations : location_id | street_markets : market_id = tourist_attractions : tourist_attraction_id | shops : shop_id = tourist_attractions : tourist_attraction_id | museums : museum_id = tourist_attractions : tourist_attraction_id | royal_family : royal_family_id = tourist_attractions : tourist_attraction_id | theme_parks : theme_park_id = tourist_attractions : tourist_attraction_id | visits : tourist_id = visitors : tourist_id | visits : tourist_attraction_id = tourist_attractions : tourist_attraction_id | photos : tourist_attraction_id = tourist_attractions : tourist_attraction_id | staff : tourist_attraction_id = tourist_attractions : tourist_attraction_id | tourist_attraction_features : feature_id = features : feature_id | tourist_attraction_features : tourist_attraction_id = tourist_attractions : tourist_attraction_id
|
cre_Theme_park
|
SELECT avg(price_range) FROM HOTELS WHERE star_rating_code = "5" AND pets_allowed_yn = 1
|
What is the average price range of five star hotels that allow pets?
|
[Schema (values) (types)]: | cre_Theme_park | Ref_Hotel_Star_Ratings : star_rating_code (text) , star_rating_description (text) | Locations : location_id (text) , location_name (text) , address (text) , other_details (number) | Ref_Attraction_Types : attraction_type_code (text) , attraction_type_description (text) | Visitors : tourist_id (text) , tourist_details (text) | Features : feature_id (text) , feature_details (text) | Hotels : hotel_id (text) , star_rating_code (text) , pets_allowed_yn (text) , price_range (number) , other_hotel_details (text) | Tourist_Attractions : tourist_attraction_id (text) , attraction_type_code (text) , location_id (text) , how_to_get_there (number) , name (text) , description (text) , opening_hours (text) , other_details (text) | Street_Markets : market_id (text) , market_details (text) | Shops : shop_id (text) , shop_details (text) | Museums : museum_id (text) , museum_details (text) | Royal_Family : royal_family_id (text) , royal_family_details (text) | Theme_Parks : theme_park_id (text) , theme_park_details (text) | Visits : visit_id (text) , tourist_attraction_id (text) , tourist_id (text) , visit_date (number) , visit_details (text) | Photos : photo_id (text) , tourist_attraction_id (text) , name (text) , description (number) , filename (text) , other_details (text) | Staff : staff_id (text) , tourist_attraction_id (text) , name (text) , other_details (number) | Tourist_Attraction_Features : tourist_attraction_id (text) , feature_id (text);
|
[Primary Keys]: ref_hotel_star_ratings : star_rating_code, locations : location_id, ref_attraction_types : attraction_type_code, visitors : tourist_id, features : feature_id, hotels : hotel_id, tourist_attractions : tourist_attraction_id, street_markets : market_id, shops : shop_id, museums : museum_id, royal_family : royal_family_id, theme_parks : theme_park_id, visits : visit_id, photos : photo_id, staff : staff_id, tourist_attraction_features : tourist_attraction_id
|
[Foreign Keys]: hotels : star_rating_code = ref_hotel_star_ratings : star_rating_code | tourist_attractions : attraction_type_code = ref_attraction_types : attraction_type_code | tourist_attractions : location_id = locations : location_id | street_markets : market_id = tourist_attractions : tourist_attraction_id | shops : shop_id = tourist_attractions : tourist_attraction_id | museums : museum_id = tourist_attractions : tourist_attraction_id | royal_family : royal_family_id = tourist_attractions : tourist_attraction_id | theme_parks : theme_park_id = tourist_attractions : tourist_attraction_id | visits : tourist_id = visitors : tourist_id | visits : tourist_attraction_id = tourist_attractions : tourist_attraction_id | photos : tourist_attraction_id = tourist_attractions : tourist_attraction_id | staff : tourist_attraction_id = tourist_attractions : tourist_attraction_id | tourist_attraction_features : feature_id = features : feature_id | tourist_attraction_features : tourist_attraction_id = tourist_attractions : tourist_attraction_id
|
cre_Theme_park
|
SELECT Address FROM LOCATIONS WHERE Location_Name = "UK Gallery"
|
What is the address of the location "UK Gallery"?
|
[Schema (values) (types)]: | cre_Theme_park | Ref_Hotel_Star_Ratings : star_rating_code (text) , star_rating_description (text) | Locations : location_id (text) , location_name (text) , address (text) , other_details (number) | Ref_Attraction_Types : attraction_type_code (text) , attraction_type_description (text) | Visitors : tourist_id (text) , tourist_details (text) | Features : feature_id (text) , feature_details (text) | Hotels : hotel_id (text) , star_rating_code (text) , pets_allowed_yn (text) , price_range (number) , other_hotel_details (text) | Tourist_Attractions : tourist_attraction_id (text) , attraction_type_code (text) , location_id (text) , how_to_get_there (number) , name (text) , description (text) , opening_hours (text) , other_details (text) | Street_Markets : market_id (text) , market_details (text) | Shops : shop_id (text) , shop_details (text) | Museums : museum_id (text) , museum_details (text) | Royal_Family : royal_family_id (text) , royal_family_details (text) | Theme_Parks : theme_park_id (text) , theme_park_details (text) | Visits : visit_id (text) , tourist_attraction_id (text) , tourist_id (text) , visit_date (number) , visit_details (text) | Photos : photo_id (text) , tourist_attraction_id (text) , name (text) , description (number) , filename (text) , other_details (text) | Staff : staff_id (text) , tourist_attraction_id (text) , name (text) , other_details (number) | Tourist_Attraction_Features : tourist_attraction_id (text) , feature_id (text);
|
[Primary Keys]: ref_hotel_star_ratings : star_rating_code, locations : location_id, ref_attraction_types : attraction_type_code, visitors : tourist_id, features : feature_id, hotels : hotel_id, tourist_attractions : tourist_attraction_id, street_markets : market_id, shops : shop_id, museums : museum_id, royal_family : royal_family_id, theme_parks : theme_park_id, visits : visit_id, photos : photo_id, staff : staff_id, tourist_attraction_features : tourist_attraction_id
|
[Foreign Keys]: hotels : star_rating_code = ref_hotel_star_ratings : star_rating_code | tourist_attractions : attraction_type_code = ref_attraction_types : attraction_type_code | tourist_attractions : location_id = locations : location_id | street_markets : market_id = tourist_attractions : tourist_attraction_id | shops : shop_id = tourist_attractions : tourist_attraction_id | museums : museum_id = tourist_attractions : tourist_attraction_id | royal_family : royal_family_id = tourist_attractions : tourist_attraction_id | theme_parks : theme_park_id = tourist_attractions : tourist_attraction_id | visits : tourist_id = visitors : tourist_id | visits : tourist_attraction_id = tourist_attractions : tourist_attraction_id | photos : tourist_attraction_id = tourist_attractions : tourist_attraction_id | staff : tourist_attraction_id = tourist_attractions : tourist_attraction_id | tourist_attraction_features : feature_id = features : feature_id | tourist_attraction_features : tourist_attraction_id = tourist_attractions : tourist_attraction_id
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.