Types of Attributes
- Simple attribute − Simple attributes are atomic values, which cannot be divided further. For example, a student's phone number is an atomic value of 10 digits.
- Composite attribute − Composite attributes are made of more than one simple attribute. For example, a student's complete name may have first_name and last_name.
- Derived attribute − Derived attributes are the attributes that do not exist in the physical database, but their values are derived from other attributes present in the database. For example, average_salary in a department should not be saved directly in the database, instead it can be derived. For another example, age can be derived from data_of_birth.
- Single-value attribute − Single-value attributes contain single value. For example − Social_Security_Number.
- Multi-value attribute − Multi-value attributes may contain more than one values. For example, a person can have more than one phone number, email_address, etc.
- TYPES OF KEYS
- The different types of keys in DBMS are:
- Candidate Key - The candidate keys in a table are defined as the set of keys that is minimal and can uniquely identify any data row in the table.A minimal super key is called a candidate key. An entity set may have more than one candidate key
- Primary Key - The primary key is selected from one of the candidate keys and becomes the identifying key of a table. It can uniquely identify any data row of the table.A primary key is one of the candidate keys chosen by the database designer to uniquely identify the entity
- Super Key - Super Key is the superset of primary key.A set of attributes (one or more) that collectively identifies an entity in an entity set. The super key contains a set of attributes, including the primary key, which can uniquely identify any data row in the table.
- Composite Key - If any single attribute of a table is not capable of being the key i.e it cannot identify a row uniquely, then we combine two or more attributes to form a key. This is known as a composite key.
- Secondary Key - Only one of the candidate keys is selected as the primary key. The rest of them are known as secondary keys.
- Foreign Key - A foreign key is an attribute value in a table that acts as the primary key in another another. Hence, the foreign key is useful in linking together two tables. Data should be entered in the foreign key column with great care, as wrongly entered data can invalidate the relationship between the two tables
courtesy;tutorialpt