0% found this document useful (0 votes)
22 views30 pages

Database Management System (1)

The document provides an overview of Database Management Systems (DBMS), detailing the importance of data storage, management, and retrieval. It explains various data models, types of relationships between tables, and the significance of keys in relational databases. Additionally, it covers the use of LibreOffice Base for creating and managing databases, including data types, table creation, and querying techniques.

Uploaded by

dsehgal909
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
22 views30 pages

Database Management System (1)

The document provides an overview of Database Management Systems (DBMS), detailing the importance of data storage, management, and retrieval. It explains various data models, types of relationships between tables, and the significance of keys in relational databases. Additionally, it covers the use of LibreOffice Base for creating and managing databases, including data types, table creation, and querying techniques.

Uploaded by

dsehgal909
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 30

Database Management

System
Shikha Shokeen

Data is most important for any organization or in a company, the


organization’s primary objective is to store data, manage data and
retrieve data from computers and this is only possible with database
management systems.

Chapter 8: Introduction of Database


Management System
A database is an organized collection of data that is maintained
electronically. Any kind of data like text, numbers, pictures, videos and
files can be stored in a database. This data can be stored, retrieved and
edited using software known as a database management system.
Shikha Shokeen
Data and Information

• 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 organized and
structured data.

Databases and DBMS

• Database – A database is a collection of logically related data items


stored in an organized manner, It is also considered as a data
bank.
• DBMS (Database Management System) – This software that is
used to create, update and retrieve data is known as database
management system. Some of the common examples of DBMS are
LibreOffice Base, MS Access, Open Office Base, Oracle, MySQL.

Advantages of DBMS

• 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 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 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.
• Increase Efficiency – In the database the data is organized which
helps to retrieve and search data efficiently.
• Increases Accuracy – In the database the data is retrieved
accurately from the database.
• Increases Validity – In the database the valid data is being
entered and checked by the database.
• Security – Unauthorized access is not allowed in the database.
Shikha Shokeen
Data Models

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.

There are different data models such as –

• Hierarchical data model


• Network data model
• Relational data model
Hierarchical Data Model

In Hierarchical Data Model the data is organized like tree structure and
data is stored in the form of a table.

Network Data Model

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.
Relational Data Model

In relational data models are based on relationships between two or


more tables of the same database. This is the most popular data model.

Shikha Shokeen
Relational Database Model

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 elements are stored in different
tables, this table is related through the common fields.

Relational Database Terminology

Some of the common terms used in RDBMS.

• 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
organized 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 which uniquely identifies a row in a table.
The primary key used to be a unique identifier for the table. To create
• Relational Database – A relational database is a collection of connection
related tables. * blu two
• Foreign Key – The field or a combination of fields of one table can
be used to uniquely identify records of another table, then that tables , 2
particular field is known as the foreign key. the PK
• Candidate Key – All the field values that are eligible to be the match
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 are the alternate key.

Shikha Shokeen
Objects of an RDBMS

The database is a collection of object or a feature that is used to store,


represent or retrieve data, different types of objects in a database are
given below –

• 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 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.
• 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.
Chapter 9: Starting with LibreOffice Base
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 –

• TextData Types
• Numeric Data Type
• Currency Data Type
• Date Data Type
• Boolean Data Type
Shikha Shokeen
• Binary Data Type

Text Data Types

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.

The lists of various data types that can store textual data –

Name Data Type Description


Memo data type allows to store text data up to
Memo LONGVARCHAR
64000 characters.
Character data type is used to enter fixed number of
characters
Text(fix) CHAR
for example AADHAR NO, ACCOUNT NO, PASSPORT
NO etc.
Stores upto the specified length, the number of bytes
allocated
Text VARCHAR
depends on the number of characters entered by the
user.
Shikha Shokeen

Numeric Data Type

Numeric Data type contains numbers. The number can be integer, real,
float or double.

1.
Name Data type Signed Range
Tiny Integer TYNYINT No 0-255
Small Integer SMALLINT Yes -32768 to 32768
Integer INTEGER Yes -2.14×109 to 2.14×109
BigInt BIGINT Yes -2.3×1018 to 2.3×1018
Number NUMERIC Yes Unlimited
Decimal DECIMAL Yes Unlimited
Float FLOAT Yes
Real REAL Yes 5×10(-324) to 1.79×10(308)
Double DOUBLE Yes

List of different numeric data types are –

Currency Data Type

Currency Data type contains monetary values and can store currencies
of different countries.

Date Data Type

This data type is basically used for date and time. There are various
formats used to store date and time.

List of various forms of date data types are –

Name Description
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.
Timestamp Stores date and time information at once.
Boolean

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

The binary datatype is used to store digital images and sounds.

Starting with LibreOffice Base

LibreOffice base is a database management software belonging to


LibreOffice suite, It is free and open source software for creating and
managing data. It also allows you to create a query for retrieving desired
results from the database.

Steps for starting LibreOffice Base –

• Step 1: Click on Start > LibreOffice base


• 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

Creating a Table

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 –

1. Create Table using design View


2. Create Table using a Wizard
Shikha Shokeen
Creating Table in Design View

• Step 1: Click on Table


• Step 2: Click on Create Table in Design View
• Step 3: Enter Field Name, Field Type and Description
• Step 4: Click on Save

Steps for Creating Table using a Wizard

• Step 1: Click on Table


• Step 2: Click on Use Wizard to Create Table
• Step 3: Select the field which you want
• Step 4: Click on Finish
Chapter 10: Working with Multiple Tables
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.

Master table vs Transaction table

If the School wants to manage student fees collection in a database, then


they will create two tables, one for Student Details and second for Free
M
details, here the Student Details will be master table and Fee details will
be transaction table.

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 improve table structures and reduce
redundancy of the data.

Types of Relationships

The relationships between two or more tables in a database is based on


the number of records, Primarily there are three different types of
relationships that can be set up between two or more tables.

1. One-to-One
2. One-to-many
3. Many-to-Many Shikha Shokeen
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 table has multiple records.

Advantages of Relating Tables in a Database

1. A relationship helps to prevent data redundancy.


2. Relationships between tables help to restrict from entering invalid
data in the 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.

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).
primary key is a field 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 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.

LibreOffice Base gives us following four options to maintain


referential integrity –
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 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 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.

Chapter 11: Queries in Base


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.

Query

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 criteria to the DBMS.

A query can be created in three ways –

1. Using a Wizard
2. In Design View
3. In SQL view Shikha Shokeen
Database Languages

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.

Select Statement

Select statement is most important for retrieving and for displaying data
from a database.

Syntax of Select Statement is – Shikha Shokeen


SELECT * FROM <TABLENAME>;

The SELECT statement has many optional clauses:

• WHERE specifies which rows to retrieve.


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

Question 1 – Write a Query to display all record from the


table;

Table Name – product

Product_No Product_Name Price Quantity


25 Soap 40 80
31 Powder 80 30
45 Shampoo 250 25
52 Soap Box 120 100
Answer: Select * from product;

Question 2 – Write a Query to display product name from the


table;

Answer: Select Product_Name from product;

Question 3 – Write a Query to display Product_Name and


Price from the table;

Answer: Select Product_Name, Price from product;


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

Answer: Select sum(quantity) from product;

Question 5- Display the total amount of each item. The


amount must be calculated as the price multiplied by
quantity for each item.

Answer: Select Product_No, Product_Name, Price * Quantity from


product;

Question 6- Write a Query to display the product whose


price is less than 90

-
Answer: Select * from product where price < 90;

Question 7- Write a Query to find the total amount of the


Shampoo product;

Answer: Select Price*Quantity from product where Product_Name =


‘Shampoo’;
-
Question 8- Write a Query to display the data whose
quantity is equal to 80.

Answer: Select * from product where quantity = 80;

Question 9- Write a Query to display a list of Products


whose Price between 40 to 120.

Answer: Select * from product where Price >= 40 and Price <= 120;

Question 10- Write a Query to display the list of


Product_Name in alphabetical order.

Answer: Select * from product order by Product_Name ASC;

Question 11- Write a Query to display the list of Price in


descending order.

Answer: Select * from product order by Price DESC;

UPDATE statement
Update statement is used to update existing records present in database.
The updated statement will apply using WHERE clause.

Syntax of Update Statement –

UPDATE <table name> SET = value [, column_name = value ...] [WHERE ];

Table Name – product

Product_No Product_Name Price Quantity


25 Soap 40 80
31 Powder 80 30
45 Shampoo 250 25
52 Soap Box 120 100
Question – Write a Query to update the price of Shampoo
in the product table.

-
Answer: Update product Set Price = 300 where Price = 250;

Question – Write a Query to update the Quantity of


Powder in the product table.

Answer: Update product Set Quantity = 50 where Product_Name =


‘Powder’;
-
Chapter 12: Forms and Reports
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.

There are two ways to create a form:

1. Using a wizard
2. Using the Design View
Creating a Form Using a Wizard

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.
• Step 1: Open Database
• Step 2: Click on Use Wizard to Create Form
• Step 3: Select the fields of your form
• Step 4: Decide if you want to set up a subform
• Step 5: Arrange the controls on your form Shikha Shokeen
• Step 6: Select the data entry mode
• Step 7: Apply Style
• Step 8: Set the name of the form
• Step 9: Click on Finish
Forms Control Toolbar – This toolbar contains various controls that
can be added to the form.

Records Toolbar – The Records toolbar contains the navigation


control buttons in the extreme left.

Creating Reports using wizard

You can create report from the Report using a wizard. To create a
report, follow the following steps –

• Step 1: Open Database


• Step 2: Click on Use Wizard to Create Report
• Step 3: Select, Which fields do you want to have in your report
• Step 4: Enter, How do you want to label the field
• Step 5: Add grouping levels in the Report Wizard
• Step 6: Select sort option according to the data
• Step 7: How do you want your report to look
• Step 8: Describe how you want to processed
• Step 9: Click on Finish

Reference : -
https://cbseskilleducation.com/database-
management-system-class-10-notes/
Shikha Shokeen

Unit 3: Database Management System using LibreOffice


Base

Chapter 8 Introduction to Database Management System

1. What is a difference between data and information?

Answer –

Data – The raw facts constitute data. The facts may be related to
any person, place, activity, or thing. It may be stored in the form
of text, graphics, audio, or video.

Information – Information is the processed or organized form


of data. If the data is not correct or accurate, the information
obtained by processing such data may not be correct. For
example, marks obtained by students and their roll numbers are
the data, while the report card/sheet is the information.

2. What is a database?

Answer – A database is an organized collection of data.


Databases can store, retrieve, and manage large amounts of data.
The database stores the information in the form of a table.

3. What is a database management system?

Answer – A database management system (DBMS) is a


software package which manages and maintains data in a
database. A DBMS enables several user application programs to
access the same database at the same time. It enables
organizations to easily create databases for a variety of
purposes. A database is a comprehensive collection of data
records, files, and other items.
4. How is data organized in a database?

Answer – There are two way to organized data in database –

• Flat File – It stores the data in a single table, and it is


suitable for small amounts of data.
• Relational – It stores the data in multiple tables, and all the
tables are connected to each other using a common field
with the help of relationships.
5. What is a data module in a database? What are the
different types?

Answer – A database can be designed in different ways


depending on what is being stored. This structure of database is
known as a data model. The different data modules in the
database are –

Hierarchical Data Model – In a hierarchical data model, the


data is organized into a tree-like structure. The data is stored in
the form of records. All these records are linked to each other at
various levels.

Shikha Shokeen

Network Data Model – In the Network Data Model, multiple


records are linked to the same master file. It is also considered
an inverted tree where the master is present at the bottom of the
tree and the branches contain information linked to the master.
Relational Data Model – This data model is based on the
principle of setting relationships between two or more tables of
the same database. It is the most commonly used database
model.
Shikha Shokeen
6. What is an entity in a database?

Answer – Entity is a real-world object about which information


is to be stored in a database. Each entity is a collection of
attributes. For example, if you want to store student information
in a table, then the table heading is attributes, and the student’s
single record is an entity.

7. What is a table in a database?

Answer – A table is a collection of logically related records. It


is organized as a set of columns and can have any number of
rows.

8. What different types of keys are available in RDBMS?

Answer – The different keys available in RDBMS are –

• Primary Key (PK) – A primary key is a unique value that


identifies a row in a table. If the primary key is defined for
any table column, it means the duplication will not be
allowed.
• Candidate Key (CK) – All the field values that are eligible
to be the primary key are the candidate keys for that table.
Such fields can neither be left blank nor can have duplicate
values.
• Alternate Key (AK) – In the table when one or two are
made as primary keys. The others are the alternate keys.
• Foreign Key (FK) – By default, columns are foreign keys;
foreign keys point to the primary key of another table.
9. What is RDBMS?

Answer – RDBMS stands for Relational Database Management


System, which is an upgraded version of DBMS. RDBMS stores
the data in the form of a table. In RDBMS multiple tables can be
linked together, and support multiple users to access the
database.

10. What is an object in a database?

Answer – An object in a database is a structure or a feature that


is used to store, represent, or retrieve data. In fact, a database is
a collection of objects. Various objects in a database are –

• Table
• Form
• Queries
Shikha Shokeen
• Report
11. Give the advantages of a database.

Answer – Advantages of database are –

• Reduce Data Redundancy – When the same data set is


stored in two or more locations, this is referred to as data
redundancy. As a result, this helps in the protection of
duplicate data in a database.
• Sharing of Data – Databases can share the data with
multiple users at a time. There are multiple levels of
authorization to access the data, and as a result, the data can
only be shared with those who are permitted.
• Data Integrity – The term “data integrity” refers to the
accuracy and consistency of the data in the database. Data
integrity also refers to data safety.
• Data Security – You know that data is very important;
databases give privileges to authorized users and allow
them to access the database using a username and
password.
• Privacy – A database’s privacy rule says that only authorized

-
users are permitted to access the database. For example, if
you log in to your Gmail account, then you will see your
email only; you will not see any other account email.

-
• Backup and Recovery – Backup and recovery are handled
automatically by the database management system.
• Data Consistency – Data consistency ensures the
modification in the data will be the same for all the users
who are accessing the database. For example, if you have a
registered recovery backup ticket from the IRCTC website,
then whatever changes are there, it will be the same for all
the users who are trying to reserve the ticket.
Chapter 9: Starting with LibreOffice Base

12. What is data type in database?

Answer – Data types are used to define the type of data that will
be stored in the database. Data types in the LibreOffice base are
classified into six types.

a. Text Data Type – The text data is a combination of letters,


numbers, or special characters. No arithmetic calculations can
be performed on text data. Text data type categorized into three
types –

• LONGVARCHAR – It is also known as the memo data


type. The memo data type allows to store text data up to
64,000 characters.
• CHAR – Character data type is used to enter a fixed number
of characters. It can be used for license numbers and
passport numbers, as they have a fixed number of
characters.
• VARCHAR – The number of bytes allocated depends on the
number of characters entered by the user. For example, the
address is defined as varchar (50), and if the address
entered by the user is 20 characters, then only 20 bytes will
be occupied in the database.
b. Numeric Data Type – Numeric data types consist of
numbers. The numbers can be integers or real numbers on which
any type of arithmetic calculations can be performed.

• TYNYINT
• SMALLINT
• INTEGER
• BIGINT Shikha Shokeen
• NUMERIC
• DECIMAL
• FLOAT
• REAL
• DOUBLE
c. Currency Data Type – The currency data type indicates the
monetary values and can be stored using currencies of various
countries. For example, $100, £500, or Rs. 25.50.

d. Date Data Type – This data type is used to indicate dates and
time. The date and time can be stored in various formats.

• 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.
• Timestamp – Stores date and time information at once.
Boolean – In the boolean data type, there can be only two
values: true or false. This also can be given
in multiple formats like Yes/No, True/False, On/Off.
Binary – The binary data type is used to store digitized images
and sounds that come as long strings of zeros and ones.

13. What are the ways to create a table in LibreOffice Base?

Answer – There are two different ways to create the table in the
database:

• Using Design View


Shikha Shokeen
• Using Wizard
14. What is the navigation box in LibreOffice Base?

Answer – The navigation box helps the records to navigate from


one record to another record. The various components of the
navigation box are as follows:

•Record Selector Box – This is the text box where the


currently active record number is displayed.
• Navigation Buttons – These are used to scroll vertically in
the table.
Chapter 10: Working with Mutliple Tables

15. What is a relationship in a database management


system?

Answer – Relationship is a logical connection between two or


more tables, relationship helps to check redundancy and
inconsistency of data.

16. What is the advantage of relationships between two


tables?

Answer – Advantage of relationships between two tables are –

• Save time, as there is no need to enter the same data in


separate tables.
• Reduce data-entry errors.
• Summarize data from related tables.
17. What is the file extension of LibreOffice Base?
Answer – File extension for LibreOffice base is .odb.

18. How many types of relationships can be created in


LibreOffice Base?

Answer – There are three types of relationships –


-
• One to One – Both tables in this relationship must have
primary key columns.
• One to Many or Many to One – One of the tables in this
-
relationship must have a primary key column.
• Many to Many – The primary key column is not present in
any of the tables in this relationship.
19. What is the difference between a transaction table and a
master table in a database?

Answer – If the School wants to manage student fees collection


in a database, then school will create two tables, one for student
details and the second for fee details; here the student details
will be the master table, and fee details will be the transaction
table.

20. What are the advantages of relationship in a database?

Answer – There are various advantages of relationship tables in


a database. Few of them are as given below.

• A relationship can help prevent data redundancy.


• It helps prevent missing data by keeping deleted data in a
database.
• Creating relationships between tables, which helps to enter
invalid data in the database.
• Any update in the master table is automatically reflected in
the transaction tables.
21. Explain referential integrity with the help of an example.

Answer – Referential integrity is used to keep data maintained,


accurate, and consistent. Data in a base can be connected
between two or more tables using primary key and foreign key
constraints. For example, suppose there are two tables,
“Student_details” and “fee_details.” In the student_details
table, the fields are Grno, Student_name, Address, and
phone_number (here Grno is the primary key). In the
Fee_details table, fields are
Grno, Fee_date, Amount (here Grno is a foreign key) Here,
both have a common field “Grno.” This is known as
referential Integrity.

22. What is referential integrity?


Shikha Shokeen
Answer – Referential integrity is used to keep data maintained,
accurate, and consistent. Data in a base can be connected
between two or more tables using primary key and foreign key
constraints.

Referential integrity helps to –

• If there is no connected record in the main key table, records


are added to a related table.
• Changing values in a primary if there are any dependent
records in the linked table
• If there are any matching linked records in an associated
table, records from a primary key table are deleted.
23. Which option is used to maintain referential integrity?

Answer – LibreOffice Base gives us following four options to


maintain referential integrity.

• No action – This is the default option. This option states that


a user should not be allowed to update or delete any record
in the master table if any related record exists in the
transaction table.
• Update cascade – This option allows the user to delete or
update the referenced field, but along with it, all the related
records in any of the transaction tables will also be deleted
or updated.
•Set NULL – This option assigns a NULL value to all the
related fields if the master record is deleted or updated.
• Set default – This option assigns any fixed default value to
all the related fields if the master record is deleted or
updated.
Chapter 11: Queries in Base

24. What is a query in a database?

Answer – Queries help to retrieve and display data from one or


more tables in a database. This is done by giving specific search
criteria to the DBMS so that we are able to view the exact
information that we want.

25. What are the different ways to create queries in


LibreOffice Base?

Answer – A query can be created in three ways.

Using a Wizard

• In Design View
Shikha Shokeen
• In SQL view
26. Consider the table given below and answer the questions
that follow

(a) Name the fields in the given table.

Answer: The fields name of the table is Book_Id, Book Name,


Author Name, Price, Publisher

(b) Which field should be made the primary key?

Answer: Book_Id should be made the primary key because


Book_Id uniquely identifies each record.
(c) Is there any alternate key in the table?

Answer: The alternate key could uniquely identify records, but


it is not chosen as primary key, So, Book Name can be
considered as alternate key if it uniquely identifies each book.

(d) How is the primary key different from foreign key?


Explain with examples.

Answer: A primary key is a field in a table that uniquely


identifies each record in the table. It means that duplication and
null will not be allowed in the table. For example, Book_Id can
be considered a primary key.

A foreign key is a key of another table that refers to the primary


key from the first table. Foreign keys are helpful to create a
relation between two tables. Example: If in the first table, the
Book_Id field is defined as a primary key, then in another table,
the Book_Id field will be a foreign key.

27. Write the SQL commands to answer the queries based on


Fabric table

FabricI Fnam Dis


Type
D e c
Shikha Shokeen
F001 Shirt Woolen 10

F002 Suit Cotton 20

F003 Tunic Cotton 10

F004 Jeans Denim 5

a. Write a query for insert the following record (“F005”,


“Kurta”, “Woollen”,5)

Answer – insert into Fabric values (‘F005’, ‘Kurta’,


‘Woolen’,5);

b. Write a query to display only those fabric whose disc is


more than 10

Answer – select * from Fabric where Disc>10;

c. To display those record whose type is ‘Woolen’

Answer – select * from Fabric where type = ‘Woolen’;

d. To modify the fabric shirt by increasing discount by 10

Answer – update fabric set Disc = Disc + 10 where Fname =


‘Shirt’;

e. To delete the record of fabric F003 from table

Answer – delete from Fabric where FabricID =‘F003’;

Chapter 12: Forms and Reports


Shikha Shokeen
28. What is a form in a database?

Answer – A form is an object of the database that has a user-


friendly interface where data can be entered and seen in an
attractive and easy-to-read format. This form is also known as a
front-end application where the user can enter the data.

29. How many ways are there to create a form in LibreOffice


base?

Answer – There are two ways to create a form:

•Using a wizard
•Using the Design View
30. What is the Forms Control Toolbar in LibreOffice Base?

Answer – This toolbar contains various controls that are related


to the form. Some of the uses of the forms control toolbar are:
• Adding a calendar for the date field
• Adding text to the form
• Adding a new record using a form
31. What is the Records Toolbar in LibreOffice Base?

Answer – The Records toolbar contains the navigation control


buttons in the extreme left. With the help of these buttons, we
can traverse and view the records in the file. As we move from
one record to another.

32. What is a tooltip in LibreOffice Base?

Answer – A tooltip is a small piece of text that is displayed


when the mouse pointer is placed on a particular control. For
example, if the mouse pointer is placed over the EventID text
box, a message ‘Enter Event Identification number’ can be
displayed.

33. What do you mean by report?


Shikha Shokeen
Answer – Report helps to present the retrieved data in an
attractive and customized manner. We can create a report based
on a table or a query or both.

34. What are the different types of reports in LibreOffice


Base?

Answer – There are two types of reports in LibreOffice base –

• Dynamic Report – By default, the type of report is dynamic.


That means as the field values in the base table or query
change, the report will also change automatically.
• Static Report – A static report is used when we don’t want
automatic updates.
35. Differentiate between Forms and Reports.

Answer –

Form
•Forms are used to store the data in a semantic way.
• Edit, delete, & modify can be easily managed.
• Auto calculation can be done easily.
Report

• Report displays the data in the presenting format


• The report can display all the records from the table.
• Edit, delete, & modification cannot be done through report
• You can take a printout with the help of the report.

Reference : -

https://cbseskilleducation.com/database-management-system-
class-10-questions-and-answers/

You might also like