Skip to Content
Learning SQL, 3rd Edition
book

Learning SQL, 3rd Edition

by Alan Beaulieu
March 2020
Beginner
380 pages
9h 44m
English
O'Reilly Media, Inc.
Book available
Content preview from Learning SQL, 3rd Edition

Chapter 15. Metadata

Along with storing all of the data that various users insert into a database, a database server also needs to store information about all of the database objects (tables, views, indexes, etc.) that were created to store this data. The database server stores this information, not surprisingly, in a database. This chapter discusses how and where this information, known as metadata, is stored, how you can access it, and how you can use it to build flexible systems.

Data About Data

Metadata is essentially data about data. Every time you create a database object, the database server needs to record various pieces of information. For example, if you were to create a table with multiple columns, a primary key constraint, three indexes, and a foreign key constraint, the database server would need to store all the following information:

  • Table name

  • Table storage information (tablespace, initial size, etc.)

  • Storage engine

  • Column names

  • Column data types

  • Default column values

  • not null column constraints

  • Primary key columns

  • Primary key name

  • Name of primary key index

  • Index names

  • Index types (B-tree, bitmap)

  • Indexed columns

  • Index column sort order (ascending or descending)

  • Index storage information

  • Foreign key name

  • Foreign key columns

  • Associated table/columns for foreign keys

This data is collectively known as the data dictionary or system catalog. The database server needs to store this data persistently, and it needs to be able ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Learning SQL

Learning SQL

Ben Forta
Practical SQL

Practical SQL

Anthony DeBarros
Head First SQL

Head First SQL

Lynn Beighley

Publisher Resources

ISBN: 9781492057604Errata Page