public String divQuery(List<String> locs) {
		if (locs.isEmpty()) {
			return error;
		}

		String query = "";
		String firstBlock = locs.get(0);
		int num = locs.size();
		//
		// if(locs.size() == 1) {
		// query +=
		// "SELECT s.sname, s.sid, g.day FROM Security s, Guards g WHERE s.sid = g.sid AND g.cellBlock ='"
		// + locs.get(0) + "'";
		// } else if (locs.size() == 2) {
		// query +=
		// "SELECT s.sname, s.sid, g.day FROM Security s, Guards g1, Guards g2 WHERE s.sid = g1.sid AND s.sid = g2.sid AND g1.cellBlock ='"
		// + locs.get(0) + "'";
		// }

		query += "SELECT " + firstBlock.toLowerCase() + ".sid, "
				+ firstBlock.toLowerCase() + ".sname FROM " + firstBlock
				+ "Block " + firstBlock.toLowerCase();
		
		for (int i = 1; i < num; i++) {
			query += ", " + locs.get(i) + "Block " + locs.get(i).toLowerCase();
		}
		
		for (int i = 0; i < num - 1; i++) {
			if (!(i == num - 1) && i == 0) {
				query += " WHERE ";
			} 
			if (i == num -2) {
				query += locs.get(i).toLowerCase() + ".sid = " + locs.get(i+1).toLowerCase() + ".sid";
			} else {
				query += locs.get(i).toLowerCase() + ".sid = " + locs.get(i+1).toLowerCase() + ".sid AND ";
			}
		}

		System.out.println(query);
		return sendQuery(query);
	}