---
title: "💭 sql - How can I list the tables in a SQLite database file that..."
description: "!https://stackoverflow.com/questions/82875/how-can-i-list-the-tables-in-a-sqlite-database-file-that-was-opened-with-attach#answer-83195"
date: 2024-04-18
published: true
tags:
  - sqlite
  - thought
template: link
---


<div class="embed-card embed-card-external">
  <a href="https://stackoverflow.com/questions/82875/how-can-i-list-the-tables-in-a-sqlite-database-file-that-was-opened-with-attach#answer-83195" class="embed-card-link" target="_blank" rel="noopener noreferrer">
    <div class="embed-card-content">
      <div class="embed-card-title">External Link</div>
      <div class="embed-card-meta">stackoverflow.com</div>
    </div>
  </a>
</div>


I learned about the sqlite_master table from this stack overflow answer.  This helps make a lot of sense to how sqlite works.  The master table contains all the sqlite objects and the sql to create them.

> The .tables, and .schema "helper" functions don't look into ATTACHed databases: they just query the SQLITE_MASTER table for the "main" database. Consequently, if you used

``` bash
sqlite3 database.db "SELECT * from sqlite_master;"
```

!!! note

    This post is a <a href="/thoughts/" class="wikilink" data-title="Thoughts" data-description="These are generally my thoughts on a web page or some sort of url, except a rare few don&#39;t have a link. These are dual published off of my..." data-date="2024-04-01">thought</a>. It's a short note that I make
    about someone else's content online <a href="/tags/thoughts/" class="hashtag-tag" data-tag="thoughts" data-count=2 data-reading-time=3 data-reading-time-text="3 minutes">#thoughts</a>
