title: SQL command to extract schema of a SQLite table?
body: <p>I can't decide if this is a dumb question or not but I'll take the risk. :)</p>
  
  <p>I'm a fairly simple SQL user  - I understand CREATE/DROP tables and SELECT, INSERT, DELETE in their basic forms but not much more. What I'd like to know is if there's a way with SQL to request the schema of a table?</p>
  
  <p>I have a PC app which uses SQLite and I'm writing a mobile client for it. I don't need all of the tables from the PC DB and not all columns from the tables. In SQLite Spy, I can right-click a table and select 'Show CREATE statement' which generates the SQL needed to recreate the table.</p>
  
  <p>What I'd like to do (using code on the PC) to get the CREATE statement (or at least the schema) of the SQLite tables I need and then edit the strings to include only the columns I need. These could then be passed to my mobile app so it could create the 'subset' DB on the device. Is it possible?</p>
  
  <p><strong>EDIT:</strong> For anyone who comes after me looking for a similar answer. Thanks to dan04 pointing me in the right direction. The results of using...</p>
  
  <pre><code>SELECT * FROM sqlite_master
  </code></pre>
  
  <p>... include a column called 'sql' which includes the CREATE statement. Just what I'm looking for. :)</p>