def salestatus(conn, home_id, status): return execute(conn, f"UPDATE Sale SET status='{status}' WHERE home_id='{home_id}'")
def lowtohigh(conn): return execute(conn, "SELECT * FROM Sale ORDER BY mortgage" )
def hightolow(conn): return execute(conn, "SELECT * FROM Sale ORDER BY mortgage DESC" )
def removerent(conn, home_id): return execute(conn, f"DELETE FROM Rent WHERE home_id = '{home_id}'")
def forsale(conn): return execute(conn, "SELECT * FROM Sale")
def removesale(conn, home_id): return execute(conn, f"DELETE FROM Sale WHERE home_id = '{home_id}'")
def forrent(conn): return execute(conn, "SELECT * FROM Rent")
def add_homerent(conn, status, rentprice, address, beds, baths, size, agent_id): return execute( conn, f"INSERT INTO Rent(status, rentprice, address, beds, baths, size, agent_id) VALUES ('{status}', '{rentprice}', '{address}', '{beds}', '{baths}', '{size}', '{agent_id}')" )
def add_homesale(conn, status, price, address, beds, baths, size, mortgage, agent_id): return execute( conn, f"INSERT INTO Sale(status, price, address, beds, baths, size, mortgage, agent_id) VALUES ('{status}', '{price}', '{address}', '{beds}', '{baths}', '{size}', '{mortgage}', '{agent_id}')" )
def rentstatus(conn, home_id, status): return execute(conn, f"UPDATE Rent SET status='{status}' WHERE home_id='{home_id}'")