DBMS Notes Class 10
DBMS Notes Class 10
Content:
1. What is a Database?
2. What is DBMS? Types of DBMS.
3. Advantages of DBMS
4. Database objects
5. Terminologies related to DBMS
a. Cardinality
b. Degree
c. Queries
d. Forms and Reports
e. Constraints
6. Types of Constraints
a. Default
b.Not null
c. Check
d.Unique
e. Keys
7. Types of Keys
a. Primary keys
b. Foreign keys
c. Alternate keys
d. Candidate keys
e. Composite keys
8. Relationship
9. Datatypes
1
10. SQL
11. Types of SQL Queries
12. DDL
a. Create
b. Alter
c. Drop
13. DML (important)
a. Select
b. Insert
c. Delete
d. Update
2
1. What is a Database?
Database is an organised collection of inter-related
data.
2. What is DBMS?
DBMS it stands for database management system, it is
an electronic book record keeping system, that is used
to store, retrieve, update and delete data digitally.
Types of DBMS:
1. Flat-file databases: it is a database that stores data in
plain text, in single table format which is easily
readable. Example: MS-Excel
2. RDBMS (Relational Database Management System):
it is a database that stores data in multiple tables and
the tables are linked using common fields. Example:
My-SQL, MS-Access etc.
Advantages of Databases:
Reduces Redundancy
Reduces Inconsistency
Data Security
Data Integrity
Backup and Security
3
Database Objects:
Tables: table are also known as relation, it is a type of
data structure, which is used to store data in rows and
columns.
Terminology:
a. Cardinality: the number of Rows/Records/Tuples in
a table is called cardinality.
b. Degree: the number of Columns/Fields/Attribute in
a table is called degree.
c. Queries: it is a question or inquiry about a set of
data, which is retrieved using SQL
d. Forms: Forms are objects in OpenOffice Base that
is used to enter data graphically in OpenOffice
Base.
e. Reports: Reports are objects in OpenOffice Base
that help generate and print the tables in
OpenOffice Base.
f. Constraints: Constraints are rules or conditions
that are applied to the data within a database to
ensure data integrity and consistency.
4
Types of constraints:
i. Default: it set a condition on the column if no
data is entered, it will accept a default value for
that field.
ii. Not null: this condition implies that no field are
left empty by the user.
iii. Check: used to ensure the validity of data in a
database and to provide data integrity
iv. Unique: this condition ensures that the value
entered in the column is not duplicate.
v. Keys: Key constraints in DBMS are set of rules
that are defined for primary key.
Types of Keys:
1. Primary keys: A primary key is a constraint which
uniquely identifies each record in a table. It can
be only one in each table.
2. Foreign keys: A foreign key establishes a
relationship between tables by referencing the
primary key of another table.
3. Alternate keys: Alternate key is also unique in
nature and is capable of identifying each record
in a table.
4. Candidate keys: a set of one or more columns
which can uniquely identify records in a table. A
table can have multiple candidate key but only
one primary key.
5
5. Composite keys: A key which contains more than
one column/field together that can uniquely
identify a row in a table is called composite key.
Relationships:
A pair of primary key and foreign key is required to
create a relationship between tables.
Types of relationships:
1. one-to-one
2. many-to-many
3. many-to-one or one-to-many
6
Numeric Datatypes: It helps store numeric values in a
database. Some of the numeric datatypes are:
7
Date time: when we have to specify date and time as
data in a column then date time datatype is used.
8
SQL – Structured Query Language
9
Syntax to change datatype of a column
Alter <table name> modify column datatype;
10
Syntax to insert data in a table
Insert into <table name> values (column1,
column2);
c. Update command: this command is used to update
data in the tables.
Syntax to update data
Update <table name> set column value where
condition
11
Exercises:
Question 1. Artists
Question 2. Employee
1. Display the records of all the employees where age is less than 35.
2. Update salary by 5000 where department is IT.
3. Insert a record in the table with the following information.
(9, “Rashmi” ,”HR”, 25, 28000)
4. Delete the record where department is admin.
12