
CREATE TABLE "Companies" (
	id INTEGER, 
	name TEXT, 
	"Headquarters" TEXT, 
	"Industry" TEXT, 
	"Sales_billion" REAL, 
	"Profits_billion" REAL, 
	"Assets_billion" REAL, 
	"Market_Value_billion" TEXT, 
	PRIMARY KEY (id)
)


CREATE TABLE "Office_locations" (
	building_id INTEGER, 
	company_id INTEGER, 
	move_in_year INTEGER, 
	PRIMARY KEY (building_id, company_id), 
	FOREIGN KEY(building_id) REFERENCES buildings (id), 
	FOREIGN KEY(company_id) REFERENCES "Companies" (id)
)


CREATE TABLE buildings (
	id INTEGER, 
	name TEXT, 
	"City" TEXT, 
	"Height" INTEGER, 
	"Stories" INTEGER, 
	"Status" TEXT, 
	PRIMARY KEY (id)
)

CREATE TABLE "Companies" (
	id INTEGER, 
	name TEXT, 
	"Headquarters" TEXT, 
	"Industry" TEXT, 
	"Sales_billion" REAL, 
	"Profits_billion" REAL, 
	"Assets_billion" REAL, 
	"Market_Value_billion" TEXT, 
	PRIMARY KEY (id)
)

/*
2 rows from Companies table:
id	name	Headquarters	Industry	Sales_billion	Profits_billion	Assets_billion	Market_Value_billion
1	JPMorgan Chase	USA	Banking	115.5	17.4	2117.6	182.2
2	HSBC	UK	Banking	103.3	13.3	2467.9	186.5
*/


CREATE TABLE "Office_locations" (
	building_id INTEGER, 
	company_id INTEGER, 
	move_in_year INTEGER, 
	PRIMARY KEY (building_id, company_id), 
	FOREIGN KEY(building_id) REFERENCES buildings (id), 
	FOREIGN KEY(company_id) REFERENCES "Companies" (id)
)

/*
2 rows from Office_locations table:
building_id	company_id	move_in_year
1	1	2021
2	2	2022
*/


CREATE TABLE buildings (
	id INTEGER, 
	name TEXT, 
	"City" TEXT, 
	"Height" INTEGER, 
	"Stories" INTEGER, 
	"Status" TEXT, 
	PRIMARY KEY (id)
)

/*
2 rows from buildings table:
id	name	City	Height	Stories	Status
1	Torre KOI	Monterrey	220	67	under construction
2	Torre Mitikah	Mexico City	210	60	under construction
*/
Please show the names of the buildings whose status is "on-hold", in ascending order of stories.
SELECT name FROM buildings WHERE Status  =  "on-hold" ORDER BY Stories ASC
[{'name': 'Ritz-Carlton Mexico City'}, {'name': 'Reforma 90'}, {'name': 'Residencial Vidalta Torre Altaire 2'}, {'name': 'Residencial Vidalta Torre Altaire 3'}]