1 / 11

The database

The database. An introduction to the catalogs.

Download Presentation

The database

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. The database An introduction to the catalogs

  2. One of the neat things about a relational database system is that the internal schema information that describes what relations exist in the database, the format of their attributes, and what attributes have indices on them, is also stored in relations • This schema is called the catalogs.

  3. There are two main catalogs: • relCat • attrCat • The relCat relation is used to keep track of all of the relations in the database. • It contains one tuple for each relation. • The attrCat relation is used to maintain information about the attributes of each relation. • It contains one tuple for each attribute of each relation

  4. Relation Catalog • Relation Description Component • Relation name • Relation Length • Attribute count • Record count • Sort Field • Format

  5. Attribute Information Component • Attribute number • Attribute Offset • Attribute length • Attribute Type • Attribute Name • Relation Name

  6. Attribute Catalog • Attribute Description Component • Relation Name • Attribute Name • Attribute Offset • Attribute Type • Attribute Length • Indexed

  7. Attribute Catalog Class Methods • Status getInfo( char* relation, char* attrName, attrDesc& record); • Status addInfo(AttrDesc record); • Status removeInfo(char* relation, char* attrName); • Status getRelInfo(char* relation, int& attrCnt, AttrDesc*& attrs); • Status dropRelation(char* relation); • Status addIndex(char* relation, char* attrname); • Status dropIndex(char* relation, char* attrname);

  8. Relation Catalog Class Methods • Status createRel (char* relation, int attrCnt, attrInfo attrList[ ]); • Status destroyRel (char* relation); • Status addIndex (char* relation, char* attrname); • Status dropIndex (char* relation, char* attrname); • Status addInfo (RelDesc record); • Status getInfo (char* relation, RelDesc& record); • Status help (char* relation );

  9. Relation Name Record Length Attribute Count Record Count Sort field Format Relation Catalog

  10. Attribute Number Attribute Offset Attribute Length Attribute Type Attribute Name Relation Name Attribute Catalog

  11. Lets look at the Assignment • And the hand out

More Related