---
title: "android sqlite3 show all tables"
author: "yinter"
date: "2009-11-06T17:31:44Z"
tags: []
categories: ["移动开发"]
slug: "android-sqlite3-show-all-tables"
draft: false
lastmod: "2010-01-26T16:43:29Z"
id: 511575
url: "https://yinter.iteye.com/blog/511575"
---

sqlite3 中每个 SQLite 数据库有一个 SQLITE_MASTER 表，用来存储所有表信息；

SQLITE_MASTER 表结构如下：

CREATE TABLE sqlite_master (
type TEXT,
name TEXT,
tbl_name TEXT,
rootpage INTEGER,
sql TEXT
);

查询命令：
SELECT name FROM sqlite_master WHERE type='table' ORDER BY name;


另：Ctrl+D可退出当前sqlite3环境，到达adb shell状态；