0

I have a database called movie.db. I would like to know the schema of the database in a single SQL query. If possible I would also like to know the number of tables in the database. Could some one tell me how to do that ?

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459

1 Answers1

0

To get the table count from db use following query

SELECT count(*) FROM sqlite_master WHERE type = 'table' AND name != 'android_metadata' AND name != 'sqlite_sequence';

and to access schema

SELECT name FROM sqlite_master WHERE type='table';
Chintan Desai
  • 2,607
  • 2
  • 22
  • 25