Questions tagged [database-metadata]

Metadata is "data about data". In database terminology, this set of metadata is referred to as the catalog. The SQL standard specifies a uniform means to access the catalog, called the information schema, but not all databases implement it, even if they implement other aspects of the SQL standard. For an example of database-specific metadata access methods, see Oracle metadata.

Meta Data:

Metadata is “data about data”. An item of metadata describes the specific characteristics about an individual data item. In databases, metadata describes the structural components of tables and their elements. For example, metadata about an element could include data types, name of data, size and many more characteristics about that element. It would also give information about the tables the database is storing, information, such as length of fields, number of columns, where the tables are located and other pertinent information. One of the main uses for met data is to provide a link between the information creator and the information users. Metadata allows the users to speed up the search for individual data. This is done by being able to set parameter for searches, allowing the filtering of unwanted information. Metadata can be stored either internally, in the same file as the data or externally, in a separate area. Both have advantages and disadvantages. If the data is stored internally, the metadata is together with the data making more easily accessible to view or change. However, this method creates high redundancy. If metadata is stored externally, the searches can become more efficient. There is no redundancy but getting to this metadata may be a little more technical. There are certain formats that must be used, such as Uniform Resource Identifier(URI) to get to the metadata if this format is not used the metadata becomes inaccessible. All the metadata is stored in a data dictionary or a system catalog. All programs that access data in the database work through a DBMS. The DBMS uses the data dictionary to look up the required components and relationships. Any changes made to the database structure are automatically recorded in the data dictionary. This makes the data dictionary manager’s job a lot easier because any modification of programs that are affected by the changed structure is not necessary.

Metadata at the most basic level is simply defined as “data about data”. An item of metadata describes the specific characteristics about an individual data item. In the database realm, metadata is defined as, “data about data, through which the end-user data are integrated and managed.” (Rob & Coronel, 2009) Metadata in a database typically store the relationships that link up numerous pieces of data. “Metadata names these fields describes the size of the fields, and may put restrictions on what can go in the field (for example, numbers only).” (Sheldon, 2001).

“Therefore, metadata is information about how data is extracted, and how it may be transformed. It is also about indexing and creating pointers into data. Database design is all about defining metadata schemas.” (Sheldon, 2001) Metadata can be stored either internally, in the same file as the data, or externally, in a separate area. If the data is stored internally, the metadata is together with the data, making it more easily accessible to view or change. However, this method creates high redundancy. If metadata is stored externally, the searches can become more efficient. There is no redundancy but getting to this metadata may be a little more technical.

All the metadata is stored in a data dictionary or a system catalog. The data dictionary is most typically an external document that is created in a spreadsheet type of document that stores the conceptual design ideas for the database schema. The data dictionary also contains the general format that the data, and in effect the metadata, should be. Metadata is an essential aspect of database design, it allows for increased processing power, due to the fact that it can help create pointers and indexes.

Useful Resources:

217 questions
248
votes
12 answers

How to get all columns' names for all the tables in MySQL?

Is there a fast way of getting all column names from all tables in MySQL, without having to list all the tables?
dieter
  • 2,551
  • 3
  • 17
  • 6
168
votes
17 answers

List of foreign keys and the tables they reference in Oracle DB

I'm trying to find a query which will return me a list of the foreign keys for a table and the tables and columns they reference. I am half way there with SELECT a.table_name, a.column_name, a.constraint_name, c.owner FROM…
stimms
  • 42,945
  • 30
  • 96
  • 149
70
votes
8 answers

How to get all table names from a database?

I'd like to retrieve all table names from a database schema, and, if possible, get all table starting with a specified prefix. I tried using JDBC's connection.getMetaData().getTables() but it didn't work at all. Connection jdbcConnection =…
Maxime ARNSTAMM
  • 5,274
  • 10
  • 53
  • 76
59
votes
26 answers

Get Database Table Name from Entity Framework MetaData

I'm trying to figure out a way to get the underlying SQL table name for a given entity type. I've experimented around with the MetadataWorkspace queries and while I can get lots of information from the object or the storage space, I can't seem to…
Rick Strahl
  • 17,302
  • 14
  • 89
  • 134
51
votes
5 answers

How to find out when a particular table was created in Oracle?

In Oracle, is there a way to find out when a particular table was created? Similarly, is there a way to find out when a particular row was inserted/last updated?
Moeb
  • 10,527
  • 31
  • 84
  • 110
26
votes
4 answers

How can I get different datatypes from ResultSetMetaData in Java?

I have a ResultSet that returns data of different types. The query is constructed dynamically so, at compile time, I don't know what type of value the query will return. I have written the following code assuming that all results are Strings. But I…
Java Questions
  • 7,813
  • 41
  • 118
  • 176
21
votes
4 answers

How to find out when data was inserted to Postgres?

I have inherited an existing Postgres database full of data. Most of the data has a 'created_date' column value. Some of the earlier data was inserted before this was being tracked. Is there a Postgres metadata table hidden away somewhere that…
Ondrae
  • 354
  • 1
  • 2
  • 8
18
votes
5 answers

JDBC DatabaseMetaData.getColumns() returns duplicate columns

I'm busy on a piece of code to get alle the column names of a table from an Oracle database. The code I came up with looks like this: DriverManager.registerDriver (new oracle.jdbc.driver.OracleDriver()); Connection conn =…
LeonZandman
  • 3,054
  • 6
  • 29
  • 26
17
votes
5 answers

How to list tables in their dependency order (based on foreign keys)?

This question was originally asked by @PrateekGupta Background @PrateekGupta wanted to perform bulk insert operation on multiple tables. The tables have foreign key relationships between themselves. If an INSERT operation is done on a table with a…
David דודו Markovitz
  • 42,900
  • 6
  • 64
  • 88
17
votes
2 answers

How can I generate (or get) a ddl script on an existing table in oracle? I have to re-create them in Hive

How can I generate a DDL script on an existing table in oracle? I am working on a project where I have to re-create some tables that are present in Oracle table into Hive.
VSJ
  • 213
  • 1
  • 2
  • 5
17
votes
5 answers

How to determine if a column is unsigned?

I'm currently trying to list all columns of a specific table and determine if each column is unsigned or not. Here, an example of my test fixture: CREATE TABLE ttypes ( cbiginteger BIGINT UNSIGNED, cinteger INT UNSIGNED, csmallinteger…
egeloen
  • 5,844
  • 1
  • 27
  • 38
16
votes
5 answers

How to SHOW COLUMNS from a SELECT query (rather than a table)?

I get a syntax error when I run the following: show columns from (select * from (select * from my_table) as T) How can I show the columns from a query that I wrote, rather than from a table?
CRISHK Corporation
  • 2,948
  • 6
  • 37
  • 52
15
votes
1 answer

Entity Framework entity is not in DataSpace.OSpace (_workspace.GetItemCollection(DataSpace.OSpace)) but is in DataSpace.CSpace

I have been mucking around with XMLs for entity Framework. I tried to create a type of entity that could have properties injected at runtime, First I created DynamicEntity object that is dynamic public class DynamicEntity : DynamicObject { …
Matas Vaitkevicius
  • 58,075
  • 31
  • 238
  • 265
10
votes
4 answers

How can I view the metadata for a Microsoft Access 2013 table?

How can I view the metadata(data dictionary) for a Microsoft Access 2013 table?
yesman
  • 109
  • 1
  • 1
  • 7
7
votes
2 answers

Difference between SYS.ALL_TAB_COLUMNS and SYS.ALL_TAB_COLS in Oracle 12c

What is the difference between the ALL_TAB_COLUMNS and ALL_TAB_COLS system tables in Oracle 12c? In my DB, the ALL_TAB_COLUMNS has slightly fewer rows than ALL_TAB_COLS.
amphibient
  • 29,770
  • 54
  • 146
  • 240
1
2 3
14 15