Solved Back Exercise Unit 3
Solved Back Exercise Unit 3
Solved Back Exercise Unit 3
4. Consider the table given below and answer the questions that follow.
Table: Library
Book_Id Book Name Author Name Price Publisher
F001 Pride and Prejudice Jane Austen 550 ABC
S004 Amazing Astronomy E. Shane 1050 ABC
C005 IT and Mankind MHA Diwaan 2500 HYM
(a) Name the fields in the given table.
Book_Id, Book Name, Author Name, Price, Publisher
(b) Which field should be made the primary key?
Book_ID
(c) Is there any alternate key in the table?
NO
(d) How is primary key different from foreign key? Explain with example.
Primary Key – A primary key or simply a key is a field that uniquely identifies
a row in a table. The key identifier can be the value of a single column or of
multiple columns. The primary key is a unique identifier for the table.
Foreign Key – If a field or a combination of fields of one table can be used to
uniquely identify records of another table, then that particular field is known as the
foreign key. This foreign key helps to build a relation between two tables.
• Numeric Data Type – Numeric data types consists of numbers. The numbers can be
integer or real numbers on which any type of arithmetic calculations can be
performed. For example, 10,
-34.8, 90.6789 , -86 are of numeric data type. Table 9.2 lists different numeric data
types along with the number of bits/bytes it uses and its range.
• Boolean – In 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 used to store digitized images and sounds that comes as
long string of zeros and ones. It is possible to store photos of the products or employees,
or sound snippets or voice messages in Base database.
Summary
• Base is a free and open source database component of LibreOffice suit.
• It can be downloaded from www.libreoffice.org
• A data type refers to the type of data that will be stored in that particular field.
• Various in Base can be categorized into Text , Numeric, Currency and Date.
• LibreOffice Base is the collection of related data objects known as Tables, Forms,
Queries, Reports and application modules.
• Depending on the object that is selected, the respective Task Pane and Object Area
displaying the created object appears on the User Interface Window.
• A table in LibreOffice Base can be created using a wizard or using the Design view.
A. Multiple choice questions
1. Which of the following is NOT a type of text data type?
(a) Memo
(b) Varchar
(c) Float
(d) Char
2. A currency data type can only store monetary data that is in dollars.
(a) True
(b) False
(c) Neither a nor b
(d) Both a and b
3. Which of the following data can a date data type store?
(a) Date
(b) Time
(c) Both date and time
(d) Neither date nor time
4. Which of the following is true about LibreOffice Base?
(a) It is a spreadsheet software
(b) It is free and open source software
(c) It can store only character data
(d) It is a licensed software.
5. Which of the following methods can be used to create a table in Base?
(a) Using a table wizard
(b) Design View
(c) Both a and b
(d) Neither a nor b
6. The related objects of a database can be seen in ____________pane of the Base
Database window.
(a) Database
(b) Task
(c) Title Bar
(d) Menu Bar
7. Which is the shortcut key to open an existing database?
(a) Ctrl+ D
(b) Ctrl+O
(c) Ctrl+E
(d) Ctrl+F
8. The Design view of Table Creation window in LibreOffice Base is divided into
sections or panes.
(a) 2
(b) 3
(c) 4
(d) 5
9. While entering records in a table, we can move to the next field by pressing
the________ key.
(a) Tab
(b) Ctrl
(c) Enter
(d) Shift
10. Which of the following is true about primary key of a table?
(a) Every table must have a primary key
(b) The data values in primary key field cannot be duplicated.
c) A primary key field cannot be left blank
d) All of the above
3. Label the components – Title Bar, Database Pane, Tasks Pane, Status Bar
of the LibreOffice Base User Interface.
Title Bar
Tasks Pane
Database Pane
Status Bar
SUMMARY
• Relations are set up between the tables to control data redundancy and inconsistency.
• The most important prerequisite for setting a relationship between the two tables is that
there must be a common field(s) between the two tables.
• Three types of relationships can be set up between two tables in a relational database.
These are One-to-One, One-to-Many and Many-to-Many.
• In One-to-One type of relationship, one specific record of a master table has one and only
one corresponding record in the transaction table.
• In One-to-Many type of relationship, one specific record of the master table has
more than one corresponding records in the related transaction table.
• In Many-to-Many type of relationship, there are multiple records in the master
table that correspond to multiple records in the transaction table.
• According to the principle of referential integrity, no unmatched foreign key values
should exist in the database
A. Multiple choice questions
1. Which of the following actions can be performed once the tables are created in a
database?
(a) Add a field in a table
(b) Rename a table
(c) Delete a table
(d) All of the above
2. Which of the following is checked by a DBMS?
(a) Redundancy
(b) Inconsistency
(c) Both (a) and (b)
(d) Neither (a) nor (b)
3. Which of the following is required to set a relationship between the two tables?
(a) Both the tables must be in different databases
(b) Both the tables must have a common field
(c) Both the tables must have the same name
(d) Both tables must be stored in documents folder only.
4. If a record is added in a master table, which of the following is NOT true for
transaction table
(a) The record in the master table is called the master record
(b) The corresponding record in transaction table can only be entered once.
(c) The record in the transaction table is called the transaction record.
(d) It is possible to add a record in the master table
5. Which type of relationship exists between a student and the subjects studied by
him/her?
(a) One-to-one
(b) One-to-many
(c) Many-to-many
(d) All of the above
6. Consider the following tables. Which type of relationship can be established
between the two tables?
(a) One-to-one
(b) One-to-many
(c) Many-to-many
(d) None of the above
Table 1: Item Table 2: Item_Category
Item_Code Category_Code
Item_Name Cat_Name
Price Item_Code
Qty Cat_Disc
Category_Code
4. Differentiate between one to one relationship and one to many relationship. Give
suitable examples to explain your answer.
One-to-One relationship
In this type of relationship, one specific record of a master table has one and only one
corresponding record in the transaction table. For example, the record for Admission_No
in the master table of student will have only one corresponding record of same value of
Admission No in the transaction table of Student. This is because no two students will be
given same admission number. So relationship between Student and Admission number
will be one-to-one relationship.
One-to-Many relationship
In this type of relationship, one specific record of the master table has more than one
corresponding records in the related transaction table. For example, one teacher can teach
multiple students or multiple classes. So we can say that there is a one to may relationship
between a teacher and class or teacher and student.
8. In a Query Design wizard, which of the following buttons is clicked to move a field
from ‘Available fields’ list box to ‘Fields in the query‘ list box?
(a) >
(b) < 9
(c)
(d)
9. Which of the following relational operators can be applied to set the criterion while
designing a query in LibreOffice Base?
(a) >
(b) =
(c) !=
(d) Add Form
10. Which of the following dialog box is present when the Query Design window is
opened for the first time to design a query?
(a) Add Table
(b) Add Query
(c) Add Table or Query
(d) None of the above
11. Which of the following step is not performed if there is no numerical data to be
worked upon in a query?
(a) Selection of fields
(b) Giving Aliases
(c) Summarizing
(d) Selection of tables
3. What all information is seen in the overview (last step) of the Query wizard?
It includes the following:
• Name of the Query – By default, the name of the query is Query_Events. If
desired, type the new name in the text box.
• The action to be performed after the wizard finishes – By default Display
Query option will be selected. Click and select the Modify Query radio button if
the query has to be edited in the Design view.
• Complete detail of the query – This section contains a summary about the query
that has been created
4. What is the use of Alias row in the Design grid of the Query Design window?
It can be used to display meaningful names in the output. For example, instead of
Winner, we would just like to display Winner Name. For this, type Winner Name
in the Alias text box under Winner column.
5. Name any four mathematical functions that can be applied to numerical data
in a query.
Count, Sum, Average, Minimum and Maximum.
3. Which tool on the Forms Record toolbar is used to insert text on the form?
Label tool on the Forms Record toolbar is used to insert text on the form
This toolbar contains various controls that can be added to the form. An element that can
be part of a form. For example: checkbox, option button, input field etc