0% found this document useful (0 votes)
20 views

DATABASE

The document discusses key concepts related to databases including components like tables, records, and fields. It also covers database management systems and their functions such as data definition, manipulation, integrity and security. Different types of keys in databases are explained along with relationships and cardinality.

Uploaded by

Uswa Azhar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
20 views

DATABASE

The document discusses key concepts related to databases including components like tables, records, and fields. It also covers database management systems and their functions such as data definition, manipulation, integrity and security. Different types of keys in databases are explained along with relationships and cardinality.

Uploaded by

Uswa Azhar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

DATABASE AND IT’S COMPONENTS

A database is a structured collection of data organized in a way that allows for efficient
storage, retrieval, and management of information. It serves as a centralized repository
for storing and managing data, making it easy to organize, update, and retrieve
information as needed. Databases are a critical component of information systems and
are widely used in various applications, ranging from simple desktop databases to large-
scale enterprise systems.

Key components and concepts associated with databases include:

1. Tables: Databases are often organized into tables, which represent entities (such
as customers, products, or employees) and their attributes. Each table consists of
rows and columns, where each row corresponds to a record, and each column
represents a specific attribute or field.
2. Records: A record is a complete set of related data in a database table. It
contains information about a particular entity or item, represented by the
columns within the table.
3. Fields: Fields are the individual data elements or attributes within a record. They
represent specific pieces of information about the entity being stored.
4. Relations: In relational databases, tables can be related to each other based on
common fields. Establishing relationships between tables enables the creation of
more complex and efficient databases.
5. Queries: Users can retrieve specific information from a database using queries.
Queries allow for the selection, filtering, and sorting of data based on certain
criteria.
6. Indexes: Indexes are data structures that improve the speed of data retrieval
operations on a database table. They help optimize queries by providing a faster
way to locate specific rows.

Database Management System (DBMS) AND IT’S


FEATURES:
A Database Management System (DBMS) is software that provides an interface for
interacting with a database. It facilitates the creation, maintenance, and use of databases
by serving as an intermediary between users and the database itself. The primary
functions of a DBMS include data storage, retrieval, updating, and management. Here
are some key aspects of a DBMS:

1. Data Definition: DBMS allows users to define the structure of the database,
including the creation of tables, specifying data types for fields, and establishing
relationships between tables. This is typically done using a data definition
language (DDL).
2. Data Manipulation: DBMS provides a data manipulation language (DML) that
allows users to interact with the data stored in the database. Users can insert,
update, delete, and retrieve data using queries and commands.

3. Data Integrity: DBMS enforces data integrity by imposing rules and constraints
on the data. This ensures that the data stored in the database is accurate,
consistent, and meets specified criteria.

4. Security and Authorization: DBMS provides mechanisms for controlling access to the
database and protecting sensitive information. It includes user authentication,
authorization, and auditing features to ensure data security.

5. Backup and Recovery: DBMS includes tools and features for backing up and recovering
data. This is crucial for ensuring data availability and minimizing the risk of data loss due
to system failures or errors.

KEYS AND IT’S TYPES IN A DATABASE


1. Primary Key:
• Definition: A primary key is a unique identifier for a record in a table. It
uniquely identifies each record and cannot contain NULL values.
• Example: In a "Students" table, the "Student ID" can be a primary key.
2. Secondary Key:
• Definition: The term "secondary key" is not a standard database term. It is
possible that it refers to any non-primary key used for indexing and
retrieval purposes.
• Example: If you have a "Customers" table with a primary key on
"Customer ID," a secondary key might be created on the "Email" column
for efficient email-based searches.
3. Foreign Key:
• Definition: A foreign key is a field in a table that refers to the primary key
in another table. It establishes a link between the two tables.
• Example: In an "Orders" table, the "Customer ID" may be a foreign key
referencing the "Customer ID" primary key in the "Customers" table.
4. Composite Key:
• Definition: A composite key is a key that consists of two or more columns
to uniquely identify a record in a table.
• Example: In an "Employees" table, a composite key might consist of
"Employee ID" and "Department ID" together.
5. Candidate Key:
• Definition: A candidate key is a set of columns that can uniquely identify
a record. From the candidate keys, one is chosen as the primary key.
• Example: In a "Books" table, a combination of "ISBN" and "Edition" could
be a candidate key.
6. Sort/Control Key:
• Definition: The term "sort/control key" is not a standard database term. It
may refer to a field or set of fields used for sorting records or controlling
the physical order of data in a database file.
• Example: In an "Employee" table, a "Hire Date" column might be used as
a sort key for arranging employees based on their hire dates.

RELATIONSHIP IN DATABASE
In a database, a relationship refers to the connection between tables based on
common fields. These relationships define how data in one table is related to data in
another table, facilitating the organization and retrieval of information. There are
different types of relationships, and two important concepts associated with
relationships are "cardinality" and "modality."

1. Cardinality:
• Definition: Cardinality defines the number of related records that each
side of a relationship can have. It describes the maximum and minimum
number of occurrences of one entity that can be associated with another
entity.
• Examples:
• One-to-One (1:1): A person has exactly one passport, and a
passport belongs to only one person. In database terms, this is
represented as a 1:1 relationship.
• One-to-Many (1:N): A department has many employees, but an
employee belongs to only one department. This is represented as a
1:N relationship.
• Many-to-One (N:1): Many students attend one school, but a
school can have many students. This is also represented as a 1:N
relationship.
2. Modality:
• Definition: Modality defines the minimum participation requirements of
entities in a relationship. It specifies whether an entity is optional or
mandatory in a relationship.
• Examples:
• Optional Participation: In a "Customer" and "Order" relationship, a
customer might not have any orders (0..N), indicating optional
participation.
• Mandatory Participation: In a "Department" and "Employee"
relationship, every employee must belong to a department (1..N),
indicating mandatory participation.

Examples:

• One-to-Many Relationship with Modality:


• Consider a "University" database where each department can have many
professors, but each professor must belong to one department. This is a
1:N relationship with mandatory participation on the "Many" side (N).
• Many-to-Many Relationship with Modality:
• In a "Students" and "Courses" relationship, where each student can enroll
in multiple courses, and each course can have multiple students. This is an
N:M relationship. However, since students can choose not to enroll in any
courses and courses may have no students, both sides have optional
participation (0..N or N..N).

You might also like