17
RELATIONSHIPS Generally there are two main database types: flat-file and relational

RELATIONSHIPS

Embed Size (px)

DESCRIPTION

RELATIONSHIPS. Generally there are two main database types: flat-file and relational. Flat-file database is a type of database that contains only a single table. - PowerPoint PPT Presentation

Citation preview

RELATIONSHIPS

Generally there are two main database types: flat-file and relational

Flat-file database is a type of database that contains only a single table.

• Relational database contains more than one table, and the tables are related to one another. In a relational database, data can be subdivided into different tables.

• Access is a relational database management system. Relationships are used to link tables to one another.

Types of Relationships

• ONE-to-ONE• ONE-to-MANY• MANY-to-MANY

One-to-One

• for example, you can store general information about students in one table and password and username information in another table that is linked to the first table.

One-to-many

• In a one-to-many relationship, a record in one table can have multiple matching records in another table.

• One-to-many relationships are the most common relationships in Access databases.

MANY-to-MANY

• In a many-to-many relationship, many records in one table can have many matching records in another table

• Relationships can be established by linking two fields located in different tables.

• The field from the first table, called Primary key field (must be a unique field that can be a key field or Indexed, No duplicate field) links to a corresponding field (called a Foreign key) in the second table.

• The Primary key field in the first table and Foreign key in the second table can have different names in their tables, but they must be of the same data type