Database schema:
CREATE TABLE Ref_Age_Categories (
  age_category_code TEXT PRIMARY KEY,
  age_category_description TEXT
);
CREATE TABLE Ref_Property_Types (
  property_type_code TEXT PRIMARY KEY,
  property_type_description TEXT
);
CREATE TABLE Ref_Room_Types (
  room_type_code TEXT PRIMARY KEY,
  room_type_description TEXT
);
CREATE TABLE Ref_User_Categories (
  user_category_code TEXT PRIMARY KEY,
  user_category_description TEXT
);
CREATE TABLE Addresses (
  address_id NUMBER PRIMARY KEY,
  line_1_number_building TEXT,
  line_2_number_street TEXT,
  line_3_area_locality TEXT,
  town_city TEXT,
  zip_postcode TEXT,
  county_state_province TEXT,
  country TEXT,
  other_address_details TEXT
);
CREATE TABLE Features (
  feature_id NUMBER PRIMARY KEY,
  feature_name TEXT,
  feature_description TEXT
);
CREATE TABLE Users (
  user_id NUMBER PRIMARY KEY,
  age_category_code TEXT,
  user_category_code TEXT,
  user_address_id NUMBER,
  is_buyer TEXT,
  is_seller TEXT,
  login_name TEXT,
  password TEXT,
  date_registered TIME,
  first_name TEXT,
  middle_name TEXT,
  last_name TEXT,
  other_user_details TEXT
);
CREATE TABLE Properties (
  property_id NUMBER PRIMARY KEY,
  property_address_id NUMBER,
  owner_user_id NUMBER,
  property_type_code TEXT,
  date_on_market TIME,
  date_off_market TIME,
  property_name TEXT,
  property_description TEXT,
  garage_yn TEXT,
  parking_lots TEXT,
  room_count TEXT,
  vendor_requested_price NUMBER,
  price_min NUMBER,
  price_max NUMBER,
  other_property_details TEXT,
  FOREIGN KEY (property_type_code) REFERENCES Ref_Property_Types(property_type_code),
  FOREIGN KEY (property_address_id) REFERENCES Addresses(address_id),
  FOREIGN KEY (owner_user_id) REFERENCES Users(user_id)
);
CREATE TABLE Property_Features (
  property_id NUMBER,
  feature_id NUMBER,
  feature_value TEXT,
  property_feature_description TEXT,
  FOREIGN KEY (property_id) REFERENCES Properties(property_id),
  FOREIGN KEY (feature_id) REFERENCES Features(feature_id)
);
CREATE TABLE Property_Photos (
  property_id NUMBER,
  photo_seq NUMBER,
  photo_title TEXT,
  photo_description TEXT,
  photo_filename TEXT,
  FOREIGN KEY (property_id) REFERENCES Properties(property_id)
);
CREATE TABLE Rooms (
  property_id NUMBER,
  room_number TEXT,
  room_type_code TEXT,
  room_size TEXT,
  other_room_details TEXT,
  FOREIGN KEY (room_type_code) REFERENCES Ref_Room_Types(room_type_code),
  FOREIGN KEY (property_id) REFERENCES Properties(property_id)
);
CREATE TABLE User_Property_History (
  user_id NUMBER,
  property_id NUMBER,
  datestamp TIME,
  FOREIGN KEY (property_id) REFERENCES Properties(property_id),
  FOREIGN KEY (user_id) REFERENCES Users(user_id)
);
CREATE TABLE User_Searches (
  user_id NUMBER,
  search_seq NUMBER,
  search_datetime TIME,
  search_string TEXT,
  FOREIGN KEY (user_id) REFERENCES Users(user_id)
);

Question: What are the first, middle and last names of users who own the property they live in?
SQL: SELECT first_name ,  middle_name ,  last_name FROM Properties AS T1 JOIN Users AS T2 ON T1.owner_user_id  =  T2.user_id WHERE T1.property_address_id  =  T2.user_address_id;

Question: What are the buildings, streets, and cities corresponding to the addresses of senior citizens?
SQL: SELECT T1.line_1_number_building ,  T1.line_2_number_street ,  T1.town_city FROM Addresses AS T1 JOIN Users AS T2 ON T1.address_id  =  T2.user_address_id WHERE T2.user_category_code  =  'Senior Citizen';

Question: In which cities are there any properties equipped with a swimming pool?
SQL: SELECT T2.town_city FROM Properties AS T1 JOIN Addresses AS T2 ON T1.property_address_id  =  T2.address_id JOIN Property_Features AS T3 ON T1.property_id  =  T3.property_id JOIN Features AS T4 ON T4.feature_id  =  T3.feature_id WHERE T4.feature_name  =  'swimming pool';

Question: How many properties are there with at least 2 features?
SQL: SELECT count(*) FROM Properties GROUP BY property_id HAVING count(*)  >= 2;

Question: What are the age categories for users whose description contains the string Mother?
SQL: SELECT T2.age_category_code FROM Ref_User_Categories AS T1 JOIN Users AS T2 ON T1.user_category_code  =  T2.user_category_code WHERE T1.User_category_description LIKE "%Mother";

Question: Return the first name of the user who owns the most properties.
SQL: SELECT T1.first_name FROM Users AS T1 JOIN Properties AS T2 ON T2.owner_user_id  =  T1.User_id GROUP BY T1.User_id ORDER BY count(*) DESC LIMIT 1;

Question: Return the search strings and corresonding time stamps for all user searches, sorted by search string descending.
SQL: SELECT search_datetime ,  search_string FROM User_Searches ORDER BY search_string DESC;

Question: Return the cities in which there exist properties that have swimming pools.
SQL: SELECT T2.town_city FROM Properties AS T1 JOIN Addresses AS T2 ON T1.property_address_id  =  T2.address_id JOIN Property_Features AS T3 ON T1.property_id  =  T3.property_id JOIN Features AS T4 ON T4.feature_id  =  T3.feature_id WHERE T4.feature_name  =  'swimming pool';

Question: In which states are each of the the properties located?
SQL: SELECT DISTINCT T1.county_state_province FROM Addresses AS T1 JOIN Properties AS T2 ON T1.address_id  =  T2.property_address_id;

Question: Count the number of properties with at least two features.
SQL: SELECT count(*) FROM Properties GROUP BY property_id HAVING count(*)  >= 2;

Question: What are the ids of users who have only made one search, and what are their category codes?
SQL: SELECT T1.user_category_code ,  T1.user_id FROM Users AS T1 JOIN User_Searches AS T2 ON T1.user_id  =  T2.user_id GROUP BY T1.user_id HAVING count(*)  =  1;

Question: When did the user with login name ratione register?
SQL: SELECT date_registered FROM Users WHERE login_name  =  'ratione';

Question: What is the lowest room count across all the properties?
SQL: SELECT min(room_count) FROM Properties;

Question: What are the user ids of property owners who have property photos, and how many do each of them have?
SQL: SELECT T1.owner_user_id ,  count(*) FROM Properties AS T1 JOIN Property_Photos AS T2 ON T1.property_id  =  T2.property_id GROUP BY T1.owner_user_id;

Question: What are the zip codes of properties which do not belong to users who own at most 2 properties?
SQL: SELECT T1.zip_postcode FROM Addresses AS T1 JOIN Properties AS T2 ON T1.address_id  =  T2.property_address_id WHERE T2.owner_user_id NOT IN ( SELECT owner_user_id FROM Properties GROUP BY owner_user_id HAVING count(*)  <=  2 );

Question: List the search content of the users who do not own a single property.
SQL: SELECT search_string FROM User_Searches EXCEPT SELECT T1.search_string FROM User_Searches AS T1 JOIN Properties AS T2 ON T1.user_id  =  T2.owner_user_id;

Question: Return the number of rooms with each different room size.
SQL: SELECT room_size ,  count(*) FROM Rooms GROUP BY room_size

Question: On average, how many rooms do properties with garden features have?
SQL: SELECT avg(T3.room_count) FROM Property_Features AS T1 JOIN Features AS T2 ON T1.feature_id  =  T2.feature_id JOIN Properties AS T3 ON T1.property_id  =  T3.property_id WHERE T2.feature_name  =  'garden';

Question: What are the login names of all senior citizens, sorted by first name?
SQL: SELECT login_name FROM Users WHERE user_category_code  =  'Senior Citizen' ORDER BY first_name

Question: What are the ids of users who have searched at least twice, and what did they search?
SQL: SELECT search_seq ,  user_id FROM User_Searches GROUP BY user_id HAVING count(*) >= 2;

Question: When was the time of the latest search by a user?
SQL: SELECT max(search_datetime) FROM User_Searches;

Question: What are the different room sizes, and how many of each are there?
SQL: SELECT room_size ,  count(*) FROM Rooms GROUP BY room_size