Class 10 Database Management Notes
Class 10 Database Management Notes
Database
A database is an organized collection
of data, so that it can be easily
accessed, managed and updated. It is
mainly stored in electronic form and
controlled by database management
System (DBMS).
Example of Database – Oracle,
OpenOffice Base and Microsoft
Access.
Types of Databases
Flat Database – Information is stored
as a single file in a tabular format.
(Electronic Spreadsheet).
Advantages of Databases
• Easy Searching and Updating.
• Large of Data can be easily
managed.
• Reduction of Data Redundancy.
• Controlled Inconsistency.
• Data Sharing.
• Data Security and Backup.
• Printing Reports.
Features of Database
• Stores data in one central location.
• Allows data to be shared by many
users.
• Provides user interfaces to work
with the data.
• Creates backups.
• Controls who can access and edit
the data.
1. What is database?
2. Give two examples of Database.
3. What is relational database.
4. Write any four advantages of
database.
Database Management System (DBMS)
DBMS is software system used to store, retrieve
and run queries on data.
Questions
1. What is RDBMS?
2. What is primary key.
3. What is attribute?
4. Give two examples of RDBMS?
Creating Database
• Step 1: - Click on LibreOffice Base
• Step 2: - Select Database
• Step 3: - Create a new database option →
Next
• Step 4: - Click on Finish
• Step 5: - Name the Database and Click on
Save
• Creating Tables
• Tables also known as Relation are the
basic building blocks of a database.
• We can create a table in a database.
• Create table in Design View.
• Use Wizard to Create Table.
• Create table in Design View
• Step 1: Click on Tables → Create Table in
Design View.
• Step 2: Select Field names.
• Step 3: Specify the data Types.
• Step 4: Set he Field Properties like Entry
Required, Length, Decimal places, Default
values etc.
• Step 5: Right click on the left side of field
to assign it as Primary Key.
• Step 6: Specify the Table Name and Click
on Save.
•
• Use Wizard to Create Table
• Step 1: Click on Tables → Use Wizard to
Create Table.
• Step 2: Select Fields (Choose from
Business or Personal).
• Step 3: Select from Available Fields,
Click on > or < to Select a Field.
• Step 4: Set types and Formats.
• Step 5: Set Primary key.
• Step 6: Save and Proceed.
•
•
• Note: We can Rename, Delete table,
Change field properties from Tables
Section from Main Window. Right Click
on table → Edit.
•
• Data Types
• Data Types are used to identify which type
of Data (value) we can store in tables of
database.
• Five Main Categories of Data Types
• Categorie • Sub • Examples
s categories
• Alphanu • Char • “Hello123”
meric • Varchar • “Delhi, India 100”
• Memo • “Delhi, India 100”
• Numeric • Integer • 45456567
• Smallint • 53
• Bigint • 56456473456
• Float • 12.45
• Boolean • Yes/No
• Binary • Image • Image
• Binary • Binary
• Date/ • Date • 12/24/2007
Time • Time • 11:45:20
• Other • Other • Other
Data
Types
•
• Questions
• What is Primary key.
• What is difference between Alphanumeric
and Numeric data Types.
• Write Steps to create a table using Wizard.
Performing Operations on Table
We can insert, Modify/Update and delete
data from a Table.
Deleting a Record
Step 1: Open the table in data sheet view.
Step 2: Click on the row header area to
select the record to be deleted.
Step 3: Right Click and Select the
Record(s).
Step 4: Click on Yes Button to
permanently delete the records.
Relationship
Relationships are links that associate a
filed in one table with a field in another
table.
Advantages of Relationships
• Save time as there is no need to enter
the same data in separate tables.
• Reduce data – entry errors.
• Summarize data from related tables.
Creating Relationship
Step 1: Create two tables for building
relationship.
Step 2: Click on Relationship options in
the Tools menu. Add table dialog box will
appear.
Step 3: Select the tables and click on Add
button.
Step 4: Open the Relation Design window.
Step 5: Click on New Relation option in
the Insert menu.
Step 6: Select the tables under table
involved if they are not already selected.
Step 7: Select the field.
Select the primary key from one table and
drag it on same field in the second table.
Types of Relationship
One to One – Both tables can have one
record on either side of the relationship.
One to many/Many to one – Any single
rows of the first table can be related to one
or more rows of the second table, but the
rows of second tables can only related to
the only row in the first table.
Many to Many – This relationship that
create a relationship between two tables.
Each record of the first table can relate to
any records in the second table. Similarly,
each record of the second table can aslo
relate to more than one record of the first
table.
Questions
• What is Relationship.
• What is one to many type of
relationship.
• Write steps to insert data in a table.
Retrieve Data Using Query
A query is a request for data or information from a database Table
or combination of Tables.
We can query with one of the following ways
• Create a query in Design View.
• Use wizard to create a query.
• Create a query in SQL view.
Step 1: Open the database file where you want to create the new
query.
Step 2: In the left pane of the database window, click on Queries
icon.
Step 3: Click on Use wizard to create Query option. There are
eight steps in this Query Wizard.
Step 4: Field selection, Select the table and fields for query and
click on the next button.
Step 5: Sorting order. It specifies the sorting order for the data
records in your query.
Step 6: Search Conditions.
Step 7: Detail or Summary – Aggregate Functions.
Step 8: Grouping, Grouping Conditions and aliases name.
Step 9: Overview – Name of Query, Display, modify and
overview.
Click on finish button.
Step 10: Save the query.
Questions
• What is Query.
• What are Aggregate Functions.
• Short cut keys to run a query.
• Steps to perform query using wizard.
Creating Queries using SQL Commands
A query is a request for data or information from database table or
tables.
Basic Syntax/Structure of SQL commands
Select (Column1, column 2, column 3, ...) from table_name
[Where condition] [order by] [group by column]
Where clause
It is used to filter data according to specified conditions.
Select * from students where marks>90;
Students
Rollno Name Marks City
4 Mahesh 100 Delhi
Order by Clause
Order by clause is used to sort the data in ascending (asc) or
descending (desc) order, based on one or more columns.
Select * from students order by Name desc;
Students
Rollno Name Marks City
2 Diya 70 Mumbai
1 Karan 78 Delhi
4 Mahesh 100 Delhi
3 Priyanka 68 Jaipur
7 Raj 69 Pune
6 Rakesh 85 Delhi
8 Simran 88 Jaipur
5 Siya 50 Mumbai
Group by
The Group by clause in a SQL commands that is used to group
rows that have the same values.
Select city from students group by city;
Delhi
Mumbai
Jaipur
Pune
Aggregate Functions
We can also use aggregate function like count, sum, min, max and
avg on the grouped column.
Select city, count(*) from students group by city;
City Count (*)
Delhi 3
Mumbai 2
Jaipur 2
Pune 1
Questions
• What is query?
• Write steps to create a query.
• What is select commands.
• Write a sql commands to represent data in ascending order of
names.
• What is syntax of insert command.
Creating Forms
Base provides an easy and organized way to enter
data in individual or multiple tables using forms.
Forms are used for entering, modifying and
viewing records you likely to have.
Questions
• What is use of forms.
• What are sub forms.
• Write steps to create a forms.
Designing Reports
• Reports are used to represent data in printable
format.
• Reports can be generated from single or
multiple data sources showing information in
a systematic and summarized manner.
Questions
• What are Reports.
• Why are Reports are useful.
• Write steps to create a report.