Name Qandeelmahmood
Name Qandeelmahmood
Name Qandeelmahmood
ASSIGNMENT NO: 04
A database is a structured collection of data that is organized and stored in a way that allows for
efficient retrieval, management, and manipulation of that data. It provides a systematic way to
store and manage large amounts of information, making it easier to access and analyze.
Databases are used in various industries and applications, such as business operations, scientific
research, and web applications. They play a crucial role in storing and organizing data for
efficient use.
Components of Database:
Data:
Data are raw facts and information that need to be organized and processed to make it more
meaningful. Database dictionaries are used to centralize, document, control, and coordinate the
use of data within an organization. A database is a repository of information about a database
(also called metadata).
Hardware:
Hardware refers to the physical, electronic devices such as computers and hard disks that offer
the interface between computers and real-world systems. Hardware components of a database
include servers, storage devices, network infrastructure, and backup systems.
Software: Software is a set of programs used to manage and control the database and includes
the database software, operating system, network software used to share the data with other
users, and the applications used to access the data.
Procedures:
Procedures refer to the instructions used in a database management system and encompass
everything from instructions to setup and install, login and logout, manage the day-to-day
operations, take backups of data, and generate reports.
Database Access Language is a language used to write commands to access, update, and delete
data stored in a database. Users can write commands using Database Access Language before
submitting them to the database for execution. Through utilizing the language, users can create
new databases, tables, insert data, and delete data.
This model defines a database as a collection of objects, or reusable software elements, with
associated features and methods. There are several kinds of object-oriented databases: A
multimedia database incorporates media, such as images, that could not be stored in a relational
database. A hypertext database allows any object to link to any other object. It’s useful for
organizing lots of disparate data, but it’s not ideal for numerical analysis. The object-oriented
database model is the best known post-relational database model, since it incorporates tables, but
isn’t limited to tables. Such models are also known as hybrid database models.
RDBMS
A relational database is a type of database that stores and provides access to data points that are
related to one another. Relational databases are based on the relational model, an intuitive,
straightforward way of representing data in tables. In a relational database, each row in the table
is a record with a unique ID called the key. The columns of the table hold attributes of the data,
and each record usually has a value for each attribute, making it easy to establish the
relationships among data points.
KEYS IN DBMS:
In a DBMS, KEYS are attributes or sets of attributes that enable the identification of a row or
tuple within a relation or table. They establish connections between different tables and assist in
uniquely identifying a row by utilizing one or more columns in the table.
PRIMARY KEY:
This type of key in DBMS refers to a column that uniquely identifies all the records within that
table. A table has one primary key only, and this key must not contain repeated or duplicated
values across its rows. Each value within the primary key must be unique, with no repetition
allowed. Applying the primary key constraint to a column or set of columns ensures that they
cannot have null values or duplicates. Furthermore, any foreign key that references the primary
key is unable to modify the values present in the primary key.
CANDIDATE KEY:
Candidate keys play a vital role in upholding the integrity and consistency of a database. The
purpose of this key in DBMS is to guarantee each row’s uniqueness and independent
identification within a table. Additionally, candidate keys enforce relationships between tables,
ensuring data integrity and maintaining overall database consistency. A candidate key in SQL
can have a variety of qualities, but it must not include null values and must have at least the bare
minimum of fields to guarantee uniqueness.
FOREIGN KEY:
To create connections between two accessible tables, we employ a foreign key. Every value in a
column or collection must match the primary key in the referential table for the foreign key to
function. We can preserve referential integrity and data integrity with the aid of a foreign key. It
is a key that serves as both a secondary key and a primary key in two different tables.
ALTERNATE KEY:
A key in DBMS might be selected as the main Key in a table in multiple ways. Any key that has
the potential to replace the primary key but is not, yet the primary key is considered an alternate
key. It’s a prospective main key that hasn’t been selected yet. Alternate keys refer to all keys that
are not main keys. It's a backup key. It has two or more fields that allow it to recognize two or
more records. These criteria are reiterated.
COMPOUND KEY:
This key in DBMS contains two or more characteristics that recognize a specific record
exclusively. It’s conceivable that none of the columns in the database are unique on their own.
However, when paired with the additional column or columns, the composite key combination
becomes unique. Each record in the table is to be uniquely identified using the database’s
compound key Each record in a table must be guaranteed unique by a compound key. The bare
minimal collection of characteristics necessary to assure uniqueness should be a compound key.
A compound key attribute order is essential.