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

DBMS 12

Uploaded by

Himanshu Tonk
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)
25 views

DBMS 12

Uploaded by

Himanshu Tonk
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/ 3

Database Concepts

1. File System or Flat File System:


It has only one table which makes it very hard to manage data within flat file system.
Disadvantage/limitation of Flat file system:
(a) Difficulty in Access (b) Data Redundancy (Repeated data)
(c) Data Inconsistency (d) Data Isolation
(e) Data Dependence (f) Controlled Data Sharing

2. Database Management System:


It has more than one logically related tables which gives it more advantage over flat file
system.
Advantages of DBMS:
(a) Easy Access of Data (b) Reduce Data Redundancy
(c) Improve Data Consistency (d) Data Security
(e) Easy Data Sharing

3. Key Concepts in DBMS

(a) Database Schema: Database Schema is the design of a database. It is the skeleton of the
database that represents the structure (table names and their fields/columns), the type
of data each column can hold, constraints on the data to be stored (if any), and the
relationships among the tables.

(b) Data Constraint: Sometimes we put certain restrictions or limitations on the type of
data that can be inserted in one or more columns of a table. This is done by specifying
one or more constraints on that column(s) while creating the tables.

(c) Metadata: The database schema along with various constraints on the data is stored by
DBMS in a database catalog or dictionary, called meta-data. A meta-data is data about
the data.

(d) Data Instance: When we define database structure or schema, state of database is
empty i.e. no data entry is there. After loading data, the state or snapshot of the
database at any given time is the database instance.

(e) Query: A query is a request to a database for obtaining information in a desired way.
Query can be made to get data from one table or from a combination of tables. For
example, “find names of all those students present on Attendance Date 2000-01-02” is a
query to the database.

(f) Database Engine: Database engine is the underlying component or set of programs
used by a DBMS to create database and handle various queries for data retrieval and
manipulation.
3. Relational Data Model
In relational model, tables are called relations that store data for different columns.
Each table can have multiple columns where each column name should be unique.

4. Common Terminologies for Relational Data Model

(a) ATTRIBUTE: Characteristic or parameters for which data are to be stored in a relation.
Simply stated, the columns of a relation are the attributes which are also referred as
fields.
(b) TUPLE: Each row of data in a relation (table) is called a tuple.

(c) DOMAIN: It is a set of values from which an attribute can take a value in each row.
Usually, a data type is used to specify domain for an attribute. For example, in
STUDENT relation, the attribute RollNumber takes integer values and hence its
domain is a set of integer values.

(d) DEGREE: The number of attributes in a relation is called the Degree of the relation.

(e) CARDINALITY: The number of tuples in a relation is called the Cardinality of the
relation.

5. Important Rules for Relation:

(a) Property 1: imposes following rules on an attribute of the relation.


• Each attribute in a relation has a unique name.
• Sequence of attributes in a relation is immaterial.

(b) Property 2: governs following rules on a tuple of a relation.


• Each tuple in a relation is distinct.
• Sequence of tuples in a relation is immaterial.

(c) Property 3: imposes following rules on the state of a relation.


• All data values in an attribute must be from the same domain (same data type).
• Each data value associated with an attribute must be atomic (cannot be further
divisible into meaningful subparts).
• No attribute can have many data values in one
tuple.
• A special value “NULL” is used to represent values that are unknown or non-
applicable to certain attributes.

6. Keys in DBMS

(a) Candidate Key: A relation can have one or more attributes that takes distinct values.
Any of these attributes can be used to uniquely identify the tuples in the relation. Such
attributes are called candidate keys as each of them are candidates for the primary key.
(b) Primary Key: Out of one or more candidate keys, the attribute chosen by the database
designer to uniquely identify the tuples in a relation is called the primary key of that
relation. The remaining attributes in the list of candidate keys are called the alternate
keys.
(c) Composite Primary Key: If no single attribute in a relation is able to uniquely
distinguish the tuples, then more than one attribute are taken together as primary key.
Such primary key consisting of more than one attribute is called Composite Primary
key.
(d) Foreign Key: A foreign key is used to represent the relationship between two relations.
A foreign key is an attribute whose value is derived from the primary key of another
relation.

Here GUID of GUARDIAN table is primary for it but also referenced to GUID of
Student table where this field becomes Foreign key.
Similarly, attribute RollNumber is primary key in STUDENT table also this is
referenced to RollNumber of ATTENDANCE table.

7. More about Foreign Key:

(a) There are two tables one is called master table which has the primary key. Other is
called secondary or foreign table which has foreign key.

(b) Foreign key can have null value but the same attribute can never be NULL.

(c) Foreign key in secondary table can be a primary key as well, but it is not necessary.

You might also like