The document provides a comprehensive overview of database management systems, covering topics such as creating and editing tables, types of keys, relationships between tables, and the use of queries, forms, and reports. It includes multiple choice questions, fill-in-the-blanks, true/false statements, and short and long answer questions to assess understanding of the material. Key features and advantages of DBMS, as well as practical steps for managing data, are also detailed throughout the document.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
0 ratings0% found this document useful (0 votes)
21 views12 pages
Ex CH - 3.1 0 3.2
The document provides a comprehensive overview of database management systems, covering topics such as creating and editing tables, types of keys, relationships between tables, and the use of queries, forms, and reports. It includes multiple choice questions, fill-in-the-blanks, true/false statements, and short and long answer questions to assess understanding of the material. Key features and advantages of DBMS, as well as practical steps for managing data, are also detailed throughout the document.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
You are on page 1/ 12
Database Management System
Creating and Editing Tables
. Multiple Choice Questions
1. (d) 2. (a) 3. (b) 4. (b) 5. (c)
6. (b) 7. (b) 8 (cd 9. (d) 10. (a)
. Fill in the Blanks
1. Field 2. DROP TABLE 3. Database
4. Composite key 5. Find 6. Filtering
7. Relationships window 8. Tables involved, Fields involved
9. Keys 10. Referential integrity
. State Whether the Statements Given Below are True or False
1. F 2. T 3. T 4. F 5. F 6. T
7.7 8. OF 9. iT 10.F 11.T 12.F
. Short Answer Questions
1. Data is a collection of unprocessed facts and figures, which
can include text, numbers, images, audio, and video.
Information is processed data; that is, itisorganized, meaningful,
and useful. In addition to documents, information can be in the
form of audi
images, and video.
2. Followingare the advantages of DBMS:
Reduces Data Redundancy: It reduces data redundancy,
which means ‘duplication of data' to as all the datais stored in
a single place and there is no need to create separate files at
differentplaces.
Data Consistency: Data consistency ensures the absence of
data redundancy. All data appears consistently across the
database and any changes made to the database are
immediately reflected to all the users viewing the database.
Sharing of Data: The data stored in the database can be
shared among multiple users simultaneously or can be used
by other application programs. So, it eliminates the process
of recreating the same data from scratch.. Data Security: The DBMS ensures that the access of
database is done only through an authorised user according
to its privacy constraints and identity should be
authenticated using a username and password.
°. Data Integrity: The DBMS also enforces data integrity by
allowing the entry of only correct and consistent data in the
database.
Following are the features of DBMS:
°. Database controls data redundancy as storage, retrieval and
manipulation of data occurat one place.
°. It facilitates data sharing which gives users an ability to
generate more information from a given amount of data.
° Database Backup and Recoveryis one ofthe best features of
database that protects data from loss in case of power or
hardware failure.
. It also protects data from unauthorized or restricted access
by setting accessing privileges.
Arelational database has the following major components:
Table: Tables are the places where all the information in your
database isstored. They have to be created first; no other part of
the database can function until the tables are created. Tables are
used to keep the data tabulated in rows and columns.
Record: A record is a row in a table that contains information
about a given person, product, or an event. It is also known as
row, entityor tuple.
Field: A field is acolumn ina table that contains a specific piece
of information within a record. It is the smallest unit of data. It is
also known asacolumn or attribute.
Database: A database object is any defined object ina database
that isused to store or reference data.
Some of thedatabase objects are:
Table: Base organizes information into tables composed of rows
and columns and stores information about a specific subject or
entity.Query: A query is used to retrieve information from one or more
tables. A new table or view created from the existing tables is
based upon the query applied.
Forms: Forms are the interactive or user friendly way to enter or
view data of the fields of the tables of a database. It is an
alternative way to access data source of LibreOffice Base.
Report: Areport is a database object that aids in presenting the
information in an enticing way, especially for printing purpose. It
also provides the way to view, format, and summarize the
information thatis fetched from tables or queriesofadatabase.
4. To Switch to Table Design view, follow these steps:
i. Open the database and click on the Tables icon in the
Database section.
ii. Right-click on the Table name inthe Listsection.
iii. Click on Edit from the context menu.
The Table Design view windowwillappear.
To Switch to Table Data View, followthese steps:
i. Open the database and click on the Tables icon in the
Database section.
ii. Right-click onthe Table name in the Listsection.
iii. Click on Open from the context menu.
The Table Data View window will appear.
5. To delete a relationship between tables, follow these steps:
i. Click on the line of the relationship you want to delete.
The line will be selected.
ii, Press the Delete key on the keyboard. LibreOffice Base
permanently deletes the relationship.
6. Standard Filter enables you to filter by multiple fields and
specify criteria for as many fields as you like. When you
filter, you can combine the criteria using AND, OR, or a
combination of the two.
7. To create a table using DDL command, follow these steps:
i. Click on the Tables icon in the Database section.Click on the Tools menu.
iii. Click on SQL.
The Execute SQL Statement dialog box appears.
iv. Click in Command to execute section and type the
following commands:
CREATE TABLE table_name
Column1 datatype,
Column2 datatype,
Column2 datatype,
i
v. Click on the Execute command.
If the command for creating table are OK then Command
successfully executed appears in the Status section.
vi. Click on the Close button to close the Execute SQL
statement dialog box.
To edit a table using DDL command, follow these steps:
i. Click on the Tables icon,in the Database section.
Click on the Tools menu.
Click on SQL.
The Execute SQL Statement dialog box appears.
iv. Click in Command to execute section and type the
following commands (to add column):
ALTER TABLE table_name (
ADD column_name datatype
v. Click on the Execute command.
If the command for creating table are OK then Command
successfully executed appears in the Status section.
vi. Click on the Close button to close the Execute SQL
statement dialog box.
E. Long answer Questions
1. As we know that data is a prime source of any organization
and it grows day by day so a need arises for some tools that
aids in maintaining and managing large collections of dataand also provides mechanism for systematic extraction of
information from large data set.
A database is a collection of data organized in a manner that
allows easy access, retrieval, and use of that data.
With database software, often called a database
management system (DBMS), users create a computerised
database; add, modify, and delete data in the database; sort
and retrieve data from the database; and create forms and
reports from the data in the database.
2. Data is organized in layers. In the field of computer, data is
classified in a hierarchy. Each higher level of data consists of
one or more items from the lower level. For example, a
student has an address, and an address consists of letters
and numbers. Depending on the application and the user,
different terms describe the various levels of hierarchy.
A database contains tables (sometimes called files), a table
contains records, a record contains fields, and a field is
made up of one or more characters.
3. To add a column in a table, use the following syntax:
Syntax:
ALTER TABLE table_name
ADD column_name datatype;
To delete a column in a table, use the following syntax:
Syntax:
ALTER TABLE table_name
DROP COLUMN column_name;
4. Following are different types of keys in database:
e Primary Key- A primary key is a field that uniquely
identifies each record in a table. The data in a primary
key is unique to a specific record.
e Composite Key - A composite key, in the context of
relational databases, is a combination of two or more
columns in a table that can be used to uniquely identify !
each row in the table.e Foreign Key - A foreign key acts as a link between two
tables of a database. A foreign key is a column of a
table that references a column (most often the primary
key) of another table
5. There are three types of relationships which can be created
in tables:
i. One to One: In this relationship, a record in a table can
have only one matching record in another table.
Sree
Student_ID [| Name Student_ID
Dance
101 101 Bharatnatyam
102 102 Kathak
103 103 ‘Salsa
In the given tables Student_ID in Student Detail and
Student_ID in Dance Practice are both primary keys.
ii. One to Many: In this relationship, a record of one table is
associated with several matching records of another table
but a record from the second table is associated with
only one record of first table. For example, student can
enroll for multiple dances and the set of dance done by
individual student.
Student_ID | Dance
01 Bharata
Student_ID | Name 101 Jazz
101 Rulali 101 Kathak
102 Sonam 102 Bharatnatyam
103 Rahul 103 Kathak
104 Salsa
Many to Many: In this relationship, several records of
one table are associated with several records of another
table and vice versa.
‘Student_ID Dance_|
Name Name
‘Contact No. Contact No.
‘Student_l
Dance_ID
Contact No.Relationships are created and managed in a special database
view called Relationships window. You can create
relationships between tables from there by dragging a field
from one table onto a field from another.
F. Differentiate between the following
1. InTable Dataview, you can enter data.
You can use Table Design view to modify the design of the table.
2. Aprimary key is a field that uniquely identifies each record ina
table. Thedatain a primary keyis uniqueto aspecific record.
A foreign key acts as a link between two tables of a database. A
foreign key is acolumn ofa table that references a column (most
often the primarykey) of another table.
3. One to One: In this relationship, a record in a table can have only
one matching record in another table.
Many to Many: In this relationship, several records of one table
are associated with several records of another table and vice
versa.
4. Sorting means arranging the records in a particular order,
ascending or descending.
Filtering data can help you review and analyze information
in your database.
G. Application Based Questions
1. Riya can add a column by using DDL commands. To do so,
she can follow the below given syntax:
ALTER TABLE table_name
ADD column_name datatype;
2. She should use Sorting feature to display the records in
alphabetical order.i Query, Form and Report
A. Multiple Choice Questions
1. (b) 2. (co) 3. (b) 4. (c) 5. (a)
6. (d) 7. (b) 8. (a) 9. (d) 10. (a)
B. Fill in the Blanks
1. Label 2. Alias 3. reflected 4. detail lines
5. asterisk (*) 6. record source 7. Criteria 8. From
9. AND 10. comparison operator
C,. State Whether the Statements Given Below are True or False
1.7 2. F 3. T 4. F 5. T
6. T 7. F & T 9. iT 10.F
D. Short Answer Questions
1. Queryis a request for a specific data from the database. In other
words, a Query is simply a question represented in a way that
Basecanunderstand.
There are mainly three types of query: Simple query, Unmatched
queryand Duplicate query.
Simple Query: It is used to ask some particular questions about
data in the database,
Unmatched Query: Itis used to find records from one table that
do not have corresponding values in the second table.
Duplicate Query: It is used to dis play the records that have same
values for one or more of the specified fields.
2. Wildcardsare symbols that representa character or combination
of characters. Base provides two special wildcards. The asterisk
(*), which is the first of the two wildcards, represents a collection
of characters. Thus, Like D* represents the letter D, followed by
any collection of characters. The other wildcard symbol is the
question mark (?), which represents a individual character. Thus,
Like D?epak represents the letter e, followed by any single
character that follows the letter, such as in ‘Deepak’.3. Criteria are conditions that help you to retrieve specific
records from the database. You can limit the results of a
query based on the values in a field.
Often, more than one criterion might be available to satisfy
the data you are searching for. This is called compound
criteria. There are two types of compound criteria — AND
and OR. In an AND criterion, each individual criterion must
be true in order for the compound criterion to be true.
Conversely, an OR criterion is true provided either of the
individual criterion is true.
4. Following are the steps to delete a field from your query:
i. Right-click directly above the field you want to delete. A
context menu will appear.
ii. Click on Delete. The field disappears from your query.
5. Following are the steps to save a query:
i. Click on the Save button. The Save As dialog box
appears.
Type a name for your query.
ii. Click on the OK button to save your query.
6. Follow these steps to create a report:
1. Open the database and click on Reports in the
Database section.
2. Click on Use Wizard to Create Report.
The Report Wizard dialog box will appear.
3. Click on the down arrow of Tables or queries.
4. Click on a table containing the fields on which you want
to create the report.
5. Double-click on each field that you want to include in
the report.
e LibreOffice Base adds the fields to the list.
e To add all the fields, click on the Add All
[ =! ] button.
Each field you select appears in the Fields in report area.
6. To remove a field you have wrongly selected, double-
click on the field in the Fields in report area.10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
To remove all the fields at once, click on (t=).
Click on Next button to continue.
Click on any Field label box and change the label
(optional).
Click on the Next button to continue.
To use a specific field to group data in your report,
double-click on the field you want to use.
This area shows how LibreOffice Base will group data in
your report.
Click on the Next button to continue.
To sort records of table in your report, click on the arrow
button in this area (optional).
Click on the field you want to use to sort the record
(optional).
Click on the Next button to continue.
Click on the Layout options. to select a layout for the
report.
You can set the page orientation for a report using these
options.
Click on the Next button to continue.
Type a name for the report.
Click on Finish.
LibreOffice Base creates the report.
—. Long answer Questions
1.
You can create a calculated field in the query. Now, let's say
you want to figure out something based on that data. The
club is giving discount to the club members. Now, subtract
the discount from the charges and show the total by
creating a new table called Discount.
Add the Table (Discount) which shows charges and
discount in Query Design.
To add the calculation column, click in the top cell of the
first blank column and type fieldname_M — fieldname_N.For instance, to subtract the discount from Charges, type
Charges- Discount.
iii. In the cell below that, the cell to the right of the Alias
label, type the name you want to use to refer to this
calculated field, like Total.
iv. Click on Run Query (Not shown).
e You will see your results, with the calculation.
In this example, we have calculated the total by subtracting
the discount from the charges.
Following are the steps to change the labels of form in
LibreOffice:
i. Open the database and click on Forms icon in the
Database section.
ii. Right-click on the Form name.
iii. Click on Edit from the context:menu. The Form Design
window will appear.
iv. Click on the Label. The entire control (label and field) will
be selected and a border appears around the control
with eight green handles. You can then drag and drop it
wherever you want.
v. Press the Ctrl key and.click on the label to select it. The
label is selected and a border appears around it with
eight green handles. You can press the Tab key to change
the selection from the field to the label or the label to
the field.
vi. Right-click on the selected label. A context menu will
appear.
Click on Control. Properties: Label Field dialog box will
appear. It contains all the properties of the selected
label.
viii-Click on the Label section and change the label name. In
this example, we have changed Member ID to Mem_ID.
ix. Click on Close button to close the dialox box.
Label name has changed.
To insert a new record using the Form, follow the given
steps:
i. Click on the New Record button.
Blank fields appear in the form.
ii. Enter the new data in the blank fields.
iii. Click on the Save Record button.
vii.To delete a record using the Form, follow the given steps:
i. Using the navigation button, move to the record you
want to delete.
ii. Click on Delete Record button. A dialog box will appear.
lili. Click on Yes.
Record will be deleted permanently from the form and the
table.
You can use Form search box to search for a particular
record very easily.
i. Click on the Search box and enter the number of records.
you want to search for.
ii. Press the Enter key.
F. Differentiate between the following
1. The field or fields on which the records are sorted is called
the sort key.
If you are sorting on more than one field, the more
important field is called the major key (also called the
primary sort key).
And the less important field is called the minor key (also
called the secondary sort key).
2. Unmatched Query: It is used to find records from one table
that do not have corresponding values in the second table.
Duplicate Query: It is used to display the records that have same
values for one or more of the specified fields.
3. A Form is a view of one or more tables that are designed to
be used for data entry and editing.
A Report is a way to display data from a query and/or table
in an appealing way. Reports are specially designed to be
printed. A report can have more elaborate formatting and
layouts than the other objects you can print
G. Application Based Questions
1. Rohini can use Form feature of the database to enter data.
2. She can create a Report to print the records.