Can we see a database's schema without being given a diagram?


#1

Question

In the context of this lesson, can we see a database’s schema without being given a diagram?

Answer

Yes, you can!

In SQLite specifically, there is a special table named SQLITE_MASTER, which defines the schema for databases. This special table contains information about certain qualities like the table name and the schema, which provides details about all the column names and their data types.

To view this table, you can run the following statement,

SELECT *
FROM sqlite_master;

Feel free to try this out in some of the exercises to view the table information!