code: def querySQL(self, domain, constraints):
      if not self.sql_dbs:
          for dom in db_domains:
              db = "db/{}-dbase.db".format(dom)
              conn = sqlite3.connect(db)
              c = conn.cursor()
              self.sql_dbs[dom] = c
  
      sql_query = "select * from {}".format(domain)
  
      flag = True
      for key, val in constraints.items():
          if (
              val == ""
              or val == "dontcare"
              or val == "not mentioned"
              or val == "don't care"
              or val == "dont care"
              or val == "do n't care"
          ):
              pass
          else:
              if flag:
                  sql_query += " where "
                  val2 = val.replace("'", "''")
                  # val2 = normalize(val2)
                  if key == "leaveAt":
                      sql_query += (
                          r" " + key + " > " + r"'" + val2 + r"'"
                      )
                  elif key == "arriveBy":
                      sql_query += (
                          r" " + key + " < " + r"'" + val2 + r"'"
                      )
                  else:
                      sql_query += r" " + key + "=" + r"'" + val2 + r"'"
                  flag = False
              else:
                  val2 = val.replace("'", "''")
                  # val2 = normalize(val2)
                  if key == "leaveAt":
                      sql_query += (
                          r" and " + key + " > " + r"'" + val2 + r"'"
                      )
                  elif key == "arriveBy":
                      sql_query += (
                          r" and " + key + " < " + r"'" + val2 + r"'"
                      )
                  else:
                      sql_query += (
                          r" and " + key + "=" + r"'" + val2 + r"'"
                      )
  
      try:  # "select * from attraction  where name = 'queens college'"
          print(sql_query)
          return self.sql_dbs[domain].execute(sql_query).fetchall()
      except:
          return []
  
file_path: TextBox/textbox/evaluator/utils/multiwoz/db_ops.py
imports: import json, random, sqlite3
  from .ontology import all_domains, db_domains
label_desc: Use image node_id 9 for calling the MultiWozDB obj's underlying member method code with example usage: obj.querySQL(domain, constraints) and returns: self, list