Information Technology class 10
Information Technology class 10
(402)
CLASS-X
TOPIC- Database Management System
INTRODUCTION
.
I.T
system.
ar
nw
Ta
al
un
● Data – Data is a collection of facts which do not have any meaning. This data is
unstructured information such as numbers, text, symbols and images.
● Information – Information depends on data, this information has some meaning.
This Information refers to organised and structured data.
Advantages of DBMS
.
I.T
● Organized Storage – In database data are stored in an organized manner, so that
retrieval of the data is fast and accurate.
● Data Analysis – In database you can retrive the data based on certain criteria for
ar
example average, maximum or minimum value etc.
● Data Sharing – Databases can share the data with other applications.
● Minimal Data Redundancy – In database duplicate data is not allowed, it means
nw
that same data will not be repeated in the table.
● Data Consistency – In database if any record is changed in any one of the tables
then the same data will update in other tables also.
Ta
● Increases Validity – In the database the valid data is being entered and checked
by the database.
un
Data Models
K
A database can be designed in different ways dependent on data storage. This structure
of the database is known as a data model. The data models describe the relationships
between the data.
In Hierarchical Data Model the data is organized like tree structure and data is stored in
the form of a table.
.
I.T
ar
nw
Network Data Model
Ta
In this model, multiple records are linked to the same master file. This network model is
considered as a tree where the master table present in the bottom and other tables
linked to the master table.
al
un
K
Relational Data Model
Relational data models are based on relationships between two or more tables of the
same database. This is the most popular data model.
.
I.T
ar
nw
Ta
E. F. Codd given the concept of Relational Database Model in 1970. The most popular
type of database model is the relational model. In relational database models the data
al
elements are stored in different tables, this table is related through the common fields.
un
● Entity – Entity is a piece of data that is stored in the database, for example, student
rollno, name and age is the entity of the student record.
● Table – Table is a collection of logically related records. It is organised as a set of
columns.
● Field or Columns or attributes – The smallest entity in the database is known as
field, a collection of fields is known as record, a collection of records make a table and a
collection of tables make a database.
● Data Values – Data values are raw data represented in character, numeric or
alphanumeric.
● Record or Row – The collection of data values of all the fields are known as record.
● Primary Key – The field that uniquely identifies a row in a table. The primary key
used to be a unique identifier for the table.
● Relational Database – A relational database is a collection of related tables.
● Foreign Key – The field or a combination of fields of one table can be used to
uniquely identify records of another table, then that particular field is known as the
.
foreign key.
I.T
● Candidate Key – All the field values that are eligible to be the primary key are the
candidate key for that table.
● Alternate Key – One or two fields in the table are made as primary key but others
ar
are the alternate key.
Objects of an RDBMS
nw
The database is a collection of objects or a features that is used to store, represent or
retrieve data, Different types of objects in a database are given below –
Ta
● Table – Table is a collection of row and column which is used to store data. The
data in the database is first stored in a table.
● Form – A form is used to enter data in a table, form is the interface between
al
database and users, it is an easiest method to enter data in database using user friendly
manners. A form consists of a text box, radio button, labels, check box etc.
un
● Queries – Queries are used to retrieve the desired result from the database.
● Reports – The output of any query in the database may be displayed in the form of
reports.
K
Data Types
A data type refers to the type of data that will be stored in that particular field. The
memory size of a field varies according to its data type. There are six different types of
data type in LibreOffice Base –
● Text Data Types
● Numeric Data Type
● Currency Data Type
● Date Data Type
● Boolean Data Type
● Binary Data Type
.
I.T
The text data consists of a mix of special characters, numbers, and letters. With text data,
no mathematical operations may be carried out. PAN card numbers, names, marks, and
other data types are examples of text data.
ar
The lists of various data types that can store textual data –
nw
Name Data Type Description
Ta
characters
for example AADHAR NO, ACCOUNT NO, PASSPORT
NO etc.
K
Numeric Data type contains numbers. The number can be integer, real, float or double.
.
Tiny Integer TYNYINT No 0-255
I.T
Small SMALLINT Yes -32768 to 32768
Integer
ar
Integer INTEGER
nw Yes -2.14×109 to 2.14×109
Currency Data type contains monetary values and can store currencies of different
countries.
.
I.T
Date Data Type
This data type is basically used for date and time. There are various formats used to
store date and time.
ar
List of various forms of date data types are –
nw
Name Description
Ta
Date Stores the year, month and day as it is stored in the system.
Time Stores the time of the day as hour, minute and second.
al
un
Boolean
K
In boolean data type there are only two values – True or False, This also can be given in
multiple formats like Yes/No, True/False, On/Off.
Binary
.
● Step 1: Click on Start > LibreOffice base
I.T
● Step 2: In Database Wizard, Click on Create a new database
● Step 3: After Creating a new database, Click on Yes, register the database for me
● Step 4: Click on Finish, Now your database will be created
ar
Creating a Table nw
After creating a database now you will start working with objects of the database, The
first object we are going to create is Create Table. There are two different method to
create table –
Ta
After creating tables in a database, you can also create relationships between two or
more tables to control data redundancy and inconsistency. When you create a
relationship between two or more tables then adding or updating a record in one table
reflects the changes in all the related tables.
.
I.T
Master table vs Transaction table
If the School wants to manage student fees collection in a database, then they will create
ar
two tables, one for Student Details and second for Free details, here the Student Details
will be master table and Fee details will be transaction table.
nw
Relationships between Tables
A relationship is a connection between two or more tables that contain data, the
relationships between tables are based on a common field. This relationship helps to
Ta
Types of Relationships
al
The relationships between two or more tables in a database is based on the number of
un
records, Primarily there are three different types of relationships that can be set up
between two or more tables.
K
1. One-to-One
2. One-to-many
3. Many-to-Many
One-to-One relationship
In a One-to-One relationship, the master table and transaction table both have one
record.
One-to-Many relationship
In a One-to-Many relationship, the master table having one record and transaction table
having multiple records. This is a very common type of relationship between the tables in
the database.
Many-to-Many relationship
In a One-to-Many relationship, the master table has multiple records and the transaction
.
I.T
table has multiple records.
ar
1. A relationship helps to prevent data redundancy.
2. Relationships between tables help to restrict from entering invalid data in the
nw
referenced field.
3. It helps to prevent missing data by keeping deleted data from getting out of sync.
4. Any update in the master table is automatically reflected in the transaction tables.
Ta
In the RDBMS data can be integrated using keys. These are Primary Key, Composite
Primary Key, and Foreign Key, Key are used to make the relationship between the tables.
al
1. Primary Key – This unique field is called the Primary Key (PK). primary key is a field
un
or a set of fields that uniquely identify each record in a table. A primary key must be
unique and cannot contain null values.
2. Composite Primary Key – A composite primary key is a primary key that consists
K
of two or more fields that together uniquely identify each record in a table.
3. Foreign Key – Foreign key is used to link one table to another table using
referencing where the first table will be primary key, and the second table will be foreign
key. It is used to make relationship between two tables.
Referential Integrity
As per the principle rule of the database, no unmatched foreign key values should exist
in the database. Referential integrity processes concentrate on ensuring data consistency
and the link between tables.
1. No action – This is default option, this option states that no update or delete are
allowed in the master table if any related record exists in the transaction table.
.
2. Update cascade – This option allows to delete or update the referenced field but
I.T
the related records that are also available in any transaction tables will also be deleted or
updated.
3. Set NULL – This option assigns NULL value to all the records in the master record
ar
that are deleted or updated.
4. Set default – This option assigns a fixed default value to all the related fields if the
master record deleted or updated.
nw
Chapter 11: Queries in Base
Ta
In the database data is stored in an organized manner which helps to retrieve data
quickly and accurately. To search and retrieve the desired data from the database, we
have to give its specifications to DBMS. Such specifications are given to the database in
the form of queries.
al
Query
un
A query is the most important feature of DBMS. Query is a request for data, query helps
to retrieve and display data from one or more tables in a database. This is done by giving
K
DDL Statements:
.
I.T
● Create: Using this statement, a database or set of tables can be created.
● Alternate: This statement is used to change the table’s structure.
● Drop: This statement is used to remove database objects from the system.
ar
DML statements:
●
nw
SELECT: The statement “SELECT” is used to get data from the database.
● INSERT: The statement “INSERT” is used to add a new record to the database.
● DELETE: The database can be cleaned out by using the statement DELETE.
● UPDATE: This statement is used to modify the database’s information.
Ta
Select Statement
Select statement is most important for retrieving and for displaying data from a
al
database.
un
.
I.T
Product_No Product_Name Price Quantity
25 Soap 40 80
ar
31 Powder 80 30
nw
45 Shampoo 250 25
Ta
Question 6- Write a Query to display the product whose price is less than
90
.
I.T
Question 7- Write a Query to find the total amount of the Shampoo product;
ar
Question 8- Write a Query to display the data whose quantity is equal to 80.
Answer: Select
nw
* from product where quantity = 80;
Answer: Select * from product where Price >= 40 and Price <= 120;
alphabetical order.
Answer: Select
un
Question 11- Write a Query to display the list of Price in descending order.
K
UPDATE statement
Update statement is used to update existing records present in database. The updated
statement will apply using WHERE clause.
25 Soap 40 80
.
I.T
31 Powder 80 30
ar
45 Shampoo 250 25
nw
52 Soap Box 120 100
table.
LibreOffice Base provides the Form feature for data entry purposes and report feature
for displaying the data.
Form
A form is a database object with a user-friendly interface that allows data entry and
viewing in a visually attractive and accessible method. It serves as the front end for
entering and editing data into any database.
.
1. Using a wizard
I.T
2. Using the Design View
ar
Creating a Form Using a Wizard is the simplest way to create a form in LibreOffice base.
To create a form using wizard, follow the following steps.
nw
● Step 1: Open Database
● Step 2: Click on Use Wizard to Create Form
● Step 3: Select the fields of your form
Ta
Forms Control Toolbar – This toolbar contains various controls that can be added to the
K
form.
Records Toolbar – The Records toolbar contains the navigation control buttons in the
extreme left.
.
● Step 6: Select sort option according to the data
I.T
● Step 7: How do you want your report to look
● Step 8: Describe how you want to processed
● Step 9: Click on Finish
ar
nw
Ta
al
un
K