You are on page 1of 11

Unit 3 Relational Database Management system

MCQ, Fill in the blanks and True/False


1. A database is an organized collection of ………
a. data
b. Attributes
c. Record
d. None of the above
2. Which of the following software is appropriate to store data about school students?
a. MS-Access
b. Writer
c. Calc
d. Impress
3. Which of the following is not a database programs?
a. MySQL
b. Oracle
c. Writer
d. OO base
4. …….. store data in Single table.
a. Flat File
b. Relational
c. Single File
d. One File
5. …….. are dedicated computers that hold the actual databases and run only DBMS and related Software.
a. Main Server
b. Web Server
c. Database Server
d. Non Database Server
6. GUI act as front end and database server act as …….
a. Container
b. Back End
c. End
d. None of the above
7. Duplication of data is called …….
a. Inconsistency
b. Consistency
c. Redundancy
d. Foreign Key
8. Which of the following is not the advantage of database?
a. Sharing of Data
b. Reduce Data Redundancy
c. Increase Data Inconsistency
d. Data Security
9. Data Integrity means that data is accurate and consistent in the database.(T/F)
a. True
b. False
10. A database can have only one table.(T/F)
a. True
b. False
11. A ….. is a set of information (made up of fields) stored in your database about one of the items.
a. record
b. field
c. value
d. None of the above
12. …….. is the actual text or numerical amount or date that you put in while adding
information to your database.
a. record
b. field
c. value
d. None of the above
13. Categories of information in database id called ……..
a. record
b. field
c. value
d. None of the above
14. A field which is ______ for each and every record is called Primary key.
a. Common
b. Same
c. Unique
d. None of the above
15. When data is stored, maintained and retrieved from multiple tables then special database software are required called
……
a. DBMS
b. RDBMS
c. Special DBMS
d. All of the above
16. In RDBMS, data is organized in the form of ……
a. Table
b. Record
c. Field
d. None of the above
17. All the values in ________ are of same type.
a. Records
b. Table
c. Database
d. Fields
18. When primary key constraint is applied on one or more columns then it is known as ……
a. Primary Key
b. Composite Primary Key
c. Foreign Key
d. None of the above
19. The ……. identifies a column or set of columns in one (referencing) table that refers to a column or set of columns in
another (referenced) table.
a. Primary Key
b. Composite Primary Key
c. Foreign Key
d. None of the above
20. ………. represent a single data item in a table.
a. Tuples
b. Attributes
c. Relation
d. All of the above

21. A form enables users to view, enter and change data directly in database objects such as tables.

22. Select statement retrieves zero or more rows from one or more database tables or Database views.

23. By default, data is arranged in ascending order using ORDER BY clause.

24. Update statement is used for modifying records in a database.

25. Delete statement is used to remove one or more records in a database.

2. To create a form you need to select form option available under database section.

27. A report helps to collect specific information from the pool of data in the database.

28. A Report is used to display the summary of the data.


29. Forms are the interfaces with which the user interacts.

30. ………. data type takes the values in the form of 0 and 1 in the database.

a) Integer b) Text c) Boolean d) Memo

Short Answer Questions (2 Marks)

1. What do you mean by a database? Elaborate your answer with an example.

Ans: A database is an organized collection of data. You can visualize it as a container of information. Example
-
Suppose if you own a stationary shop, you need to keep detailed records of the materials available in your
shop. You also need to store information about pricing, stock levels for reordering, old stocks, etc. While in
the manual system, you would maintain several files with different bits of information; in the computerized
system you would use database programs such as Microsoft Access, OpenOffice.org Base, and MySQL, to
organize the data as per your business need.

2. What are the features of the database? Explain in one line.

Ans: A database can have one or many tables. Each table in a database contains information about one type
of item. Record uniqueness in every table. It is important to be able to distinguish between different items
having duplicate values. Every database table should have one or more fields designated as key.

3. Explain the concept of RDBMS.

Ans: A relational database is a type of database. It uses a structure that allows us to identify and access data
in relation to another piece of data in the database. Often, data in a relational database is organized into
tables.

4. What is the primary key, Composite key, and foreign key?

Ans: Primary key: A primary key is a unique value that identifies a row in a table. Primary Keys are also
indexed in the database, making it faster for the database to search for a record.

Composite key: When primary key constraint is applied on one or more columns then it is known as
Composite Primary Key.

Foreign key: the foreign key identifies a column or set of columns in one (referencing) table that refers to a
column or set of columns in another (referenced) table.

5. Define the following:

a. Field/ fields/ Attributes: A column is a set of data values of a particular simple type, one for each
row of the table. The columns provide the structure according to which the rows are composed.
These are the categories of information.

For example, FirstName, or LastName Date of birth are fields in a row.

b. Rows or Records or Tuples: A row also called a Record or Tuple represents a single, data item in a
table. In simple terms, a database table can be visualized as consisting of rows and columns or fields.
Each row in a table represents a set of related data, and every row in the table has the same
structure.

d. RDBMS: A relational database is a collective set of multiple data sets organized by tables, records
and columns. Relational database establish a well- defined relationship between database tables.
Tables communicate and share information, which facilitates data search ability, organization and
reporting.

e. Table: A table is a set of data elements (values) that is organized using a model of vertical columns
(which are identified by their name) and horizontal rows. A table has a defined number of columns,
but can have any number of rows.

8. Write a few examples of RDBMS packages. (At least 4 names required in 2 Marks)

Ans: Oracle, IBM DB2, Microsoft SQL Server, Microsoft Access, PostgreSQL, MySQL, FoxPro, and SQLite.

9. What are the types of databases?

Ans: Flat File: Data is stored in a single table. Usually suitable for less amount of data.

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

10. What are database servers? What do you mean by the Front end and Back end?

Ans: Database servers are dedicated computers that hold the actual databases and run only the DBMS and
related software. Typically databases available on the database servers are accessed through command line
or graphic user interface tools referred to as Frontends; database servers are referred to as Back-ends. Such
type of data access is referred to as a client-server model.

11. In how many ways tables can be created in Base?

Ans: There are 2 ways to create a table:

1. Create table in Design View

2. Use Wizard to Create Table


12. Why are data types used in DBMS /RDBMS?

Ans: Data types are used to identify which type of data (value) we are going to store in the database.

Fields themselves can be of different types depending on the data they contain. Data types in
OpenOffice base are broadly classified into five categories listed below.

• Numeric Types

• Alphanumeric Types

• Binary Types

• Date time

• Other Variable types


13. List data types available in Numeric Data type?

Ans: Numeric data types are used for describing numeric values for the field used in the table of a database.
Numeric data types in a database can be used for storing information such as mobile number, roll number, door
number, year of school admission, true or false statements, statistical values, etc.
1. BOOLEAN 2. TINYINT 3. SMALLINT 4. INTEGER 5. BIGINT 5. NUMERIC 6. DECIMAL 7. REAL 8. FLOAT
9.DOUBLE

14. List data types available in Alphanumeric Data type?

Ans: Following arte the data types available in Alphanumeric Data type:

1. LONGVARCHAR 2. CHAR 3. VARCHAR 4. VARCHAR_IGNORE CASE

15. Name different Binary data types.

Ans: Binary data types are used for storing data in binary formats. Binary data types in a database can be using for
storing photos, music files, etc. In general, files of any format can be stored using the binary data type. The
different types of binary data types available are listed here.

16. Differentiate between Tuples and Attributes of a table

Ans: Tuples: A row also called a Record or Tuple represents a single, data item in a table.

Each row in a table represents a set of related data, and every row in the table has the same structure.

Attributes of a table: Attributes are the categories of information. These are the headings given to the
column of the table.

The columns provide the structure according to which the rows are composed.

17. What is the file extension for databases created using OpenOffice.org Base? Ans: .odb

is the file extension for databases created using OpenOffice.org Base

18. List any three file formats that can be managed using OpenOffice.Org Base?

Ans: Three file formats that can be managed using OpenOffice.org base are:

.odt— This file format is used by OpenOffice.org Writer application for creating documents.

.ods— This file format is used by OpenOffice.org Calc application for creating spreadsheets.

.odp— This file format is used by OpenOffice.org Presentation application for creating presentations.

19. What do you mean by sorting? In how many ways it can be done?

Ans: Sorting means to arrange the data in either ascending order of descending order. It makes database operation
easier and faster. It can be done in two ways that is ascending order and descending order.

20. What is the purpose of using query?


Ans: A query can either be a request for data results from your database or for action on the data, or for both. A
query can give you an answer to a simple question, perform calculations, combine data from different
tables, add, change, or delete data from a database.

21. What is the use of select command? Which clause of Select statement helps to display specific data? Write its
syntax.

Ans: A SELECT statement retrieves zero or more rows from one or more database tables or database views. In most
applications, SELECT is the most commonly used Data Manipulation Language(DML) command.

The SELECT statement has many optional clauses:

• WHERE specifies which rows to retrieve.

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


the columns in a table the syntax is:

SELECT * FROM <TABLENAME>;

To display the records containing the same type of values “WHERE” clause can be used with the Select SQL
Command. syntax is -

select * from <table name> where <field name>=’value“,

22. Differentiate between Where and Orderby clause of SQL statements.

Ans: To display the records containing the same type of values “WHERE” clause can be used with the Select SQL
Command. Whereas Orderby clause is used to view records in ascending order. Syntax of using Orderby
clause is-

select * from <table name> order by “field name” ASC;

23. State the purpose of Update Command with the help of an example.

Ans: Update statement is used for modifying records in a database. The general syntax of the update statement is
as follows:

UPDATE <tabIe_name>

SET <column_name> = value [, co1umn_name = value ...]

[WHERE <condition>];

example:

To update a record using an update statement, type the following and click Execute.
Update SDetails set Location = ‘Bhubaneswar’ where Rollno = 14;

the above command will update the Location field with Bhubaneswar from table
Sdetails of Rollno = 14
24. Why there is a need to create Forms?

Ans: A form provides the user a systematic way of storing information into the database. It is an interface in a user
specified layout that lets users to view, enter, and change data directly in database objects such as tables.
25. What is the purpose of creating Reports?

Ans: A database report is the formatted result of database queries and contains useful data for decision-making
and analysis. A report helps to display the data in a summarized manner. It is used to generate the overall
work outcome in a clear format.
26. What are the prerequisites to create a Form and Reports?

Ans: forms

1. It provides the user a systematic way of storing information into the database

2. It give input or add record to database report

1. It display the data in a summarised manner

2. it generates overall work outcome


27. Differentiate between Forms and Reports.

Ans: Forms are Input to the information system and Reports are output from the system. Form gathers
information for essentially one record of the database. That is,

information about one person or object. On the other hand, Reports can represent information, gathered
from more than one file.
28. Can a form displays data from queries?

Ans: We can design a form using query, so a form displays data from queries

29. In how many ways Forms and Reports can be created in a database?

Ans: Forms and Reports can be created in a database by using two methods; Design Method and Wizard

Method

Long answer questions (4 Marks Questions)

1. Explain Database Management system in detail with example.

Ans: A database management system is a software package with computer programs that controls the
creation, maintenance, and use of a database. It allows organizations to conveniently develop databases for
various applications. A database is an integrated collection of data records, files, and other objects. A DBMS
allows different user application programs to concurrently access the same database.

Well known DBMSs include Oracle, IBM DB2, Microsoft SQL Server, Microsoft Access, PostgreSQL, MySQL,
FoxPro, and SQLite.
2. What are the advantages of a database? Explain each of them in short. Ans: Following

are the advantages of Database:

1. Reduces Data Redundancy: The database management systems there is a single database and any
change in it is reflected immediately. Because of this, there is no chance of encountering duplicate
data.
2. Sharing of Data: In a database, the users of the database can share the data among themselves.
There are various levels of authorization to access the data, and consequently the data can only be
shared based with the authorized users.

3. Data Integrity Data integrity means that the data is accurate and consistent in the database
4. Data Security: Only authorized users should be allowed to access the database and their identity
should be authenticated using a username and password.
5. Privacy : The privacy rule in a database states that only the authorized users can access a database
according to its privacy constraints
6. Backup and Recovery: Database Management System automatically takes care of backup and
recovery. The users don't need to backup data periodically because this is taken care of by the
DBMS.
7. Data Consistency: Data consistency is ensured in a database because there is no data redundancy.
Data Consistency means there should be multiple mismatching copies of the same data.
3. What are the features of the database? Explain in short with examples. Ans:

Following are the features of Database:

1. A database can have one or many tables

2. Each table in a database contains information about one type of item. So, a database is a
container that holds tables and other objects and manages how they can be used.

3. record uniqueness in every table. Uniqueness helps to avoid accidental duplication of records
caused by user or computer error. This can be achieved by using some number or value that
uniquely identifies a record.

4. Every database table should have one or more fields designated as key. You can assign a unique
value to this key for differentiating records that may have similar names or addresses.

4. How many types of relationships can be created in base? Explain each of them. Ans three

types of relationships which can be created in tables:

1. One to One Relationship : In this relationship, both the tables must have primary key columns.

2. One to Many Relationship: 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.

3. Many to Many Relationship: 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.

5. Explain referential integrity.

Ans: 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:

• Adding records to a related table if there is no associated record available in the primary key table.

• Changing values in a primary if any dependent records are present in associated table(s).

• Deleting records from a primary key table if there are any matching related records available in associated
table(s).

6. What do you mean by relationship? How does it helps in database?

Ans: A relationship refers to an association or connection between two or more tables.


When we relate two tables, we don't need to enter the same data in separate tables.

Relationships between tables helps to:

• Save time as there is no need to enter the same data in separate tables.

• Reduce data-entry errors.

• Summarize data from related tables.


we can create a relationship between any two tables by selecting Relationships... option from the Tools
menu.

7. Explain the field properties of numeric data type and character data type.
Ans : The properties of numeric type data are
AutoValue — if set to yes then field will get the auto numeric values.
Length — By default length of the field is 10 but the size of the field can be set to maximum length.
Default Value — A default value can be set for a field if user doesn't provide any value while entering the values
in the table.

Format example — This property helps to set the format of the data entered in the field such as 91-222-333.

The properties of character type are :


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.

Length — By default length of the field is 10 but the size of the field can be set to maximum length.
Default Value — A default value can be set for a field if user doesn't provide any value while entering the values
in the table.

Format example — This property helps to set the format of the data entered in the field such as 91-222-333.
8. The structure of a table “ITEM” is given below. Suggest suitable data type and size of each column.

Column name Type Size


Itemno
Iname Price

Quantity

Ans Itemno integer (10)


Iname varchar (15)
Price decimal (5,2)

Quantity integer (3)


9. Consider the following table “ITEM”: Table:

Item

Itemno Iname Price Quantity


11 Soap 40 80
22 Powder 80 30
33 Face cream 250 25
44 Shampoo 120 100
55 Soap box 20 50

Write queries to :

i. Display the total amount of each item. The amount must be calculated as the price multiplied by
quantity for each item.
ii. Display the details of items whose price is less than 50.
Ans: i. Select price * quantity from item;

ii. Select * from item where price < 50;

10. Explain DDL and DML commands in short.


Ans: DDL is Data Definition Language which is used to define data structures. For example: create
table, alter table are instructions in SQL.
CREATE — is used to create the database or its objects (like table, index, function, views, store procedure
and triggers).
DROP — is used to delete objects from the database.
ALTER-is used to alter the structure of the database.
TRUNCATE—is used to remove all records from a table, including all spaces allocated for the records are
removed.
COMMENT —is used to add comments to the data dictionary.
RENAME —is used to rename an object existing in the database.

DML: DML is Data Manipulation Language which is used to manipulate data itself. For example: insert,
update, delete are instructions in SQL.
SELECT — is used to retrieve data from the database.
INSERT — is used to insert data into a table.
UPDATE — is used to update existing data within a table.
DELETE — is used to delete records from a database table.

You might also like