What is a database for class 10?

Teachers and Examiners [CBSESkillEduction] collaborated to create the Database Management System Class 10 Notes. All the important Information are taken from the NCERT Textbook Information Technology [402].

Contents show

1 Database Management System Class 10 Notes

1.1 What is Database?

1.2 What is a Database Management System?

1.3 What is Database Server?

1.4 Advantages of Database

1.4.1 Reduces Data Redundancy

1.4.2 Sharing of Data

1.4.3 Data Integrity

1.4.4 Data Security

1.4.5 Privacy

1.4.6 Backup and Recovery

1.4.7 Data Consistency

1.5 Features of Database

1.6 Primary Key, Composite Primary Key and Foreign Key in a Database

1.7 What is RDBMS?

1.7.1 Database Objects

1.7.1.1 Tables

1.7.1.2 Columns or Fields or Attributes

1.7.1.3 Rows or Records or Tuples

1.8 How to create a database using Open Office

1.9 How to create a table in Database

1.9.1 Create Table in Design View

1.9.2 Use Wizard to Create Table

1.10 Data Types

1.10.1 Numeric Types

1.10.2 Alphanumeric Types

1.10.3 Binary Types

1.10.4 Date Time

1.10.5 Other Data Types

1.11 Session 3 : Perform Operations on Table

1.11.1 Insert Data in the Table

1.11.2 Editing Records in the Table

1.11.3 Deleting Record From the Table

1.12 Field Properties

1.13 Sorting Data

1.14 Referential Integrity

1.15 Session 4 : Retrieve Data using Query

1.15.1 DDL Statements:

1.15.2 DML statements:

1.16 Database Query –

1.16.1 Select Statement

1.16.2 Query related to Simple Select Statement –

1.16.3 Query related to Select Statement with Mathematical function –

1.16.4 Query related to Select Statement with Where clause –

1.16.5 Query related to Select Statement with Order by –

1.16.6 UPDATE statement

1.16.7 Create Table

1.16.8 Insert Table

1.17 Session 5 : Create Forms and Reports using Wizard

1.18 Forms

1.18.1 Reports

Database Management System Class 10 Notes

What is Database?

A database is an organized collection of data. You can visualize it as a container of information.

A database is a structured grouping of data that has been arranged and is often kept electronically in a computer system. A database management system used to manage a database [DBMS].

What is a Database Management System?

Data is stored, retrieved, and analyzed using software called database management systems [DBMS]. Users can create, read, update, and remove data in databases using a Database Management System, which acts as an interface between them and the databases.

For example – Oracle, IBM DB2, Microsoft SQL Server, Microsoft Access, PostgreSQL, MySQL, FoxPro, and SQLite.

Data can be organized into two types:

  • Flat File: Data is stored in a single table. Usually suitable for less amount of data. Text files without any markup often make up flat files.
  • Relational: Data is stored in multiple tables and the tables are linked using a common field. Relational is suitable for medium to large amount of data

What is Database Server? 

Database servers are specialised machines that exclusively operate the DBMS and associated applications. They contain the actual databases. Database servers are known as Back-ends, while Frontends are programmes with a command line or graphical user interface that are used to access databases that are available on them. A client-server model is the name given to this kind of data access.

Advantages of Database

Reduces Data Redundancy

Multiple files are contained in database management systems and must be stored in various places inside a single system or even across multiple systems. This resulted in data redundancy as there were occasionally multiple copies of the same file.

[Note – Data redundancy happens when the same piece of information appears more than once, but data inconsistency happens when the same information appears in various formats across various tables.]

Sharing of Data

A database allows its users to exchange data among themselves. The data can only be shared with users who have received the appropriate degrees of authorization because there are different levels of access to the data.

Data Integrity

Data accuracy and consistency in the database are terms used to describe data integrity. A DBMS contains many databases, therefore data integrity is important. Data that is accessible to many users is present in each of these databases. In order to ensure that the data is accurate and consistent throughout all databases and for all users.

Data Security

A database’s concept of data security is important. The database should only be accessible to authorised users, whose identities must be verified using a username and password. 

Privacy

The privacy rule in a database states that only the authorized users can access a database according to its privacy constraints. To secure data levels are set in the database and a user can only view the data which is allowed to be seen. For example – In social networking sites, access constraints are different for different accounts a user may want to access.

Backup and Recovery

According to its privacy limitations, a database’s privacy rule states that only authorised users are permitted access. A user can only view the data that is permitted to be seen, and levels are configured in the database to secure data. For instance, on social networking sites, different accounts that a user may want to access have varying access restrictions.

Data Consistency

Data consistency states that different versions of the same data shouldn’t match. All data must be identical for every user viewing the database and must be shown consistently throughout. Additionally, there are no data inconsistencies because all users immediately see the effects of any database changes.

Database Management System Class 10 Notes

Features of Database

There are some key features of a database:

  1. One or more tables can be added in the database.
  2. Decreased storage costs and space requirements
  3. Users can use query languages in a database  to insert, modify, search, and delete the data easily from the database.
  4. Multiple users can access the data from the database .
  5. All of the data in a database can be accessed by several users, but only one person can update a particular piece of data at once.
  6. There is no chance of data loss because Database Management System stores all data files permanently.
  7. One or more fields should be designated as keys in every database table. For the purpose of identifying records with possibly similar names or addresses, you can give this key a special value.
  8. Uniqueness aids in preventing accidental record duplication brought on by human or technological error.

Primary Key, Composite Primary  Key and Foreign Key in a Database

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. 

  1. Primary Key – This unique field is called the Primary Key [PK]. A primary key is a column in a table or a group of columns that aids in uniquely identifying each record in that table. In a table, there can only be one primary Key.
  2. Composite Primary Key – Composite primary key is the term used when the primary key constraint is applied to one or more columns.
  3. Foreign Key – To create connections between two tables, foreign keys are used. Each value in a column or collection of columns containing a foreign key must match the Primary Key of the referential table. Data and referential integrity are preserved with the use of foreign keys.

What is RDBMS?

A database management system that is based on the relational model is called an RDBMS [Relation Database Management System]. Tables are used to organise data in relational databases. A relational database management system [RDBMS] is used to store, manage, query, and retrieve data.

Database Objects 

Tables

Data is arranged into rows and columns in a table, which is a type of data structure. It can be applied to both the storage and presentation of structured data.

Columns or Fields or Attributes

Data is arranged vertically from top to bottom in columns. Each row of the table has one column, which is a collection of data values of a specific basic type. The structure by which the rows are put together is provided by the columns.

Rows or Records or Tuples

A row, also known as a Record or Tuple, in a table represents a single data item. A database table can be represented graphically as being made up of rows and columns, or fields. Every row in a table has the same structure and represents a group of connected data.

Database Management System Class 10 Notes

How to create a database using Open Office

Step 1 : Click on Start > Programs > OpenOffice > OpenOffice Base

Step 2 : Click on Create a new database

Step 3 : In the Database Wizard, Click on Finish

Step 4 : Specify a the Name of database and click on Save

How to create a table in Database

The database’s tables are used to store data. In the database, In OpenOffice Base the tables can be created in two different ways.

  1. Create Table in Design View
  2. Use Wizard to Create Table

Create Table in Design View

Step 1 : Click on Create Table in Design View
Step 2 : Select Field name and suitable datatype
Step 3 : Set the Primary Key
Step 4 : Change the table name
Step 5 : Save the table

Use Wizard to Create Table

Step 1 : Click on Table > Use Wizard to Create table 

Step 2 : Click the Select Fields > Choose Category > Select the table > Click on Next Button

Step 3 : Select data types from the given field

Step 4 : Set the Primary Key 

Step 5 : Rename the table and Click on Finish

Database Management System Class 10 Notes

Data Types

The type of data [value] that will be stored in the database is defined by its datatype. Important to know the different types of data helps to ensure that each property’s value is as expected and that data is collected in the correct format.

Data types in OpenOffice base are broadly classified into five categories listed below.

  • Numeric Types
  • Alphanumeric Types
  • Binary Types
  • Date time
  • Other Variable types

Numeric Types

Data that is presented as numbers rather than in any language or descriptive form is referred to as numerical datatype. Numerical data, also known as quantitative data, is gathered in number form and differs from all other types of number data because it can be calculated mathematically and statistically.

Alphanumeric Types

Data that has both letters and numbers is referred to as alphanumeric type.

Binary Types

For storing data in binary formats, binary data types are utilised. In a database, binary data types can be used to store things like music and image files. The binary data type can generally be used to store files in any format.

Date Time

When specifying date and time values for a column used in a database table, date time data types are used. Information like dates of birth, admissions, product sales, and other dates can be stored in databases using date and time data types.

Other Data Types

Database Management System Class 10 Notes

Session 3 : Perform Operations on Table

In Base, data is kept in tables that may be added to, changed, or deleted by using the proper options.

Insert Data in the Table

Step 1 : Select the table > Double click on it
Step 2 : The table will open in Datasheet View
Step 3 : Now you can Insert Number of records in Datasheet View

Editing Records in the Table

Step 1 : Select the table > Double click on it.
Step 2 : The table will open in Datasheet View
Step 3 : Edit the record as per the requirement

Deleting Record From the Table

Step 1 : Select the table > Double click on it.
Step 2 : The table will open in Datasheet View
Step 3 : Right click on data and select delete option

Field Properties

To modify the field’s attributes It is necessary to modify the table structure in design view. The following actions will be taken to set the field’s properties:

Select the table > Right click > Select the option Edit > the table Design View window will open

Following are some properties of data of the numeric type:

1. AutoValue – if set to yes then field will get the auto numeric values.
2. Length – By default length of the field is 10 but the size of the field can be set to maximum length.
3. Default Value – A default value can be set for a field if user don’t provide any value while entering the values in the table.
4. Format example – This property helps to set the format of the data entered in the field such as 91-222-333.

Following are some properties of data of the character type:

1. Entry Required – if set to yes then it will be must to insert the value in the field which means that field cannot be left blank.
2. Length – By default length of the field is 10 but the size of the field can be set to maximum length.

3. Default Value – A default value can be set for a field if user don’t provide any value while entering the values in the table.
4. Format example – This property helps to set the format of the data entered in the field such as 91-222-333.

Sorting Data

Sorting means to arrange the data in either ascending order of descending order. Sorting is the process of putting data into a meaningful order so you can evaluate it more efficiently.

Referential Integrity

The relationship between tables is referred to as referential integrity. Referential integrity is used to maintain accuracy and consistency of data in a relationship. In Base, data can be linked between two or more tables with the help of primary key and foreign key constraints.

Referential integrity helps to avoid:

1. Adding records to a related table if there is no associated record available in the primary key table.
2. Changing values in a primary if any dependent records are present in associated table[s].
3. Deleting records from a primary key table if there are any matching related records available in associated table[s].

Creating and Editing Relationships between Tables

An association or link between two or more tables is referred to as a relationship. You don’t have to enter the same data again in different tables when you relate two tables.

Relationships between tables helps to

  1. Save time as there is no need to enter the same data in separate tables.
  2. Reduce data-entry errors.
  3. Summarize data from related tables.

Type of Relationships in Database

There are three types of relationships which can be created in tables:

1. ONE to ONE
2. ONE to MANY OR MANY to ONE
3. MANY to MANY

ONE to ONE

In this relationship, both the tables must have primary key columns.

ONE to MANY OR MANY to ONE

In this relationship, one of the table must have primary key column. It signifies that one column of primary key table is associated with all the columns of associated table.

MANY to MANY

In this relationship, no table has the primary key column. It signifies that all the columns of primary key table are associated with all the columns of associated table.

Remove the Relationships

With the use of the Delete option, the relationships that have been applied to the tables can also be deleted.
When you right-click a relationship thread, the Delete option will appear.

Session 4 : Retrieve Data using Query

In order to describe the data structure and to modify the data in the database, queries are used as instructions. A query enables the joining and filtering of data from various tables.

Database Languages having two type:

  1. DDL [Data Definition Language]
  2. DML [Data Manipulation Language]

DDL Statements:

  • 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.

DML statements:

  • 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.

Database Query – 

Query is a computer languages. In order to describe the data structure and to modify the data in the database, queries are used as instructions. Query can extract particular data from a database. We can filter and join data from various tables with the help of a query. By using the criteria you supply query will filter the data.

Select Statement 

A select query is a language in a database that displays data in Datasheet view. Data from tables is displayed by a query rather than being stored by it. A query may display data from one or more tables, from other queries, or from both of these sources simultaneously.

The SELECT statement has many optional clauses:

  • WHERE specifies which rows to retrieve.
  • ORDER BY specifies an order in which to return the rows.

Syntax of Select Statement is – 

SELECT * FROM ;

Query related to Simple Select Statement –

Table Name – product 

Product_NoProduct_NamePriceQuantity25Soap408031Powder803045Shampoo2502552Soap Box120100Database Management System Class 10 Notes

Question – Write a Query to display all record from the table;

Select * from product;

Output –

Product_NoProduct_NamePriceQuantity25Soap408031Powder803045Shampoo2502552Soap Box120100Database Management System Class 10 Notes

Question – Write a Query to display product name from the table;

Select Product_Name from product;

Output –

Product_NameSoapPowderShampooSoap BoxDatabase Management System Class 10 Notes

Question – Write a Query to display Product_Name and Price from the table;

Select Product_Name, Price from product;

Output –

Product_NamePriceSoap40Powder80Shampoo300Soap Box120Database Management System Class 10 Notes

Query related to Select Statement with Mathematical function –

Table Name – product 

Product_NoProduct_NamePriceQuantity25Soap408031Powder803045Shampoo2502552Soap Box120100Database Management System Class 10 Notes

Question – Write a Query to find the total no of quantity available in table;

Select sum[quantity] from product;

Output – 235

Question – Display the total amount of each item. The amount must be calculated as the price multiplied by quantity for each item. 

Select Product_No, Product_Name, Price * Quantity from product;

Output –

Product_NoProduct_NamePrice*Quantity25Soap320031Powder240045Shampoo625052Soap Box12000Database Management System Class 10 Notes

Question – Write a query to find the average price of the total product;

Select avg[Quantity] from product;

Output – 58.75

Query related to Select Statement with Where clause –

Table Name – product 

Product_NoProduct_NamePriceQuantity25Soap408031Powder803045Shampoo2502552Soap Box120100

Question – Write a Query to display the product whose price is less than 90

Select * from product where price < 90;

Output – 

Product_NoProduct_NamPriceQuantity25Soap408031Powder8030Database Management System Class 10 Notes

Question – Write a Query to find the total amount of the Shampoo product;

Select Price*Quantity from product where Product_Name = ‘Shampoo’;

Output – 6250

Or

Select Product_No, Product_Name, Price*Quantity from product where Product_Name = 'Shampoo'; 

Output –

Product_NoProduct_NamPrice*Quantity45Shampoo6250

Question – Write a Query to display the data whose quantity is equal to 80.

Select * from product;0

Output – 

Product_NoProduct_NamPriceQuantity25Soap4080Database Management System Class 10 Notes

Question – Write a Query to display a list of Products whose Price between 40 to 120.

Select * from product;1

Output – 

Product_NoProduct_NamPriceQuantity25Soap408031Powder803052Soap Box120100

Query related to Select Statement with Order by –

Table Name – product 

Product_NoProduct_NamePriceQuantity25Soap408031Powder803045Shampoo2502552Soap Box120100

Question – Write a Query to display the list of Product_Name in alphabetical order.

Select * from product;2

Or 

Select * from product;3

Output – 

Product_NoProduct_NamPriceQuantity31Powder803045Shampoo2502525Soap408052Soap Box120100Database Management System Class 10 Notes

Question – Write a Query to display the list of Price in ascending order.

Select * from product;4

Or 

Select * from product;5

Output –

Product_NoProduct_NamPriceQuantity25Soap408031Powder803052Soap Box12010045Shampoo25025

Question – Write a Query to display the list of Price in descending order.

Select * from product;6

Output – 

Product_NoProduct_NamPriceQuantity45Shampoo2502552Soap Box12010031Powder803025Soap4080

UPDATE statement 

To edit or update already-existing records in a table, use the UPDATE statement. Using the WHERE clause, you can either define a specific subset of entries to edit or use it to update everything at once. 

Syntax of Update Statement –

Select * from product;7

Table Name – product 

Product_NoProduct_NamePriceQuantity25Soap408031Powder803045Shampoo2502552Soap Box120100Database Management System Class 10 Notes

Question – Write a Query to update the price of Shampoo in the product table.

Select * from product;8

Output – 

Product_NoProduct_NamePriceQuantity25Soap408031Powder803045Shampoo3002552Soap Box120100

Question – Write a Query to update the Quantity of Powder in the product table.

Select * from product;9

Output – 

Product_NoProduct_NamePriceQuantity25Soap408031Powder805045Shampoo2502552Soap Box120100Database Management System Class 10 Notes

Create Table 

To create a new table in the database you can use Create Table Command.

Syntax of Create Table –

Select Product_Name from product;0

Question – Write a Query to create the following table in the database;

Table Name – product

FieldDataTypeProduct_NoIntegerProduct_NameVarchar[20]PriceIntegerQuantityIntegerDatabase Management System Class 10 Notes

Select Product_Name from product;1

Output – 

Product_NoProduct_NamePriceQuantityDatabase Management System Class 10 Notes

Insert Table

Insert statement is primarily used to add a single or more rows to the target table.

Syntax of Insert Table –

Select Product_Name from product;2

Or 

Select Product_Name from product;3

Table Name – product 

Product_NoProduct_NamePriceQuantity25Soap408031Powder803045Shampoo2502552Soap Box120100

Question – Write a Query to add a new row with the following details 

[72, “Hair Conditioner‟, 350, 60]

Select Product_Name from product;4

Or

Select Product_Name from product;5

Output –  

Product_NoProduct_NamePriceQuantity25Soap408031Powder803045Shampoo3002552Soap Box12010072Hair Conditioner35060Database Management System Class 10 Notes

Session 5 : Create Forms and Reports using Wizard

Forms

The Form allows you greater control over your outcomes. The form allows you to customize various parts of the form’s design and then generates a form based on your instructions.

Steps To Create Form Using Wizard

Step 1 : Click Use Wizard to Create Form

Step 2 : Select the selective Fields using Arrow button

Step 3 : Click Next

Step 4 : Add Subform if you need to insert 

Step 5 : Click Next

Step 6 : Arrange selected field in a form

Step 7 : Click Next

Step 8 : Click Finish

Reports 

A report helps in the presentation of data in a summarized format. It is utilized to create a clear format for the entire work product. In the database, you can build reports.

What is database Short answer?

A database is information that is set up for easy access, management and updating. Computer databases typically store aggregations of data records or files that contain information, such as sales transactions, customer data, financials and product information.

What is DBMS it class 10?

A database management system [DBMS] is a computer program designed to manage a large amount of structured data, and run operations on the desired data requested by the users.

Chủ Đề