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
|
---|---|---|---|---|---|
inn_1 | SELECT T2.decor FROM Reservations AS T1 JOIN Rooms AS T2 ON T1.Room = T2.RoomId GROUP BY T2.decor ORDER BY count(T2.decor) ASC LIMIT 1; | What kind of decor has the least number of reservations? | [Schema (values) (types)]: | inn_1 | Rooms : roomid (text) , roomname (text) , beds (text) , bedtype (number) , maxoccupancy (text) , baseprice (number) , decor (number) | Reservations : code (text) , room (text) , checkin (text) , checkout (number) , rate (text) , lastname (number) , firstname (number) , adults (text) , kids (number); | [Primary Keys]: rooms : roomid, reservations : code | [Foreign Keys]: reservations : room = rooms : roomid |
inn_1 | SELECT T2.decor FROM Reservations AS T1 JOIN Rooms AS T2 ON T1.Room = T2.RoomId GROUP BY T2.decor ORDER BY count(T2.decor) ASC LIMIT 1; | What is the least popular kind of decor? | [Schema (values) (types)]: | inn_1 | Rooms : roomid (text) , roomname (text) , beds (text) , bedtype (number) , maxoccupancy (text) , baseprice (number) , decor (number) | Reservations : code (text) , room (text) , checkin (text) , checkout (number) , rate (text) , lastname (number) , firstname (number) , adults (text) , kids (number); | [Primary Keys]: rooms : roomid, reservations : code | [Foreign Keys]: reservations : room = rooms : roomid |
inn_1 | SELECT count(*) FROM Reservations AS T1 JOIN Rooms AS T2 ON T1.Room = T2.RoomId WHERE T2.maxOccupancy = T1.Adults + T1.Kids; | List how many times the number of people in the room reached the maximum occupancy of the room. The number of people include adults and kids. | [Schema (values) (types)]: | inn_1 | Rooms : roomid (text) , roomname (text) , beds (text) , bedtype (number) , maxoccupancy (text) , baseprice (number) , decor (number) | Reservations : code (text) , room (text) , checkin (text) , checkout (number) , rate (text) , lastname (number) , firstname (number) , adults (text) , kids (number); | [Primary Keys]: rooms : roomid, reservations : code | [Foreign Keys]: reservations : room = rooms : roomid |
inn_1 | SELECT count(*) FROM Reservations AS T1 JOIN Rooms AS T2 ON T1.Room = T2.RoomId WHERE T2.maxOccupancy = T1.Adults + T1.Kids; | How many times the number of adults and kids staying in a room reached the maximum capacity of the room? | [Schema (values) (types)]: | inn_1 | Rooms : roomid (text) , roomname (text) , beds (text) , bedtype (number) , maxoccupancy (text) , baseprice (number) , decor (number) | Reservations : code (text) , room (text) , checkin (text) , checkout (number) , rate (text) , lastname (number) , firstname (number) , adults (text) , kids (number); | [Primary Keys]: rooms : roomid, reservations : code | [Foreign Keys]: reservations : room = rooms : roomid |
inn_1 | SELECT T1.firstname , T1.lastname FROM Reservations AS T1 JOIN Rooms AS T2 ON T1.Room = T2.RoomId WHERE T1.Rate - T2.basePrice > 0 | Find the first and last names of people who payed more than the rooms' base prices. | [Schema (values) (types)]: | inn_1 | Rooms : roomid (text) , roomname (text) , beds (text) , bedtype (number) , maxoccupancy (text) , baseprice (number) , decor (number) | Reservations : code (text) , room (text) , checkin (text) , checkout (number) , rate (text) , lastname (number) , firstname (number) , adults (text) , kids (number); | [Primary Keys]: rooms : roomid, reservations : code | [Foreign Keys]: reservations : room = rooms : roomid |
inn_1 | SELECT T1.firstname , T1.lastname FROM Reservations AS T1 JOIN Rooms AS T2 ON T1.Room = T2.RoomId WHERE T1.Rate - T2.basePrice > 0 | What are the first and last names of people who payed more than the rooms' base prices? | [Schema (values) (types)]: | inn_1 | Rooms : roomid (text) , roomname (text) , beds (text) , bedtype (number) , maxoccupancy (text) , baseprice (number) , decor (number) | Reservations : code (text) , room (text) , checkin (text) , checkout (number) , rate (text) , lastname (number) , firstname (number) , adults (text) , kids (number); | [Primary Keys]: rooms : roomid, reservations : code | [Foreign Keys]: reservations : room = rooms : roomid |
inn_1 | SELECT count(*) FROM Rooms; | How many rooms are there? | [Schema (values) (types)]: | inn_1 | Rooms : roomid (text) , roomname (text) , beds (text) , bedtype (number) , maxoccupancy (text) , baseprice (number) , decor (number) | Reservations : code (text) , room (text) , checkin (text) , checkout (number) , rate (text) , lastname (number) , firstname (number) , adults (text) , kids (number); | [Primary Keys]: rooms : roomid, reservations : code | [Foreign Keys]: reservations : room = rooms : roomid |
inn_1 | SELECT count(*) FROM Rooms; | What is the total number of rooms available in this inn? | [Schema (values) (types)]: | inn_1 | Rooms : roomid (text) , roomname (text) , beds (text) , bedtype (number) , maxoccupancy (text) , baseprice (number) , decor (number) | Reservations : code (text) , room (text) , checkin (text) , checkout (number) , rate (text) , lastname (number) , firstname (number) , adults (text) , kids (number); | [Primary Keys]: rooms : roomid, reservations : code | [Foreign Keys]: reservations : room = rooms : roomid |
inn_1 | SELECT count(*) FROM Rooms WHERE bedType = "King"; | Find the number of rooms with a king bed. | [Schema (values) (types)]: | inn_1 | Rooms : roomid (text) , roomname (text) , beds (text) , bedtype (number) , maxoccupancy (text) , baseprice (number) , decor (number) | Reservations : code (text) , room (text) , checkin (text) , checkout (number) , rate (text) , lastname (number) , firstname (number) , adults (text) , kids (number); | [Primary Keys]: rooms : roomid, reservations : code | [Foreign Keys]: reservations : room = rooms : roomid |
inn_1 | SELECT count(*) FROM Rooms WHERE bedType = "King"; | How many rooms have a king bed? | [Schema (values) (types)]: | inn_1 | Rooms : roomid (text) , roomname (text) , beds (text) , bedtype (number) , maxoccupancy (text) , baseprice (number) , decor (number) | Reservations : code (text) , room (text) , checkin (text) , checkout (number) , rate (text) , lastname (number) , firstname (number) , adults (text) , kids (number); | [Primary Keys]: rooms : roomid, reservations : code | [Foreign Keys]: reservations : room = rooms : roomid |
inn_1 | SELECT bedType , count(*) FROM Rooms GROUP BY bedType; | Find the number of rooms for each bed type. | [Schema (values) (types)]: | inn_1 | Rooms : roomid (text) , roomname (text) , beds (text) , bedtype (number) , maxoccupancy (text) , baseprice (number) , decor (number) | Reservations : code (text) , room (text) , checkin (text) , checkout (number) , rate (text) , lastname (number) , firstname (number) , adults (text) , kids (number); | [Primary Keys]: rooms : roomid, reservations : code | [Foreign Keys]: reservations : room = rooms : roomid |
inn_1 | SELECT bedType , count(*) FROM Rooms GROUP BY bedType; | What are the number of rooms for each bed type? | [Schema (values) (types)]: | inn_1 | Rooms : roomid (text) , roomname (text) , beds (text) , bedtype (number) , maxoccupancy (text) , baseprice (number) , decor (number) | Reservations : code (text) , room (text) , checkin (text) , checkout (number) , rate (text) , lastname (number) , firstname (number) , adults (text) , kids (number); | [Primary Keys]: rooms : roomid, reservations : code | [Foreign Keys]: reservations : room = rooms : roomid |
inn_1 | SELECT roomName FROM Rooms ORDER BY maxOccupancy DESC LIMIT 1; | Find the name of the room with the maximum occupancy. | [Schema (values) (types)]: | inn_1 | Rooms : roomid (text) , roomname (text) , beds (text) , bedtype (number) , maxoccupancy (text) , baseprice (number) , decor (number) | Reservations : code (text) , room (text) , checkin (text) , checkout (number) , rate (text) , lastname (number) , firstname (number) , adults (text) , kids (number); | [Primary Keys]: rooms : roomid, reservations : code | [Foreign Keys]: reservations : room = rooms : roomid |
inn_1 | SELECT roomName FROM Rooms ORDER BY maxOccupancy DESC LIMIT 1; | What is the name of the room that can accommodate the most people? | [Schema (values) (types)]: | inn_1 | Rooms : roomid (text) , roomname (text) , beds (text) , bedtype (number) , maxoccupancy (text) , baseprice (number) , decor (number) | Reservations : code (text) , room (text) , checkin (text) , checkout (number) , rate (text) , lastname (number) , firstname (number) , adults (text) , kids (number); | [Primary Keys]: rooms : roomid, reservations : code | [Foreign Keys]: reservations : room = rooms : roomid |
inn_1 | SELECT RoomId , roomName FROM Rooms ORDER BY basePrice DESC LIMIT 1; | Find the id and name of the most expensive base price room. | [Schema (values) (types)]: | inn_1 | Rooms : roomid (text) , roomname (text) , beds (text) , bedtype (number) , maxoccupancy (text) , baseprice (number) , decor (number) | Reservations : code (text) , room (text) , checkin (text) , checkout (number) , rate (text) , lastname (number) , firstname (number) , adults (text) , kids (number); | [Primary Keys]: rooms : roomid, reservations : code | [Foreign Keys]: reservations : room = rooms : roomid |
inn_1 | SELECT RoomId , roomName FROM Rooms ORDER BY basePrice DESC LIMIT 1; | Which room has the highest base price? | [Schema (values) (types)]: | inn_1 | Rooms : roomid (text) , roomname (text) , beds (text) , bedtype (number) , maxoccupancy (text) , baseprice (number) , decor (number) | Reservations : code (text) , room (text) , checkin (text) , checkout (number) , rate (text) , lastname (number) , firstname (number) , adults (text) , kids (number); | [Primary Keys]: rooms : roomid, reservations : code | [Foreign Keys]: reservations : room = rooms : roomid |
inn_1 | SELECT roomName , bedType FROM Rooms WHERE decor = "traditional"; | List the type of bed and name of all traditional rooms. | [Schema (values) (types)]: | inn_1 | Rooms : roomid (text) , roomname (text) , beds (text) , bedtype (number) , maxoccupancy (text) , baseprice (number) , decor (number) | Reservations : code (text) , room (text) , checkin (text) , checkout (number) , rate (text) , lastname (number) , firstname (number) , adults (text) , kids (number); | [Primary Keys]: rooms : roomid, reservations : code | [Foreign Keys]: reservations : room = rooms : roomid |
inn_1 | SELECT roomName , bedType FROM Rooms WHERE decor = "traditional"; | What are the bed type and name of all the rooms with traditional decor? | [Schema (values) (types)]: | inn_1 | Rooms : roomid (text) , roomname (text) , beds (text) , bedtype (number) , maxoccupancy (text) , baseprice (number) , decor (number) | Reservations : code (text) , room (text) , checkin (text) , checkout (number) , rate (text) , lastname (number) , firstname (number) , adults (text) , kids (number); | [Primary Keys]: rooms : roomid, reservations : code | [Foreign Keys]: reservations : room = rooms : roomid |
inn_1 | SELECT decor , count(*) FROM Rooms WHERE bedType = "King" GROUP BY decor; | Find the number of rooms with king bed for each decor type. | [Schema (values) (types)]: | inn_1 | Rooms : roomid (text) , roomname (text) , beds (text) , bedtype (number) , maxoccupancy (text) , baseprice (number) , decor (number) | Reservations : code (text) , room (text) , checkin (text) , checkout (number) , rate (text) , lastname (number) , firstname (number) , adults (text) , kids (number); | [Primary Keys]: rooms : roomid, reservations : code | [Foreign Keys]: reservations : room = rooms : roomid |
inn_1 | SELECT decor , count(*) FROM Rooms WHERE bedType = "King" GROUP BY decor; | How many rooms have king beds? Report the number for each decor type. | [Schema (values) (types)]: | inn_1 | Rooms : roomid (text) , roomname (text) , beds (text) , bedtype (number) , maxoccupancy (text) , baseprice (number) , decor (number) | Reservations : code (text) , room (text) , checkin (text) , checkout (number) , rate (text) , lastname (number) , firstname (number) , adults (text) , kids (number); | [Primary Keys]: rooms : roomid, reservations : code | [Foreign Keys]: reservations : room = rooms : roomid |
inn_1 | SELECT decor , avg(basePrice) , min(basePrice) FROM Rooms GROUP BY decor; | Find the average and minimum price of the rooms in different decor. | [Schema (values) (types)]: | inn_1 | Rooms : roomid (text) , roomname (text) , beds (text) , bedtype (number) , maxoccupancy (text) , baseprice (number) , decor (number) | Reservations : code (text) , room (text) , checkin (text) , checkout (number) , rate (text) , lastname (number) , firstname (number) , adults (text) , kids (number); | [Primary Keys]: rooms : roomid, reservations : code | [Foreign Keys]: reservations : room = rooms : roomid |
inn_1 | SELECT decor , avg(basePrice) , min(basePrice) FROM Rooms GROUP BY decor; | What is the average minimum and price of the rooms for each different decor. | [Schema (values) (types)]: | inn_1 | Rooms : roomid (text) , roomname (text) , beds (text) , bedtype (number) , maxoccupancy (text) , baseprice (number) , decor (number) | Reservations : code (text) , room (text) , checkin (text) , checkout (number) , rate (text) , lastname (number) , firstname (number) , adults (text) , kids (number); | [Primary Keys]: rooms : roomid, reservations : code | [Foreign Keys]: reservations : room = rooms : roomid |
inn_1 | SELECT roomName FROM Rooms ORDER BY basePrice; | List the name of all rooms sorted by their prices. | [Schema (values) (types)]: | inn_1 | Rooms : roomid (text) , roomname (text) , beds (text) , bedtype (number) , maxoccupancy (text) , baseprice (number) , decor (number) | Reservations : code (text) , room (text) , checkin (text) , checkout (number) , rate (text) , lastname (number) , firstname (number) , adults (text) , kids (number); | [Primary Keys]: rooms : roomid, reservations : code | [Foreign Keys]: reservations : room = rooms : roomid |
inn_1 | SELECT roomName FROM Rooms ORDER BY basePrice; | Sort all the rooms according to the price. Just report the room names. | [Schema (values) (types)]: | inn_1 | Rooms : roomid (text) , roomname (text) , beds (text) , bedtype (number) , maxoccupancy (text) , baseprice (number) , decor (number) | Reservations : code (text) , room (text) , checkin (text) , checkout (number) , rate (text) , lastname (number) , firstname (number) , adults (text) , kids (number); | [Primary Keys]: rooms : roomid, reservations : code | [Foreign Keys]: reservations : room = rooms : roomid |
inn_1 | SELECT decor , count(*) FROM Rooms WHERE basePrice > 120 GROUP BY decor; | Find the number of rooms with price higher than 120 for different decor. | [Schema (values) (types)]: | inn_1 | Rooms : roomid (text) , roomname (text) , beds (text) , bedtype (number) , maxoccupancy (text) , baseprice (number) , decor (number) | Reservations : code (text) , room (text) , checkin (text) , checkout (number) , rate (text) , lastname (number) , firstname (number) , adults (text) , kids (number); | [Primary Keys]: rooms : roomid, reservations : code | [Foreign Keys]: reservations : room = rooms : roomid |
inn_1 | SELECT decor , count(*) FROM Rooms WHERE basePrice > 120 GROUP BY decor; | How many rooms cost more than 120, for each different decor? | [Schema (values) (types)]: | inn_1 | Rooms : roomid (text) , roomname (text) , beds (text) , bedtype (number) , maxoccupancy (text) , baseprice (number) , decor (number) | Reservations : code (text) , room (text) , checkin (text) , checkout (number) , rate (text) , lastname (number) , firstname (number) , adults (text) , kids (number); | [Primary Keys]: rooms : roomid, reservations : code | [Foreign Keys]: reservations : room = rooms : roomid |
inn_1 | SELECT bedType , avg(basePrice) FROM Rooms GROUP BY bedType; | For each bed type, find the average room price. | [Schema (values) (types)]: | inn_1 | Rooms : roomid (text) , roomname (text) , beds (text) , bedtype (number) , maxoccupancy (text) , baseprice (number) , decor (number) | Reservations : code (text) , room (text) , checkin (text) , checkout (number) , rate (text) , lastname (number) , firstname (number) , adults (text) , kids (number); | [Primary Keys]: rooms : roomid, reservations : code | [Foreign Keys]: reservations : room = rooms : roomid |
inn_1 | SELECT bedType , avg(basePrice) FROM Rooms GROUP BY bedType; | What is the average base price of rooms, for each bed type? | [Schema (values) (types)]: | inn_1 | Rooms : roomid (text) , roomname (text) , beds (text) , bedtype (number) , maxoccupancy (text) , baseprice (number) , decor (number) | Reservations : code (text) , room (text) , checkin (text) , checkout (number) , rate (text) , lastname (number) , firstname (number) , adults (text) , kids (number); | [Primary Keys]: rooms : roomid, reservations : code | [Foreign Keys]: reservations : room = rooms : roomid |
inn_1 | SELECT roomName FROM Rooms WHERE bedType = "King" OR bedType = "Queen"; | List the name of rooms with king or queen bed. | [Schema (values) (types)]: | inn_1 | Rooms : roomid (text) , roomname (text) , beds (text) , bedtype (number) , maxoccupancy (text) , baseprice (number) , decor (number) | Reservations : code (text) , room (text) , checkin (text) , checkout (number) , rate (text) , lastname (number) , firstname (number) , adults (text) , kids (number); | [Primary Keys]: rooms : roomid, reservations : code | [Foreign Keys]: reservations : room = rooms : roomid |
inn_1 | SELECT roomName FROM Rooms WHERE bedType = "King" OR bedType = "Queen"; | What are the names of rooms that have either king or queen bed? | [Schema (values) (types)]: | inn_1 | Rooms : roomid (text) , roomname (text) , beds (text) , bedtype (number) , maxoccupancy (text) , baseprice (number) , decor (number) | Reservations : code (text) , room (text) , checkin (text) , checkout (number) , rate (text) , lastname (number) , firstname (number) , adults (text) , kids (number); | [Primary Keys]: rooms : roomid, reservations : code | [Foreign Keys]: reservations : room = rooms : roomid |
inn_1 | SELECT count(DISTINCT bedType) FROM Rooms; | How many different types of beds are there? | [Schema (values) (types)]: | inn_1 | Rooms : roomid (text) , roomname (text) , beds (text) , bedtype (number) , maxoccupancy (text) , baseprice (number) , decor (number) | Reservations : code (text) , room (text) , checkin (text) , checkout (number) , rate (text) , lastname (number) , firstname (number) , adults (text) , kids (number); | [Primary Keys]: rooms : roomid, reservations : code | [Foreign Keys]: reservations : room = rooms : roomid |
inn_1 | SELECT count(DISTINCT bedType) FROM Rooms; | Find the number of distinct bed types available in this inn. | [Schema (values) (types)]: | inn_1 | Rooms : roomid (text) , roomname (text) , beds (text) , bedtype (number) , maxoccupancy (text) , baseprice (number) , decor (number) | Reservations : code (text) , room (text) , checkin (text) , checkout (number) , rate (text) , lastname (number) , firstname (number) , adults (text) , kids (number); | [Primary Keys]: rooms : roomid, reservations : code | [Foreign Keys]: reservations : room = rooms : roomid |
inn_1 | SELECT RoomId , roomName FROM Rooms ORDER BY basePrice DESC LIMIT 3; | Find the name and id of the top 3 expensive rooms. | [Schema (values) (types)]: | inn_1 | Rooms : roomid (text) , roomname (text) , beds (text) , bedtype (number) , maxoccupancy (text) , baseprice (number) , decor (number) | Reservations : code (text) , room (text) , checkin (text) , checkout (number) , rate (text) , lastname (number) , firstname (number) , adults (text) , kids (number); | [Primary Keys]: rooms : roomid, reservations : code | [Foreign Keys]: reservations : room = rooms : roomid |
inn_1 | SELECT RoomId , roomName FROM Rooms ORDER BY basePrice DESC LIMIT 3; | What are the name and id of the three highest priced rooms? | [Schema (values) (types)]: | inn_1 | Rooms : roomid (text) , roomname (text) , beds (text) , bedtype (number) , maxoccupancy (text) , baseprice (number) , decor (number) | Reservations : code (text) , room (text) , checkin (text) , checkout (number) , rate (text) , lastname (number) , firstname (number) , adults (text) , kids (number); | [Primary Keys]: rooms : roomid, reservations : code | [Foreign Keys]: reservations : room = rooms : roomid |
inn_1 | SELECT roomName FROM Rooms WHERE basePrice > ( SELECT avg(basePrice) FROM Rooms ); | Find the name of rooms whose price is higher than the average price. | [Schema (values) (types)]: | inn_1 | Rooms : roomid (text) , roomname (text) , beds (text) , bedtype (number) , maxoccupancy (text) , baseprice (number) , decor (number) | Reservations : code (text) , room (text) , checkin (text) , checkout (number) , rate (text) , lastname (number) , firstname (number) , adults (text) , kids (number); | [Primary Keys]: rooms : roomid, reservations : code | [Foreign Keys]: reservations : room = rooms : roomid |
inn_1 | SELECT roomName FROM Rooms WHERE basePrice > ( SELECT avg(basePrice) FROM Rooms ); | What are the name of rooms that cost more than the average. | [Schema (values) (types)]: | inn_1 | Rooms : roomid (text) , roomname (text) , beds (text) , bedtype (number) , maxoccupancy (text) , baseprice (number) , decor (number) | Reservations : code (text) , room (text) , checkin (text) , checkout (number) , rate (text) , lastname (number) , firstname (number) , adults (text) , kids (number); | [Primary Keys]: rooms : roomid, reservations : code | [Foreign Keys]: reservations : room = rooms : roomid |
inn_1 | SELECT count(*) FROM rooms WHERE roomid NOT IN (SELECT DISTINCT room FROM reservations) | Find the number of rooms that do not have any reservation. | [Schema (values) (types)]: | inn_1 | Rooms : roomid (text) , roomname (text) , beds (text) , bedtype (number) , maxoccupancy (text) , baseprice (number) , decor (number) | Reservations : code (text) , room (text) , checkin (text) , checkout (number) , rate (text) , lastname (number) , firstname (number) , adults (text) , kids (number); | [Primary Keys]: rooms : roomid, reservations : code | [Foreign Keys]: reservations : room = rooms : roomid |
inn_1 | SELECT count(*) FROM rooms WHERE roomid NOT IN (SELECT DISTINCT room FROM reservations) | How many rooms have not had any reservation yet? | [Schema (values) (types)]: | inn_1 | Rooms : roomid (text) , roomname (text) , beds (text) , bedtype (number) , maxoccupancy (text) , baseprice (number) , decor (number) | Reservations : code (text) , room (text) , checkin (text) , checkout (number) , rate (text) , lastname (number) , firstname (number) , adults (text) , kids (number); | [Primary Keys]: rooms : roomid, reservations : code | [Foreign Keys]: reservations : room = rooms : roomid |
inn_1 | SELECT T2.roomName , count(*) , T1.Room FROM Reservations AS T1 JOIN Rooms AS T2 ON T1.Room = T2.RoomId GROUP BY T1.Room | Return the name and number of reservations made for each of the rooms. | [Schema (values) (types)]: | inn_1 | Rooms : roomid (text) , roomname (text) , beds (text) , bedtype (number) , maxoccupancy (text) , baseprice (number) , decor (number) | Reservations : code (text) , room (text) , checkin (text) , checkout (number) , rate (text) , lastname (number) , firstname (number) , adults (text) , kids (number); | [Primary Keys]: rooms : roomid, reservations : code | [Foreign Keys]: reservations : room = rooms : roomid |
inn_1 | SELECT T2.roomName , count(*) , T1.Room FROM Reservations AS T1 JOIN Rooms AS T2 ON T1.Room = T2.RoomId GROUP BY T1.Room | For each room, find its name and the number of times reservations were made for it. | [Schema (values) (types)]: | inn_1 | Rooms : roomid (text) , roomname (text) , beds (text) , bedtype (number) , maxoccupancy (text) , baseprice (number) , decor (number) | Reservations : code (text) , room (text) , checkin (text) , checkout (number) , rate (text) , lastname (number) , firstname (number) , adults (text) , kids (number); | [Primary Keys]: rooms : roomid, reservations : code | [Foreign Keys]: reservations : room = rooms : roomid |
inn_1 | SELECT T2.roomName FROM Reservations AS T1 JOIN Rooms AS T2 ON T1.Room = T2.RoomId GROUP BY T1.Room HAVING count(*) > 60 | Find the names of rooms that have been reserved for more than 60 times. | [Schema (values) (types)]: | inn_1 | Rooms : roomid (text) , roomname (text) , beds (text) , bedtype (number) , maxoccupancy (text) , baseprice (number) , decor (number) | Reservations : code (text) , room (text) , checkin (text) , checkout (number) , rate (text) , lastname (number) , firstname (number) , adults (text) , kids (number); | [Primary Keys]: rooms : roomid, reservations : code | [Foreign Keys]: reservations : room = rooms : roomid |
inn_1 | SELECT T2.roomName FROM Reservations AS T1 JOIN Rooms AS T2 ON T1.Room = T2.RoomId GROUP BY T1.Room HAVING count(*) > 60 | What are the names of rooms whose reservation frequency exceeds 60 times? | [Schema (values) (types)]: | inn_1 | Rooms : roomid (text) , roomname (text) , beds (text) , bedtype (number) , maxoccupancy (text) , baseprice (number) , decor (number) | Reservations : code (text) , room (text) , checkin (text) , checkout (number) , rate (text) , lastname (number) , firstname (number) , adults (text) , kids (number); | [Primary Keys]: rooms : roomid, reservations : code | [Foreign Keys]: reservations : room = rooms : roomid |
inn_1 | SELECT roomname FROM rooms WHERE baseprice BETWEEN 120 AND 150 | Find the name of rooms whose base price is between 120 and 150. | [Schema (values) (types)]: | inn_1 | Rooms : roomid (text) , roomname (text) , beds (text) , bedtype (number) , maxoccupancy (text) , baseprice (number) , decor (number) | Reservations : code (text) , room (text) , checkin (text) , checkout (number) , rate (text) , lastname (number) , firstname (number) , adults (text) , kids (number); | [Primary Keys]: rooms : roomid, reservations : code | [Foreign Keys]: reservations : room = rooms : roomid |
inn_1 | SELECT roomname FROM rooms WHERE baseprice BETWEEN 120 AND 150 | Which rooms cost between 120 and 150? Give me the room names. | [Schema (values) (types)]: | inn_1 | Rooms : roomid (text) , roomname (text) , beds (text) , bedtype (number) , maxoccupancy (text) , baseprice (number) , decor (number) | Reservations : code (text) , room (text) , checkin (text) , checkout (number) , rate (text) , lastname (number) , firstname (number) , adults (text) , kids (number); | [Primary Keys]: rooms : roomid, reservations : code | [Foreign Keys]: reservations : room = rooms : roomid |
inn_1 | SELECT T2.roomName FROM Reservations AS T1 JOIN Rooms AS T2 ON T1.Room = T2.RoomId WHERE firstname LIKE '%ROY%' | Find the name of rooms booked by some customers whose first name contains ROY. | [Schema (values) (types)]: | inn_1 | Rooms : roomid (text) , roomname (text) , beds (text) , bedtype (number) , maxoccupancy (text) , baseprice (number) , decor (number) | Reservations : code (text) , room (text) , checkin (text) , checkout (number) , rate (text) , lastname (number) , firstname (number) , adults (text) , kids (number); | [Primary Keys]: rooms : roomid, reservations : code | [Foreign Keys]: reservations : room = rooms : roomid |
inn_1 | SELECT T2.roomName FROM Reservations AS T1 JOIN Rooms AS T2 ON T1.Room = T2.RoomId WHERE firstname LIKE '%ROY%' | What are the name of rooms booked by customers whose first name has "ROY" in part? | [Schema (values) (types)]: | inn_1 | Rooms : roomid (text) , roomname (text) , beds (text) , bedtype (number) , maxoccupancy (text) , baseprice (number) , decor (number) | Reservations : code (text) , room (text) , checkin (text) , checkout (number) , rate (text) , lastname (number) , firstname (number) , adults (text) , kids (number); | [Primary Keys]: rooms : roomid, reservations : code | [Foreign Keys]: reservations : room = rooms : roomid |
local_govt_mdm | SELECT T1.cmi_details FROM Customer_Master_Index AS T1 JOIN CMI_Cross_References AS T2 ON T1.master_customer_id = T2.master_customer_id WHERE T2.source_system_code = 'Tax' | what are the details of the cmi masters that have the cross reference code 'Tax'? | [Schema (values) (types)]: | local_govt_mdm | Customer_Master_Index : master_customer_id (text) , cmi_details (number) | CMI_Cross_References : cmi_cross_ref_id (text) , master_customer_id (number) , source_system_code (text) | Council_Tax : council_tax_id (text) , cmi_cross_ref_id (number) | Business_Rates : business_rates_id (text) , cmi_cross_ref_id (number) | Benefits_Overpayments : council_tax_id (text) , cmi_cross_ref_id (number) | Parking_Fines : council_tax_id (text) , cmi_cross_ref_id (number) | Rent_Arrears : council_tax_id (text) , cmi_cross_ref_id (number) | Electoral_Register : electoral_register_id (text) , cmi_cross_ref_id (number); | [Primary Keys]: customer_master_index : master_customer_id, cmi_cross_references : cmi_cross_ref_id, council_tax : council_tax_id, business_rates : business_rates_id, benefits_overpayments : council_tax_id, parking_fines : council_tax_id, rent_arrears : council_tax_id, electoral_register : electoral_register_id | [Foreign Keys]: cmi_cross_references : master_customer_id = customer_master_index : master_customer_id | council_tax : cmi_cross_ref_id = cmi_cross_references : cmi_cross_ref_id | business_rates : cmi_cross_ref_id = cmi_cross_references : cmi_cross_ref_id | benefits_overpayments : cmi_cross_ref_id = cmi_cross_references : cmi_cross_ref_id | parking_fines : cmi_cross_ref_id = cmi_cross_references : cmi_cross_ref_id | rent_arrears : cmi_cross_ref_id = cmi_cross_references : cmi_cross_ref_id | electoral_register : cmi_cross_ref_id = cmi_cross_references : cmi_cross_ref_id |
local_govt_mdm | SELECT T1.cmi_cross_ref_id , T1.source_system_code FROM CMI_Cross_References AS T1 JOIN Council_Tax AS T2 ON T1.cmi_cross_ref_id = T2.cmi_cross_ref_id GROUP BY T1.cmi_cross_ref_id HAVING count(*) >= 1 | What is the cmi cross reference id that is related to at least one council tax entry? List the cross reference id and source system code. | [Schema (values) (types)]: | local_govt_mdm | Customer_Master_Index : master_customer_id (text) , cmi_details (number) | CMI_Cross_References : cmi_cross_ref_id (text) , master_customer_id (number) , source_system_code (text) | Council_Tax : council_tax_id (text) , cmi_cross_ref_id (number) | Business_Rates : business_rates_id (text) , cmi_cross_ref_id (number) | Benefits_Overpayments : council_tax_id (text) , cmi_cross_ref_id (number) | Parking_Fines : council_tax_id (text) , cmi_cross_ref_id (number) | Rent_Arrears : council_tax_id (text) , cmi_cross_ref_id (number) | Electoral_Register : electoral_register_id (text) , cmi_cross_ref_id (number); | [Primary Keys]: customer_master_index : master_customer_id, cmi_cross_references : cmi_cross_ref_id, council_tax : council_tax_id, business_rates : business_rates_id, benefits_overpayments : council_tax_id, parking_fines : council_tax_id, rent_arrears : council_tax_id, electoral_register : electoral_register_id | [Foreign Keys]: cmi_cross_references : master_customer_id = customer_master_index : master_customer_id | council_tax : cmi_cross_ref_id = cmi_cross_references : cmi_cross_ref_id | business_rates : cmi_cross_ref_id = cmi_cross_references : cmi_cross_ref_id | benefits_overpayments : cmi_cross_ref_id = cmi_cross_references : cmi_cross_ref_id | parking_fines : cmi_cross_ref_id = cmi_cross_references : cmi_cross_ref_id | rent_arrears : cmi_cross_ref_id = cmi_cross_references : cmi_cross_ref_id | electoral_register : cmi_cross_ref_id = cmi_cross_references : cmi_cross_ref_id |
local_govt_mdm | SELECT T2.cmi_cross_ref_id , T2.master_customer_id , count(*) FROM Business_Rates AS T1 JOIN CMI_Cross_References AS T2 ON T1.cmi_cross_ref_id = T2.cmi_cross_ref_id GROUP BY T2.cmi_cross_ref_id | How many business rates are related to each cmi cross reference? List cross reference id, master customer id and the n | [Schema (values) (types)]: | local_govt_mdm | Customer_Master_Index : master_customer_id (text) , cmi_details (number) | CMI_Cross_References : cmi_cross_ref_id (text) , master_customer_id (number) , source_system_code (text) | Council_Tax : council_tax_id (text) , cmi_cross_ref_id (number) | Business_Rates : business_rates_id (text) , cmi_cross_ref_id (number) | Benefits_Overpayments : council_tax_id (text) , cmi_cross_ref_id (number) | Parking_Fines : council_tax_id (text) , cmi_cross_ref_id (number) | Rent_Arrears : council_tax_id (text) , cmi_cross_ref_id (number) | Electoral_Register : electoral_register_id (text) , cmi_cross_ref_id (number); | [Primary Keys]: customer_master_index : master_customer_id, cmi_cross_references : cmi_cross_ref_id, council_tax : council_tax_id, business_rates : business_rates_id, benefits_overpayments : council_tax_id, parking_fines : council_tax_id, rent_arrears : council_tax_id, electoral_register : electoral_register_id | [Foreign Keys]: cmi_cross_references : master_customer_id = customer_master_index : master_customer_id | council_tax : cmi_cross_ref_id = cmi_cross_references : cmi_cross_ref_id | business_rates : cmi_cross_ref_id = cmi_cross_references : cmi_cross_ref_id | benefits_overpayments : cmi_cross_ref_id = cmi_cross_references : cmi_cross_ref_id | parking_fines : cmi_cross_ref_id = cmi_cross_references : cmi_cross_ref_id | rent_arrears : cmi_cross_ref_id = cmi_cross_references : cmi_cross_ref_id | electoral_register : cmi_cross_ref_id = cmi_cross_references : cmi_cross_ref_id |
local_govt_mdm | SELECT T1.source_system_code , T2.council_tax_id FROM CMI_Cross_References AS T1 JOIN Benefits_Overpayments AS T2 ON T1.cmi_cross_ref_id = T2.cmi_cross_ref_id ORDER BY T2.council_tax_id | What is the tax source system code related to the benefits and overpayments? List the code and the benifit id, order by benifit id. | [Schema (values) (types)]: | local_govt_mdm | Customer_Master_Index : master_customer_id (text) , cmi_details (number) | CMI_Cross_References : cmi_cross_ref_id (text) , master_customer_id (number) , source_system_code (text) | Council_Tax : council_tax_id (text) , cmi_cross_ref_id (number) | Business_Rates : business_rates_id (text) , cmi_cross_ref_id (number) | Benefits_Overpayments : council_tax_id (text) , cmi_cross_ref_id (number) | Parking_Fines : council_tax_id (text) , cmi_cross_ref_id (number) | Rent_Arrears : council_tax_id (text) , cmi_cross_ref_id (number) | Electoral_Register : electoral_register_id (text) , cmi_cross_ref_id (number); | [Primary Keys]: customer_master_index : master_customer_id, cmi_cross_references : cmi_cross_ref_id, council_tax : council_tax_id, business_rates : business_rates_id, benefits_overpayments : council_tax_id, parking_fines : council_tax_id, rent_arrears : council_tax_id, electoral_register : electoral_register_id | [Foreign Keys]: cmi_cross_references : master_customer_id = customer_master_index : master_customer_id | council_tax : cmi_cross_ref_id = cmi_cross_references : cmi_cross_ref_id | business_rates : cmi_cross_ref_id = cmi_cross_references : cmi_cross_ref_id | benefits_overpayments : cmi_cross_ref_id = cmi_cross_references : cmi_cross_ref_id | parking_fines : cmi_cross_ref_id = cmi_cross_references : cmi_cross_ref_id | rent_arrears : cmi_cross_ref_id = cmi_cross_references : cmi_cross_ref_id | electoral_register : cmi_cross_ref_id = cmi_cross_references : cmi_cross_ref_id |
local_govt_mdm | SELECT T1.source_system_code , T1.master_customer_id , T2.council_tax_id FROM CMI_Cross_References AS T1 JOIN Parking_Fines AS T2 ON T1.cmi_cross_ref_id = T2.cmi_cross_ref_id | Wat is the tax source system code and master customer id of the taxes related to each parking fine id? | [Schema (values) (types)]: | local_govt_mdm | Customer_Master_Index : master_customer_id (text) , cmi_details (number) | CMI_Cross_References : cmi_cross_ref_id (text) , master_customer_id (number) , source_system_code (text) | Council_Tax : council_tax_id (text) , cmi_cross_ref_id (number) | Business_Rates : business_rates_id (text) , cmi_cross_ref_id (number) | Benefits_Overpayments : council_tax_id (text) , cmi_cross_ref_id (number) | Parking_Fines : council_tax_id (text) , cmi_cross_ref_id (number) | Rent_Arrears : council_tax_id (text) , cmi_cross_ref_id (number) | Electoral_Register : electoral_register_id (text) , cmi_cross_ref_id (number); | [Primary Keys]: customer_master_index : master_customer_id, cmi_cross_references : cmi_cross_ref_id, council_tax : council_tax_id, business_rates : business_rates_id, benefits_overpayments : council_tax_id, parking_fines : council_tax_id, rent_arrears : council_tax_id, electoral_register : electoral_register_id | [Foreign Keys]: cmi_cross_references : master_customer_id = customer_master_index : master_customer_id | council_tax : cmi_cross_ref_id = cmi_cross_references : cmi_cross_ref_id | business_rates : cmi_cross_ref_id = cmi_cross_references : cmi_cross_ref_id | benefits_overpayments : cmi_cross_ref_id = cmi_cross_references : cmi_cross_ref_id | parking_fines : cmi_cross_ref_id = cmi_cross_references : cmi_cross_ref_id | rent_arrears : cmi_cross_ref_id = cmi_cross_references : cmi_cross_ref_id | electoral_register : cmi_cross_ref_id = cmi_cross_references : cmi_cross_ref_id |
local_govt_mdm | SELECT T1.council_tax_id FROM Rent_Arrears AS T1 JOIN CMI_Cross_References AS T2 ON T1.cmi_cross_ref_id = T2.cmi_cross_ref_id JOIN Customer_Master_Index AS T3 ON T3.master_customer_id = T2.master_customer_id WHERE T3.cmi_details != 'Schmidt , Kertzmann and Lubowitz' | What are the renting arrears tax ids related to the customer master index whose detail is not 'Schmidt, Kertzmann and Lubowitz'? | [Schema (values) (types)]: | local_govt_mdm | Customer_Master_Index : master_customer_id (text) , cmi_details (number) | CMI_Cross_References : cmi_cross_ref_id (text) , master_customer_id (number) , source_system_code (text) | Council_Tax : council_tax_id (text) , cmi_cross_ref_id (number) | Business_Rates : business_rates_id (text) , cmi_cross_ref_id (number) | Benefits_Overpayments : council_tax_id (text) , cmi_cross_ref_id (number) | Parking_Fines : council_tax_id (text) , cmi_cross_ref_id (number) | Rent_Arrears : council_tax_id (text) , cmi_cross_ref_id (number) | Electoral_Register : electoral_register_id (text) , cmi_cross_ref_id (number); | [Primary Keys]: customer_master_index : master_customer_id, cmi_cross_references : cmi_cross_ref_id, council_tax : council_tax_id, business_rates : business_rates_id, benefits_overpayments : council_tax_id, parking_fines : council_tax_id, rent_arrears : council_tax_id, electoral_register : electoral_register_id | [Foreign Keys]: cmi_cross_references : master_customer_id = customer_master_index : master_customer_id | council_tax : cmi_cross_ref_id = cmi_cross_references : cmi_cross_ref_id | business_rates : cmi_cross_ref_id = cmi_cross_references : cmi_cross_ref_id | benefits_overpayments : cmi_cross_ref_id = cmi_cross_references : cmi_cross_ref_id | parking_fines : cmi_cross_ref_id = cmi_cross_references : cmi_cross_ref_id | rent_arrears : cmi_cross_ref_id = cmi_cross_references : cmi_cross_ref_id | electoral_register : cmi_cross_ref_id = cmi_cross_references : cmi_cross_ref_id |
local_govt_mdm | SELECT T1.electoral_register_id FROM Electoral_Register AS T1 JOIN CMI_Cross_References AS T2 ON T1.cmi_cross_ref_id = T2.cmi_cross_ref_id WHERE T2.source_system_code = 'Electoral' OR T2.source_system_code = 'Tax' | What are the register ids of electoral registries that have the cross reference source system code 'Electoral' or 'Tax'? | [Schema (values) (types)]: | local_govt_mdm | Customer_Master_Index : master_customer_id (text) , cmi_details (number) | CMI_Cross_References : cmi_cross_ref_id (text) , master_customer_id (number) , source_system_code (text) | Council_Tax : council_tax_id (text) , cmi_cross_ref_id (number) | Business_Rates : business_rates_id (text) , cmi_cross_ref_id (number) | Benefits_Overpayments : council_tax_id (text) , cmi_cross_ref_id (number) | Parking_Fines : council_tax_id (text) , cmi_cross_ref_id (number) | Rent_Arrears : council_tax_id (text) , cmi_cross_ref_id (number) | Electoral_Register : electoral_register_id (text) , cmi_cross_ref_id (number); | [Primary Keys]: customer_master_index : master_customer_id, cmi_cross_references : cmi_cross_ref_id, council_tax : council_tax_id, business_rates : business_rates_id, benefits_overpayments : council_tax_id, parking_fines : council_tax_id, rent_arrears : council_tax_id, electoral_register : electoral_register_id | [Foreign Keys]: cmi_cross_references : master_customer_id = customer_master_index : master_customer_id | council_tax : cmi_cross_ref_id = cmi_cross_references : cmi_cross_ref_id | business_rates : cmi_cross_ref_id = cmi_cross_references : cmi_cross_ref_id | benefits_overpayments : cmi_cross_ref_id = cmi_cross_references : cmi_cross_ref_id | parking_fines : cmi_cross_ref_id = cmi_cross_references : cmi_cross_ref_id | rent_arrears : cmi_cross_ref_id = cmi_cross_references : cmi_cross_ref_id | electoral_register : cmi_cross_ref_id = cmi_cross_references : cmi_cross_ref_id |
local_govt_mdm | SELECT count(DISTINCT source_system_code) FROM CMI_cross_references | How many different source system code for the cmi cross references are there? | [Schema (values) (types)]: | local_govt_mdm | Customer_Master_Index : master_customer_id (text) , cmi_details (number) | CMI_Cross_References : cmi_cross_ref_id (text) , master_customer_id (number) , source_system_code (text) | Council_Tax : council_tax_id (text) , cmi_cross_ref_id (number) | Business_Rates : business_rates_id (text) , cmi_cross_ref_id (number) | Benefits_Overpayments : council_tax_id (text) , cmi_cross_ref_id (number) | Parking_Fines : council_tax_id (text) , cmi_cross_ref_id (number) | Rent_Arrears : council_tax_id (text) , cmi_cross_ref_id (number) | Electoral_Register : electoral_register_id (text) , cmi_cross_ref_id (number); | [Primary Keys]: customer_master_index : master_customer_id, cmi_cross_references : cmi_cross_ref_id, council_tax : council_tax_id, business_rates : business_rates_id, benefits_overpayments : council_tax_id, parking_fines : council_tax_id, rent_arrears : council_tax_id, electoral_register : electoral_register_id | [Foreign Keys]: cmi_cross_references : master_customer_id = customer_master_index : master_customer_id | council_tax : cmi_cross_ref_id = cmi_cross_references : cmi_cross_ref_id | business_rates : cmi_cross_ref_id = cmi_cross_references : cmi_cross_ref_id | benefits_overpayments : cmi_cross_ref_id = cmi_cross_references : cmi_cross_ref_id | parking_fines : cmi_cross_ref_id = cmi_cross_references : cmi_cross_ref_id | rent_arrears : cmi_cross_ref_id = cmi_cross_references : cmi_cross_ref_id | electoral_register : cmi_cross_ref_id = cmi_cross_references : cmi_cross_ref_id |
local_govt_mdm | SELECT * FROM customer_master_index ORDER BY cmi_details DESC | List all information about customer master index, and sort them by details in descending order. | [Schema (values) (types)]: | local_govt_mdm | Customer_Master_Index : master_customer_id (text) , cmi_details (number) | CMI_Cross_References : cmi_cross_ref_id (text) , master_customer_id (number) , source_system_code (text) | Council_Tax : council_tax_id (text) , cmi_cross_ref_id (number) | Business_Rates : business_rates_id (text) , cmi_cross_ref_id (number) | Benefits_Overpayments : council_tax_id (text) , cmi_cross_ref_id (number) | Parking_Fines : council_tax_id (text) , cmi_cross_ref_id (number) | Rent_Arrears : council_tax_id (text) , cmi_cross_ref_id (number) | Electoral_Register : electoral_register_id (text) , cmi_cross_ref_id (number); | [Primary Keys]: customer_master_index : master_customer_id, cmi_cross_references : cmi_cross_ref_id, council_tax : council_tax_id, business_rates : business_rates_id, benefits_overpayments : council_tax_id, parking_fines : council_tax_id, rent_arrears : council_tax_id, electoral_register : electoral_register_id | [Foreign Keys]: cmi_cross_references : master_customer_id = customer_master_index : master_customer_id | council_tax : cmi_cross_ref_id = cmi_cross_references : cmi_cross_ref_id | business_rates : cmi_cross_ref_id = cmi_cross_references : cmi_cross_ref_id | benefits_overpayments : cmi_cross_ref_id = cmi_cross_references : cmi_cross_ref_id | parking_fines : cmi_cross_ref_id = cmi_cross_references : cmi_cross_ref_id | rent_arrears : cmi_cross_ref_id = cmi_cross_references : cmi_cross_ref_id | electoral_register : cmi_cross_ref_id = cmi_cross_references : cmi_cross_ref_id |
local_govt_mdm | SELECT council_tax_id , cmi_cross_ref_id FROM parking_fines | List the council tax ids and their related cmi cross references of all the parking fines. | [Schema (values) (types)]: | local_govt_mdm | Customer_Master_Index : master_customer_id (text) , cmi_details (number) | CMI_Cross_References : cmi_cross_ref_id (text) , master_customer_id (number) , source_system_code (text) | Council_Tax : council_tax_id (text) , cmi_cross_ref_id (number) | Business_Rates : business_rates_id (text) , cmi_cross_ref_id (number) | Benefits_Overpayments : council_tax_id (text) , cmi_cross_ref_id (number) | Parking_Fines : council_tax_id (text) , cmi_cross_ref_id (number) | Rent_Arrears : council_tax_id (text) , cmi_cross_ref_id (number) | Electoral_Register : electoral_register_id (text) , cmi_cross_ref_id (number); | [Primary Keys]: customer_master_index : master_customer_id, cmi_cross_references : cmi_cross_ref_id, council_tax : council_tax_id, business_rates : business_rates_id, benefits_overpayments : council_tax_id, parking_fines : council_tax_id, rent_arrears : council_tax_id, electoral_register : electoral_register_id | [Foreign Keys]: cmi_cross_references : master_customer_id = customer_master_index : master_customer_id | council_tax : cmi_cross_ref_id = cmi_cross_references : cmi_cross_ref_id | business_rates : cmi_cross_ref_id = cmi_cross_references : cmi_cross_ref_id | benefits_overpayments : cmi_cross_ref_id = cmi_cross_references : cmi_cross_ref_id | parking_fines : cmi_cross_ref_id = cmi_cross_references : cmi_cross_ref_id | rent_arrears : cmi_cross_ref_id = cmi_cross_references : cmi_cross_ref_id | electoral_register : cmi_cross_ref_id = cmi_cross_references : cmi_cross_ref_id |
local_govt_mdm | SELECT count(*) FROM rent_arrears | How many council taxes are collected for renting arrears ? | [Schema (values) (types)]: | local_govt_mdm | Customer_Master_Index : master_customer_id (text) , cmi_details (number) | CMI_Cross_References : cmi_cross_ref_id (text) , master_customer_id (number) , source_system_code (text) | Council_Tax : council_tax_id (text) , cmi_cross_ref_id (number) | Business_Rates : business_rates_id (text) , cmi_cross_ref_id (number) | Benefits_Overpayments : council_tax_id (text) , cmi_cross_ref_id (number) | Parking_Fines : council_tax_id (text) , cmi_cross_ref_id (number) | Rent_Arrears : council_tax_id (text) , cmi_cross_ref_id (number) | Electoral_Register : electoral_register_id (text) , cmi_cross_ref_id (number); | [Primary Keys]: customer_master_index : master_customer_id, cmi_cross_references : cmi_cross_ref_id, council_tax : council_tax_id, business_rates : business_rates_id, benefits_overpayments : council_tax_id, parking_fines : council_tax_id, rent_arrears : council_tax_id, electoral_register : electoral_register_id | [Foreign Keys]: cmi_cross_references : master_customer_id = customer_master_index : master_customer_id | council_tax : cmi_cross_ref_id = cmi_cross_references : cmi_cross_ref_id | business_rates : cmi_cross_ref_id = cmi_cross_references : cmi_cross_ref_id | benefits_overpayments : cmi_cross_ref_id = cmi_cross_references : cmi_cross_ref_id | parking_fines : cmi_cross_ref_id = cmi_cross_references : cmi_cross_ref_id | rent_arrears : cmi_cross_ref_id = cmi_cross_references : cmi_cross_ref_id | electoral_register : cmi_cross_ref_id = cmi_cross_references : cmi_cross_ref_id |
local_govt_mdm | SELECT DISTINCT T2.source_system_code FROM customer_master_index AS T1 JOIN cmi_cross_references AS T2 ON T1.master_customer_id = T2.master_customer_id WHERE T1.cmi_details = 'Gottlieb , Becker and Wyman' | What are the distinct cross reference source system codes which are related to the master customer details 'Gottlieb, Becker and Wyman'? | [Schema (values) (types)]: | local_govt_mdm | Customer_Master_Index : master_customer_id (text) , cmi_details (number) | CMI_Cross_References : cmi_cross_ref_id (text) , master_customer_id (number) , source_system_code (text) | Council_Tax : council_tax_id (text) , cmi_cross_ref_id (number) | Business_Rates : business_rates_id (text) , cmi_cross_ref_id (number) | Benefits_Overpayments : council_tax_id (text) , cmi_cross_ref_id (number) | Parking_Fines : council_tax_id (text) , cmi_cross_ref_id (number) | Rent_Arrears : council_tax_id (text) , cmi_cross_ref_id (number) | Electoral_Register : electoral_register_id (text) , cmi_cross_ref_id (number); | [Primary Keys]: customer_master_index : master_customer_id, cmi_cross_references : cmi_cross_ref_id, council_tax : council_tax_id, business_rates : business_rates_id, benefits_overpayments : council_tax_id, parking_fines : council_tax_id, rent_arrears : council_tax_id, electoral_register : electoral_register_id | [Foreign Keys]: cmi_cross_references : master_customer_id = customer_master_index : master_customer_id | council_tax : cmi_cross_ref_id = cmi_cross_references : cmi_cross_ref_id | business_rates : cmi_cross_ref_id = cmi_cross_references : cmi_cross_ref_id | benefits_overpayments : cmi_cross_ref_id = cmi_cross_references : cmi_cross_ref_id | parking_fines : cmi_cross_ref_id = cmi_cross_references : cmi_cross_ref_id | rent_arrears : cmi_cross_ref_id = cmi_cross_references : cmi_cross_ref_id | electoral_register : cmi_cross_ref_id = cmi_cross_references : cmi_cross_ref_id |
local_govt_mdm | SELECT cmi_cross_ref_id FROM cmi_cross_references EXCEPT SELECT cmi_cross_ref_id FROM parking_fines | Which cmi cross reference id is not related to any parking taxes? | [Schema (values) (types)]: | local_govt_mdm | Customer_Master_Index : master_customer_id (text) , cmi_details (number) | CMI_Cross_References : cmi_cross_ref_id (text) , master_customer_id (number) , source_system_code (text) | Council_Tax : council_tax_id (text) , cmi_cross_ref_id (number) | Business_Rates : business_rates_id (text) , cmi_cross_ref_id (number) | Benefits_Overpayments : council_tax_id (text) , cmi_cross_ref_id (number) | Parking_Fines : council_tax_id (text) , cmi_cross_ref_id (number) | Rent_Arrears : council_tax_id (text) , cmi_cross_ref_id (number) | Electoral_Register : electoral_register_id (text) , cmi_cross_ref_id (number); | [Primary Keys]: customer_master_index : master_customer_id, cmi_cross_references : cmi_cross_ref_id, council_tax : council_tax_id, business_rates : business_rates_id, benefits_overpayments : council_tax_id, parking_fines : council_tax_id, rent_arrears : council_tax_id, electoral_register : electoral_register_id | [Foreign Keys]: cmi_cross_references : master_customer_id = customer_master_index : master_customer_id | council_tax : cmi_cross_ref_id = cmi_cross_references : cmi_cross_ref_id | business_rates : cmi_cross_ref_id = cmi_cross_references : cmi_cross_ref_id | benefits_overpayments : cmi_cross_ref_id = cmi_cross_references : cmi_cross_ref_id | parking_fines : cmi_cross_ref_id = cmi_cross_references : cmi_cross_ref_id | rent_arrears : cmi_cross_ref_id = cmi_cross_references : cmi_cross_ref_id | electoral_register : cmi_cross_ref_id = cmi_cross_references : cmi_cross_ref_id |
local_govt_mdm | SELECT DISTINCT source_system_code FROM cmi_cross_references WHERE source_system_code LIKE '%en%' | Which distinct source system code includes the substring 'en'? | [Schema (values) (types)]: | local_govt_mdm | Customer_Master_Index : master_customer_id (text) , cmi_details (number) | CMI_Cross_References : cmi_cross_ref_id (text) , master_customer_id (number) , source_system_code (text) | Council_Tax : council_tax_id (text) , cmi_cross_ref_id (number) | Business_Rates : business_rates_id (text) , cmi_cross_ref_id (number) | Benefits_Overpayments : council_tax_id (text) , cmi_cross_ref_id (number) | Parking_Fines : council_tax_id (text) , cmi_cross_ref_id (number) | Rent_Arrears : council_tax_id (text) , cmi_cross_ref_id (number) | Electoral_Register : electoral_register_id (text) , cmi_cross_ref_id (number); | [Primary Keys]: customer_master_index : master_customer_id, cmi_cross_references : cmi_cross_ref_id, council_tax : council_tax_id, business_rates : business_rates_id, benefits_overpayments : council_tax_id, parking_fines : council_tax_id, rent_arrears : council_tax_id, electoral_register : electoral_register_id | [Foreign Keys]: cmi_cross_references : master_customer_id = customer_master_index : master_customer_id | council_tax : cmi_cross_ref_id = cmi_cross_references : cmi_cross_ref_id | business_rates : cmi_cross_ref_id = cmi_cross_references : cmi_cross_ref_id | benefits_overpayments : cmi_cross_ref_id = cmi_cross_references : cmi_cross_ref_id | parking_fines : cmi_cross_ref_id = cmi_cross_references : cmi_cross_ref_id | rent_arrears : cmi_cross_ref_id = cmi_cross_references : cmi_cross_ref_id | electoral_register : cmi_cross_ref_id = cmi_cross_references : cmi_cross_ref_id |
party_host | SELECT count(*) FROM party | How many parties are there? | [Schema (values) (types)]: | party_host | party : party_id (text) , party_theme (number) , location (text) , first_year (text) , last_year (text) , number_of_hosts (text) | host : host_id (text) , name (number) , nationality (text) , age (text) | party_host : party_id (text) , host_id (number) , is_main_in_charge (text); | [Primary Keys]: party : party_id, host : host_id, party_host : party_id | [Foreign Keys]: party_host : party_id = party : party_id | party_host : host_id = host : host_id |
party_host | SELECT count(*) FROM party | Count the number of parties. | [Schema (values) (types)]: | party_host | party : party_id (text) , party_theme (number) , location (text) , first_year (text) , last_year (text) , number_of_hosts (text) | host : host_id (text) , name (number) , nationality (text) , age (text) | party_host : party_id (text) , host_id (number) , is_main_in_charge (text); | [Primary Keys]: party : party_id, host : host_id, party_host : party_id | [Foreign Keys]: party_host : party_id = party : party_id | party_host : host_id = host : host_id |
party_host | SELECT Party_Theme FROM party ORDER BY Number_of_hosts ASC | List the themes of parties in ascending order of number of hosts. | [Schema (values) (types)]: | party_host | party : party_id (text) , party_theme (number) , location (text) , first_year (text) , last_year (text) , number_of_hosts (text) | host : host_id (text) , name (number) , nationality (text) , age (text) | party_host : party_id (text) , host_id (number) , is_main_in_charge (text); | [Primary Keys]: party : party_id, host : host_id, party_host : party_id | [Foreign Keys]: party_host : party_id = party : party_id | party_host : host_id = host : host_id |
party_host | SELECT Party_Theme FROM party ORDER BY Number_of_hosts ASC | What are the themes of parties ordered by the number of hosts in ascending manner? | [Schema (values) (types)]: | party_host | party : party_id (text) , party_theme (number) , location (text) , first_year (text) , last_year (text) , number_of_hosts (text) | host : host_id (text) , name (number) , nationality (text) , age (text) | party_host : party_id (text) , host_id (number) , is_main_in_charge (text); | [Primary Keys]: party : party_id, host : host_id, party_host : party_id | [Foreign Keys]: party_host : party_id = party : party_id | party_host : host_id = host : host_id |
party_host | SELECT Party_Theme , LOCATION FROM party | What are the themes and locations of parties? | [Schema (values) (types)]: | party_host | party : party_id (text) , party_theme (number) , location (text) , first_year (text) , last_year (text) , number_of_hosts (text) | host : host_id (text) , name (number) , nationality (text) , age (text) | party_host : party_id (text) , host_id (number) , is_main_in_charge (text); | [Primary Keys]: party : party_id, host : host_id, party_host : party_id | [Foreign Keys]: party_host : party_id = party : party_id | party_host : host_id = host : host_id |
party_host | SELECT Party_Theme , LOCATION FROM party | Give me the theme and location of each party. | [Schema (values) (types)]: | party_host | party : party_id (text) , party_theme (number) , location (text) , first_year (text) , last_year (text) , number_of_hosts (text) | host : host_id (text) , name (number) , nationality (text) , age (text) | party_host : party_id (text) , host_id (number) , is_main_in_charge (text); | [Primary Keys]: party : party_id, host : host_id, party_host : party_id | [Foreign Keys]: party_host : party_id = party : party_id | party_host : host_id = host : host_id |
party_host | SELECT First_year , Last_year FROM party WHERE Party_Theme = "Spring" OR Party_Theme = "Teqnology" | Show the first year and last year of parties with theme "Spring" or "Teqnology". | [Schema (values) (types)]: | party_host | party : party_id (text) , party_theme (number) , location (text) , first_year (text) , last_year (text) , number_of_hosts (text) | host : host_id (text) , name (number) , nationality (text) , age (text) | party_host : party_id (text) , host_id (number) , is_main_in_charge (text); | [Primary Keys]: party : party_id, host : host_id, party_host : party_id | [Foreign Keys]: party_host : party_id = party : party_id | party_host : host_id = host : host_id |
party_host | SELECT First_year , Last_year FROM party WHERE Party_Theme = "Spring" OR Party_Theme = "Teqnology" | What are the first year and last year of the parties whose theme is "Spring" or "Teqnology"? | [Schema (values) (types)]: | party_host | party : party_id (text) , party_theme (number) , location (text) , first_year (text) , last_year (text) , number_of_hosts (text) | host : host_id (text) , name (number) , nationality (text) , age (text) | party_host : party_id (text) , host_id (number) , is_main_in_charge (text); | [Primary Keys]: party : party_id, host : host_id, party_host : party_id | [Foreign Keys]: party_host : party_id = party : party_id | party_host : host_id = host : host_id |
party_host | SELECT avg(Number_of_hosts) FROM party | What is the average number of hosts for parties? | [Schema (values) (types)]: | party_host | party : party_id (text) , party_theme (number) , location (text) , first_year (text) , last_year (text) , number_of_hosts (text) | host : host_id (text) , name (number) , nationality (text) , age (text) | party_host : party_id (text) , host_id (number) , is_main_in_charge (text); | [Primary Keys]: party : party_id, host : host_id, party_host : party_id | [Foreign Keys]: party_host : party_id = party : party_id | party_host : host_id = host : host_id |
party_host | SELECT avg(Number_of_hosts) FROM party | Compute the average number of hosts for parties. | [Schema (values) (types)]: | party_host | party : party_id (text) , party_theme (number) , location (text) , first_year (text) , last_year (text) , number_of_hosts (text) | host : host_id (text) , name (number) , nationality (text) , age (text) | party_host : party_id (text) , host_id (number) , is_main_in_charge (text); | [Primary Keys]: party : party_id, host : host_id, party_host : party_id | [Foreign Keys]: party_host : party_id = party : party_id | party_host : host_id = host : host_id |
party_host | SELECT LOCATION FROM party ORDER BY Number_of_hosts DESC LIMIT 1 | What is the location of the party with the most hosts? | [Schema (values) (types)]: | party_host | party : party_id (text) , party_theme (number) , location (text) , first_year (text) , last_year (text) , number_of_hosts (text) | host : host_id (text) , name (number) , nationality (text) , age (text) | party_host : party_id (text) , host_id (number) , is_main_in_charge (text); | [Primary Keys]: party : party_id, host : host_id, party_host : party_id | [Foreign Keys]: party_host : party_id = party : party_id | party_host : host_id = host : host_id |
party_host | SELECT LOCATION FROM party ORDER BY Number_of_hosts DESC LIMIT 1 | Which party had the most hosts? Give me the party location. | [Schema (values) (types)]: | party_host | party : party_id (text) , party_theme (number) , location (text) , first_year (text) , last_year (text) , number_of_hosts (text) | host : host_id (text) , name (number) , nationality (text) , age (text) | party_host : party_id (text) , host_id (number) , is_main_in_charge (text); | [Primary Keys]: party : party_id, host : host_id, party_host : party_id | [Foreign Keys]: party_host : party_id = party : party_id | party_host : host_id = host : host_id |
party_host | SELECT Nationality , COUNT(*) FROM HOST GROUP BY Nationality | Show different nationalities along with the number of hosts of each nationality. | [Schema (values) (types)]: | party_host | party : party_id (text) , party_theme (number) , location (text) , first_year (text) , last_year (text) , number_of_hosts (text) | host : host_id (text) , name (number) , nationality (text) , age (text) | party_host : party_id (text) , host_id (number) , is_main_in_charge (text); | [Primary Keys]: party : party_id, host : host_id, party_host : party_id | [Foreign Keys]: party_host : party_id = party : party_id | party_host : host_id = host : host_id |
party_host | SELECT Nationality , COUNT(*) FROM HOST GROUP BY Nationality | How many hosts does each nationality have? List the nationality and the count. | [Schema (values) (types)]: | party_host | party : party_id (text) , party_theme (number) , location (text) , first_year (text) , last_year (text) , number_of_hosts (text) | host : host_id (text) , name (number) , nationality (text) , age (text) | party_host : party_id (text) , host_id (number) , is_main_in_charge (text); | [Primary Keys]: party : party_id, host : host_id, party_host : party_id | [Foreign Keys]: party_host : party_id = party : party_id | party_host : host_id = host : host_id |
party_host | SELECT Nationality FROM HOST GROUP BY Nationality ORDER BY COUNT(*) DESC LIMIT 1 | Show the most common nationality of hosts. | [Schema (values) (types)]: | party_host | party : party_id (text) , party_theme (number) , location (text) , first_year (text) , last_year (text) , number_of_hosts (text) | host : host_id (text) , name (number) , nationality (text) , age (text) | party_host : party_id (text) , host_id (number) , is_main_in_charge (text); | [Primary Keys]: party : party_id, host : host_id, party_host : party_id | [Foreign Keys]: party_host : party_id = party : party_id | party_host : host_id = host : host_id |
party_host | SELECT Nationality FROM HOST GROUP BY Nationality ORDER BY COUNT(*) DESC LIMIT 1 | Which nationality has the most hosts? | [Schema (values) (types)]: | party_host | party : party_id (text) , party_theme (number) , location (text) , first_year (text) , last_year (text) , number_of_hosts (text) | host : host_id (text) , name (number) , nationality (text) , age (text) | party_host : party_id (text) , host_id (number) , is_main_in_charge (text); | [Primary Keys]: party : party_id, host : host_id, party_host : party_id | [Foreign Keys]: party_host : party_id = party : party_id | party_host : host_id = host : host_id |
party_host | SELECT Nationality FROM HOST WHERE Age > 45 INTERSECT SELECT Nationality FROM HOST WHERE Age < 35 | Show the nations that have both hosts older than 45 and hosts younger than 35. | [Schema (values) (types)]: | party_host | party : party_id (text) , party_theme (number) , location (text) , first_year (text) , last_year (text) , number_of_hosts (text) | host : host_id (text) , name (number) , nationality (text) , age (text) | party_host : party_id (text) , host_id (number) , is_main_in_charge (text); | [Primary Keys]: party : party_id, host : host_id, party_host : party_id | [Foreign Keys]: party_host : party_id = party : party_id | party_host : host_id = host : host_id |
party_host | SELECT Nationality FROM HOST WHERE Age > 45 INTERSECT SELECT Nationality FROM HOST WHERE Age < 35 | Which nations have both hosts of age above 45 and hosts of age below 35? | [Schema (values) (types)]: | party_host | party : party_id (text) , party_theme (number) , location (text) , first_year (text) , last_year (text) , number_of_hosts (text) | host : host_id (text) , name (number) , nationality (text) , age (text) | party_host : party_id (text) , host_id (number) , is_main_in_charge (text); | [Primary Keys]: party : party_id, host : host_id, party_host : party_id | [Foreign Keys]: party_host : party_id = party : party_id | party_host : host_id = host : host_id |
party_host | SELECT T3.Party_Theme , T2.Name FROM party_host AS T1 JOIN HOST AS T2 ON T1.Host_ID = T2.Host_ID JOIN party AS T3 ON T1.Party_ID = T3.Party_ID | Show the themes of parties and the names of the party hosts. | [Schema (values) (types)]: | party_host | party : party_id (text) , party_theme (number) , location (text) , first_year (text) , last_year (text) , number_of_hosts (text) | host : host_id (text) , name (number) , nationality (text) , age (text) | party_host : party_id (text) , host_id (number) , is_main_in_charge (text); | [Primary Keys]: party : party_id, host : host_id, party_host : party_id | [Foreign Keys]: party_host : party_id = party : party_id | party_host : host_id = host : host_id |
party_host | SELECT T3.Party_Theme , T2.Name FROM party_host AS T1 JOIN HOST AS T2 ON T1.Host_ID = T2.Host_ID JOIN party AS T3 ON T1.Party_ID = T3.Party_ID | For each party, return its theme and the name of its host. | [Schema (values) (types)]: | party_host | party : party_id (text) , party_theme (number) , location (text) , first_year (text) , last_year (text) , number_of_hosts (text) | host : host_id (text) , name (number) , nationality (text) , age (text) | party_host : party_id (text) , host_id (number) , is_main_in_charge (text); | [Primary Keys]: party : party_id, host : host_id, party_host : party_id | [Foreign Keys]: party_host : party_id = party : party_id | party_host : host_id = host : host_id |
party_host | SELECT T3.Location , T2.Name FROM party_host AS T1 JOIN HOST AS T2 ON T1.Host_ID = T2.Host_ID JOIN party AS T3 ON T1.Party_ID = T3.Party_ID ORDER BY T2.Age | Show the locations of parties and the names of the party hosts in ascending order of the age of the host. | [Schema (values) (types)]: | party_host | party : party_id (text) , party_theme (number) , location (text) , first_year (text) , last_year (text) , number_of_hosts (text) | host : host_id (text) , name (number) , nationality (text) , age (text) | party_host : party_id (text) , host_id (number) , is_main_in_charge (text); | [Primary Keys]: party : party_id, host : host_id, party_host : party_id | [Foreign Keys]: party_host : party_id = party : party_id | party_host : host_id = host : host_id |
party_host | SELECT T3.Location , T2.Name FROM party_host AS T1 JOIN HOST AS T2 ON T1.Host_ID = T2.Host_ID JOIN party AS T3 ON T1.Party_ID = T3.Party_ID ORDER BY T2.Age | For each party, find its location and the name of its host. Sort the result in ascending order of the age of the host. | [Schema (values) (types)]: | party_host | party : party_id (text) , party_theme (number) , location (text) , first_year (text) , last_year (text) , number_of_hosts (text) | host : host_id (text) , name (number) , nationality (text) , age (text) | party_host : party_id (text) , host_id (number) , is_main_in_charge (text); | [Primary Keys]: party : party_id, host : host_id, party_host : party_id | [Foreign Keys]: party_host : party_id = party : party_id | party_host : host_id = host : host_id |
party_host | SELECT T3.Location FROM party_host AS T1 JOIN HOST AS T2 ON T1.Host_ID = T2.Host_ID JOIN party AS T3 ON T1.Party_ID = T3.Party_ID WHERE T2.Age > 50 | Show the locations of parties with hosts older than 50. | [Schema (values) (types)]: | party_host | party : party_id (text) , party_theme (number) , location (text) , first_year (text) , last_year (text) , number_of_hosts (text) | host : host_id (text) , name (number) , nationality (text) , age (text) | party_host : party_id (text) , host_id (number) , is_main_in_charge (text); | [Primary Keys]: party : party_id, host : host_id, party_host : party_id | [Foreign Keys]: party_host : party_id = party : party_id | party_host : host_id = host : host_id |
party_host | SELECT T3.Location FROM party_host AS T1 JOIN HOST AS T2 ON T1.Host_ID = T2.Host_ID JOIN party AS T3 ON T1.Party_ID = T3.Party_ID WHERE T2.Age > 50 | Which parties have hosts of age above 50? Give me the party locations. | [Schema (values) (types)]: | party_host | party : party_id (text) , party_theme (number) , location (text) , first_year (text) , last_year (text) , number_of_hosts (text) | host : host_id (text) , name (number) , nationality (text) , age (text) | party_host : party_id (text) , host_id (number) , is_main_in_charge (text); | [Primary Keys]: party : party_id, host : host_id, party_host : party_id | [Foreign Keys]: party_host : party_id = party : party_id | party_host : host_id = host : host_id |
party_host | SELECT T2.Name FROM party_host AS T1 JOIN HOST AS T2 ON T1.Host_ID = T2.Host_ID JOIN party AS T3 ON T1.Party_ID = T3.Party_ID WHERE T3.Number_of_hosts > 20 | Show the host names for parties with number of hosts greater than 20. | [Schema (values) (types)]: | party_host | party : party_id (text) , party_theme (number) , location (text) , first_year (text) , last_year (text) , number_of_hosts (text) | host : host_id (text) , name (number) , nationality (text) , age (text) | party_host : party_id (text) , host_id (number) , is_main_in_charge (text); | [Primary Keys]: party : party_id, host : host_id, party_host : party_id | [Foreign Keys]: party_host : party_id = party : party_id | party_host : host_id = host : host_id |
party_host | SELECT T2.Name FROM party_host AS T1 JOIN HOST AS T2 ON T1.Host_ID = T2.Host_ID JOIN party AS T3 ON T1.Party_ID = T3.Party_ID WHERE T3.Number_of_hosts > 20 | Which parties have more than 20 hosts? Give me the host names for these parties. | [Schema (values) (types)]: | party_host | party : party_id (text) , party_theme (number) , location (text) , first_year (text) , last_year (text) , number_of_hosts (text) | host : host_id (text) , name (number) , nationality (text) , age (text) | party_host : party_id (text) , host_id (number) , is_main_in_charge (text); | [Primary Keys]: party : party_id, host : host_id, party_host : party_id | [Foreign Keys]: party_host : party_id = party : party_id | party_host : host_id = host : host_id |
party_host | SELECT Name , Nationality FROM HOST ORDER BY Age DESC LIMIT 1 | Show the name and the nationality of the oldest host. | [Schema (values) (types)]: | party_host | party : party_id (text) , party_theme (number) , location (text) , first_year (text) , last_year (text) , number_of_hosts (text) | host : host_id (text) , name (number) , nationality (text) , age (text) | party_host : party_id (text) , host_id (number) , is_main_in_charge (text); | [Primary Keys]: party : party_id, host : host_id, party_host : party_id | [Foreign Keys]: party_host : party_id = party : party_id | party_host : host_id = host : host_id |
party_host | SELECT Name , Nationality FROM HOST ORDER BY Age DESC LIMIT 1 | What are the name and the nationality of the host of the highest age? | [Schema (values) (types)]: | party_host | party : party_id (text) , party_theme (number) , location (text) , first_year (text) , last_year (text) , number_of_hosts (text) | host : host_id (text) , name (number) , nationality (text) , age (text) | party_host : party_id (text) , host_id (number) , is_main_in_charge (text); | [Primary Keys]: party : party_id, host : host_id, party_host : party_id | [Foreign Keys]: party_host : party_id = party : party_id | party_host : host_id = host : host_id |
party_host | SELECT Name FROM HOST WHERE Host_ID NOT IN (SELECT Host_ID FROM party_host) | List the names of hosts who did not serve as a host of any party in our record. | [Schema (values) (types)]: | party_host | party : party_id (text) , party_theme (number) , location (text) , first_year (text) , last_year (text) , number_of_hosts (text) | host : host_id (text) , name (number) , nationality (text) , age (text) | party_host : party_id (text) , host_id (number) , is_main_in_charge (text); | [Primary Keys]: party : party_id, host : host_id, party_host : party_id | [Foreign Keys]: party_host : party_id = party : party_id | party_host : host_id = host : host_id |
party_host | SELECT Name FROM HOST WHERE Host_ID NOT IN (SELECT Host_ID FROM party_host) | What are the names of hosts who did not host any party in our record? | [Schema (values) (types)]: | party_host | party : party_id (text) , party_theme (number) , location (text) , first_year (text) , last_year (text) , number_of_hosts (text) | host : host_id (text) , name (number) , nationality (text) , age (text) | party_host : party_id (text) , host_id (number) , is_main_in_charge (text); | [Primary Keys]: party : party_id, host : host_id, party_host : party_id | [Foreign Keys]: party_host : party_id = party : party_id | party_host : host_id = host : host_id |
storm_record | SELECT count(*) FROM region | How many regions do we have? | [Schema (values) (types)]: | storm_record | storm : storm_id (text) , name (number) , dates_active (text) , max_speed (text) , damage_millions_usd (number) , number_deaths (number) | region : region_id (text) , region_code (number) , region_name (text) | affected_region : region_id (text) , storm_id (number) , number_city_affected (text); | [Primary Keys]: storm : storm_id, region : region_id, affected_region : region_id | [Foreign Keys]: affected_region : storm_id = storm : storm_id | affected_region : region_id = region : region_id |
storm_record | SELECT count(*) FROM region | Count the number of regions. | [Schema (values) (types)]: | storm_record | storm : storm_id (text) , name (number) , dates_active (text) , max_speed (text) , damage_millions_usd (number) , number_deaths (number) | region : region_id (text) , region_code (number) , region_name (text) | affected_region : region_id (text) , storm_id (number) , number_city_affected (text); | [Primary Keys]: storm : storm_id, region : region_id, affected_region : region_id | [Foreign Keys]: affected_region : storm_id = storm : storm_id | affected_region : region_id = region : region_id |
storm_record | SELECT region_code , region_name FROM region ORDER BY region_code | Show all region code and region name sorted by the codes. | [Schema (values) (types)]: | storm_record | storm : storm_id (text) , name (number) , dates_active (text) , max_speed (text) , damage_millions_usd (number) , number_deaths (number) | region : region_id (text) , region_code (number) , region_name (text) | affected_region : region_id (text) , storm_id (number) , number_city_affected (text); | [Primary Keys]: storm : storm_id, region : region_id, affected_region : region_id | [Foreign Keys]: affected_region : storm_id = storm : storm_id | affected_region : region_id = region : region_id |
storm_record | SELECT region_code , region_name FROM region ORDER BY region_code | What are the codes and names for all regions, sorted by codes? | [Schema (values) (types)]: | storm_record | storm : storm_id (text) , name (number) , dates_active (text) , max_speed (text) , damage_millions_usd (number) , number_deaths (number) | region : region_id (text) , region_code (number) , region_name (text) | affected_region : region_id (text) , storm_id (number) , number_city_affected (text); | [Primary Keys]: storm : storm_id, region : region_id, affected_region : region_id | [Foreign Keys]: affected_region : storm_id = storm : storm_id | affected_region : region_id = region : region_id |
storm_record | SELECT region_name FROM region ORDER BY region_name | List all region names in alphabetical order. | [Schema (values) (types)]: | storm_record | storm : storm_id (text) , name (number) , dates_active (text) , max_speed (text) , damage_millions_usd (number) , number_deaths (number) | region : region_id (text) , region_code (number) , region_name (text) | affected_region : region_id (text) , storm_id (number) , number_city_affected (text); | [Primary Keys]: storm : storm_id, region : region_id, affected_region : region_id | [Foreign Keys]: affected_region : storm_id = storm : storm_id | affected_region : region_id = region : region_id |
storm_record | SELECT region_name FROM region ORDER BY region_name | What are the names of the regions in alphabetical order? | [Schema (values) (types)]: | storm_record | storm : storm_id (text) , name (number) , dates_active (text) , max_speed (text) , damage_millions_usd (number) , number_deaths (number) | region : region_id (text) , region_code (number) , region_name (text) | affected_region : region_id (text) , storm_id (number) , number_city_affected (text); | [Primary Keys]: storm : storm_id, region : region_id, affected_region : region_id | [Foreign Keys]: affected_region : storm_id = storm : storm_id | affected_region : region_id = region : region_id |
storm_record | SELECT region_name FROM region WHERE region_name != 'Denmark' | Show names for all regions except for Denmark. | [Schema (values) (types)]: | storm_record | storm : storm_id (text) , name (number) , dates_active (text) , max_speed (text) , damage_millions_usd (number) , number_deaths (number) | region : region_id (text) , region_code (number) , region_name (text) | affected_region : region_id (text) , storm_id (number) , number_city_affected (text); | [Primary Keys]: storm : storm_id, region : region_id, affected_region : region_id | [Foreign Keys]: affected_region : storm_id = storm : storm_id | affected_region : region_id = region : region_id |
storm_record | SELECT region_name FROM region WHERE region_name != 'Denmark' | Return the names of all regions other than Denmark. | [Schema (values) (types)]: | storm_record | storm : storm_id (text) , name (number) , dates_active (text) , max_speed (text) , damage_millions_usd (number) , number_deaths (number) | region : region_id (text) , region_code (number) , region_name (text) | affected_region : region_id (text) , storm_id (number) , number_city_affected (text); | [Primary Keys]: storm : storm_id, region : region_id, affected_region : region_id | [Foreign Keys]: affected_region : storm_id = storm : storm_id | affected_region : region_id = region : region_id |
storm_record | SELECT count(*) FROM storm WHERE Number_Deaths > 0 | How many storms had death records? | [Schema (values) (types)]: | storm_record | storm : storm_id (text) , name (number) , dates_active (text) , max_speed (text) , damage_millions_usd (number) , number_deaths (number) | region : region_id (text) , region_code (number) , region_name (text) | affected_region : region_id (text) , storm_id (number) , number_city_affected (text); | [Primary Keys]: storm : storm_id, region : region_id, affected_region : region_id | [Foreign Keys]: affected_region : storm_id = storm : storm_id | affected_region : region_id = region : region_id |
storm_record | SELECT count(*) FROM storm WHERE Number_Deaths > 0 | Count the number of storms in which at least 1 person died. | [Schema (values) (types)]: | storm_record | storm : storm_id (text) , name (number) , dates_active (text) , max_speed (text) , damage_millions_usd (number) , number_deaths (number) | region : region_id (text) , region_code (number) , region_name (text) | affected_region : region_id (text) , storm_id (number) , number_city_affected (text); | [Primary Keys]: storm : storm_id, region : region_id, affected_region : region_id | [Foreign Keys]: affected_region : storm_id = storm : storm_id | affected_region : region_id = region : region_id |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.