Ch-3 Relational Database Management System
1. Define the terms
Answer:
• (a) Database - Database is a collection of tables which can store data items in an
organized manner, database can store any type of data including number, characters,
images, audio or video files.
• (b) Data redundancy - Databases have facilities to minimize the same data being stored in
multiple tables within a database it is known as data redundancy.
• (c) Report - Report is a feature of
RDBMS where information can be displayed in the database using a query and these
reports are the formal and in proper layout.
(a) Data and Information - The difference between data and information is that data is raw
fact and it is unprocessed, while information we can receive after processing the data.
• (b) Form and Query - A form is used to insert data in the table using a user-friendly method
but query is used when we want to extract information from the table and this information will
be displayed in the form of a report.
• (c) Network and hierarchical data model - A network data model is
used to link multiple records to the same master file. It is just like an inverted tree structure
where a master will be present on the bottom of the tree and the branches connected to the
master file. But in Hierarchical data model organized into a treelike structure. This data is
stored in the form of records.
3. Give any four advantages of a DBMS.
Answer: The four advantage of a DBMS are -
• Organized Storage - In database data can be stored in an organized
manner, so, the retrieval of the data will be faster.
• Data Analysis - A database helps to analyze the data based on certain criteria.
• Data Sharing - Databases have features to share data to other applications. Databases
also have features for sharing data to multiple users.
• Increase Efficiency - Database tables are properly organized which helps the user to
retrieve, save and search data efficiently.
(a) Data and Information - The difference between data and information is that data is raw
fact and it is unprocessed, while information we can receive after processing the data.
• (b) Form and Query - A form is used to insert data in the table using a user-friendly method
but query is used when we want to extract information from the table and this information will
be displayed in the form of a report.
• (c) Network and hierarchical data model - A network data model is
used to link multiple records to the same master file. It is just like an inverted tree structure
where a master will be present on the bottom of the tree and the branches connected to the
master file. But in Hierarchical data model organized into a treelike structure. This data is
stored in the form of records.
3. Give any four advantages of a DBMS.
Answer: The four advantage of a DBMS are -
• Organized Storage - In database data can be stored in an organized
manner, so, the retrieval of the data will be faster.
• Data Analysis - A database helps to analyze the data based on certain criteria.
• Data Sharing - Databases have features to share data to other applications. Databases
also have features for sharing data to multiple users.
• Increase Efficiency - Database tables are properly organized which helps the user to
retrieve, save and search data efficiently.
4. 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_ld 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 include 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 which 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 as a primary key.
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
Book_Id field is defined as a primary key then in another table Book_Id should be foreign
key, now you can create the relation between one to many.
Differentiate between:
Answer:
(a) Memo and Varchar data type - Memo, Varchar and Char belong to text data type, memo
can store descriptive data more than 255 characters. Varchar stores up to the specified
length, the number of length depends on the number of characters entered by the user.
(b) Number and Decimal data type - Number and decimal both come under
Numeric Data type, number data type can contain numbers and decimal data type is used to
store decimal values.
(c) Design View and Datasheet view of a table - In LibreOffice base, design view is used to
create, modify or delete the structure of the table and the datasheet view displays the actual
data within a table in the form of row and column
Name the menu items present on the Base User Interface.
Answer: In LibreOffice base menu bar display below the title bar. It consists of seven
different types of menu items - File, Edit, View, Insert, Tools, Window and Help.
All menu items contain commands which help to perform various tasks on the database.
3. Label the components - Title Bar, Database Pane, Tasks Pane, Status Bar of the
LibreOffice Base User Interface.
Answer: The components of the LibreOffice Base User Interface are -
• Title Bar - Located on the top of the LibreOffice Base window, it displays the name of the
database file and application name.
• Database Pane - Database pane displays the left side of the interface, it shows Table,
Queries, Forms and Reports. It also allows you to navigate between the components of the
database.
• Tasks Pane - Tasks pane found in the center of the window displays the options related to
tasks or you can use selected database objects (like Table, Query, Form and Report).
• Status Bar — Located at the bottom of the window, It provides information about the
current status of the database.
4. How can we define a primary key in a table?
Answer: To define a primary key in LibreOffice Base the steps are -
• Step 1: Open the design view
• Step 2: Select the column
• Step 3: Click on check the "Primary key" checkbox in the properties panel
6. What is the use of a navigation box with respect to tables in a database?
Answer: The navigation box present at the bottom of the datasheet window is used to
navigate various records in the table. There are various components of Navigation Box are
as follows -
• Record Selector Box — It shows the current active record number.
• Navigation Buttons - These are used to scroll vertically in the table.
1. Give any two advantages of relating a table in a database.
Answer: The two advantages of relating a table in database are -
• Data Integrity: Data Integrity ensures that data remains consistent across the database and
ensures that records in the master table will correspond to the correct transaction table.
• Reduced Data Redundancy:
Using relationships, the data duplication will be not allowed across tables.
2. How is redundancy or inconsistency controlled in a database? Explain with an example.
Answer: The redundancy or inconsistency controlled in a database using a process called
relationship, relationship is a method where we can store data in an organized manner. In
this method a large table is divided into two or more small tables which helps to control
redundancy and inconsistency in the database.
3. Define referential integrity. Who maintains referential integrity in a database?
Answer: Referential integrity is a concept in relational databases that ensures the
consistency and accuracy of relationships between tables. According to the rule of referential
integrity is there will be no unmatched foreign key values should exist in the database. The
database manager maintains referential integrity in a database.
4. Differentiate between one to one relationship and one to many relationship. Give suitable
examples to explain your answer.
Answer: In one-to-one relationship each record in the master table will be linked to exactly
one record in another table. For example, one aadhar number in the master table will be
linked to only one person in another table.
One-to-many relationship is the most common relationship between the tables, in this
relationship each record in the master table will be linked to multiple records in another table.
For example, one record in the customer table will be linked to orders table which is another
table in a database.
5. Explain many to many relationships with an example.
Answer: In many-to-many relationship, each record in one table can be linked to multiple
records in another table, this type of relationship allows records from both tables. For
example, if there are two tables, one is student information and second is course details. A
student can enroll many courses and each course can have many students, here, the
relationship between two table will be many-to-many relationship.
1. Define a query? What is the need of creating a query in a database?
Answer: Query is the most important feature of a database which is used to retrieve the data
easily and accurately from the database. Query helps to perform various operations such as
inserting records, updating records, searching records or deleting records from the database
table.
The need of creating a query in database are -
• Data Retrieval: Queries help to retrieve the data based on the
condition.
• Data Analysis: Queries help toComplex Reports: Queries help to create complex reports or
summaries the data in a structured manner.
• Data Manipulation: Queries used to insert, update or delete the data from the database.
• Data Filtration: Queries help to filter large data to retrieve only the relevant information.
2. Rearrange the steps given below so as to create a query using a wizard.
• Give Alias
• Select the fields
• Set the criterion
• Set the sorting order
• Give table name
Answer: The steps to rearranging the sequence of query using a wizard are -
• Step 1: Give table name - Start by selecting the table from which data will be retrieved.
• Step 2: Select the fields - Choose which fields from the table.
• Step 3: Give Alias - Assign aliases to the fields for more user-friendly labels in the query
result.
• Step 4: Set the sorting order -
Define how the results will be sorted (ascending or descending).
• Step 5: Set the criterion - Establish any conditions or filters for the data (e.g., "age > 30").
3. What information is seen in the overview (last step) of the Query wizard?
Answer: The overview of the Query
Wizard are -
• The selected fields
• Sorting order
• Any criteria that have been set
• Aliases used fo fields
• The SQL code generated based on the inputs in the wizard
4. What is the use of Alias row in the Design grid of the Query Design window?
Answer: The alias row in the design grid allows us to -
• The alternate name for a given field
• Alias provide custom labels for the query output
5. Name any four mathematical functions that can be applied to numerical data in a query.
Answer: The four mathematical functions that can be applied to numerical data are average,
sum, maximum and minimum.
6. Name the three ways of creating a query in LibreOffice Base?
Answer: The three ways to creating a query in LibreOffice Base are -
• Using Query Wizard - Step by step guide for creating query in database.
• Design view — A graphical interface for creating query manually.
• SQL view - You can write SQL commands directly in the SQL view.
1. Give one difference between a form and a report.
Answer: Form can be used for collecting input data from the users based on visual
representation, but report is used to generate the information of the table basically display in
form of column and
rows.
2. What is a field control with respect to forms?
Answer: Field control is an element in a form used to interact with the user, form control
used to collect the data, edit the data and view the data within the form using user-friendly
methods for example text box, label, combo box, list box etc.
3. Which tool on the Forms Record toolbar is used to insert text on the form?
Answer: The forms control toolbar contains various tools to add or edit controls on the form,
sometimes we need to enter titles, headings or subheadings in the form you can do with
using labels.
4. Name the two ways to create a form in LibreOffice Base.
Answer: There are two ways to create a form in LibreOffice Base.
• Using a wizard
• Using the design view
5. What is the difference between a static and a dynamic report?
Answer: In LibreOffice Base by default report is dynamic report, dynamic report means that
the field values in the base table or query change, the report will also change automatically.
In Static report the automatic updation is not allowed in the report.
6. Write the function of Forms Controls toolbar and Records toolbar.
Answer: The function of Forms Controls toolbar and Records toolbar are -
• Form Controls toolbar - This
toolbar provides elements which you can use in a form, for example text box, label, combo
box, list box etc.
• Record toolbar - This toolbar offers tools for navigation that is also used to navigate from
one record to another record or you can
use the control like adding new record, saving record and deleting record from the database
table.