title: PyQt - Use SQL directly with QSqlTableModel
body: <p>I'm writing a simple student scores manager for practicing programming on PyQt (I don't want to use terrible <em>Visual Basic</em> anymore). But I had a big problem on choose data models. </p>
  
  <p>I found <code>QSqlTableModel</code> first, it is a great model with auto-updating. The trouble is, I need to use a lot of SQL (<code>JOIN</code>, <code>WHERE</code>) to select data from database. <code>QSqlTableModel</code> has <code>select()</code> and <code>filter()</code> only.</p>
  
  <p>Then I found <code>QSqlQueryModel</code>, but it is read only. So I rewrite its  <code>setData()</code> method. So it is read-write now. Unfortunately, <code>QSqlQueryModel</code> less usable features than <code>QSqlTableModel</code>.</p>
  
  <p>As you see, if I can using SQL with <code>QSqlTableModel</code>, I can resolve all my problems.</p>
  
  <p>So...?</p>