Database Notes Xi
Database Notes Xi
Database Notes-XI
Introduction to Data :
Data is a collection of information’s, in computing, data is information that has been translated into a
form that is efficient for movement or processing.
Example:Governments systematically collect and record data about the population through a process
called census.
Using computers, data are stored in electronic forms because data processing becomes faster and easier
as compared to manual data processing done by people.
The following list contains some examples of data that we often come across.
• Name, age, gender, contact details, etc., of a person
• Transactions data generated through banking, ticketing, shopping, etc. whether online or offline
• Images, graphics, animations, audio, video
• Documents and web pages
• Online posts, comments and messages
• Signals generated by sensors
• Satellite data including meteorological data, communication data, earth observation data, etc.
Database:
A database is an organized collection of structured information, or data, typically stored
electronically in a computer system. A database is usually controlled by a database management system
(DBMS).
Database management system :
A database management system (DBMS) or database system in short, is a software that can be
used to create and manage databases. DBMS lets users to create a database, store, manage,
update/modify and retrieve data from that database by users or application programs. Some examples
of open source and commercial DBMS include MySQL, Oracle, PostgreSQL, SQL Server, Microsoft Access,
MongoDB.
ISG/class 11 notes/IP/Roopa
The DBMS serves as an interface between the database and end users or application programs.
Retrieving data from a database through special type of commands is called querying the database. In
addition, users can modify the structure of the database itself through a DBMS.
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.
Database schema is also called the visual or logical architecture as it tells us how the data are organised
in a database.
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. For example, one can define the constraint that the column mobile
number can only have non-negative integer values of exactly 10 digits. Since each student shall have one
unique roll number, we can put the NOT NULL and UNIQUE constraints on the RollNumber column.
Constraints are used to ensure accuracy and reliability of data in the database
Meta-data or Data Dictionary :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.
Database Instance: the state or snapshot of the database at any given time is the database instance. We
may then retrieve data through queries or manipulate data through updation, modification or deletion.
Thus, the state of database can change, and thus a database schema can have many instances at
different times.
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. To retrieve or manipulate
data, the user needs to write query using a query language.
Data Manipulation: Modification of database consists of three operations viz. Insertion, Deletion or
Update. Suppose Rivaan joins as a new student in the class then the student details need to be added in
STUDENT as well as in GUARDIAN files of the Student Attendance database. This is called Insertion
operation on the database.
ISG/class 11 notes/IP/Roopa
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.
Limitations of DBMS
i) Increased Complexity: Use of DBMS increases the complexity of maintaining functionalities
like security, consistency, sharing and integrity
ii) Increased data vulnerability: As data are stored centrally, it increases the chances of loss of
data due to any failure of hardware or software. It can bring all operations to a halt for all
the users.
Relational Data Model:
Different types of DBMS are available and their classification is done based on the underlying data
model. A data model describes the structure of the database, including how data are defined and
represented, relationships among data, and the constraints. The most commonly used data model is
Relational Data Model.
Other types of data models -object-oriented data model, entity-relationship data model, document
model and hierarchical data model.
ISG/class 11 notes/IP/Roopa
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.
TUPLE: Each row of data in a relation (table) is called a tuple. In a table with n columns, a tuple is a
relationship between the n related values. [Rows of a table is called Tuple or Record]
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 Roll Number
takes integer values and hence its domain is a set of integer values.[ It is collection of values from which
the value is derived for a column]
DEGREE: The number of attributes in a relation is called the Degree of the relation. For example, relation
STUDENT with 3 attributes is a relation of degree 3.[ Number of columns]
CARDINALITY: The number of tuples in a relation is called the Cardinality of the relation. For example,
relation student with seven tuples is a cardinality of 7.[ Number of rows]
ISG/class 11 notes/IP/Roopa
A company database has two Table 1 –employee, table 2—location ,here Empid is common so the
relation between two tables is Empid.
Alternate key:
The remaining attributes in the list of candidate keys are called the alternate keys.
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.
ISG/class 11 notes/IP/Roopa