0% found this document useful (0 votes)
30 views119 pages

BDPS

The document is a textbook for B.Com. students covering Business Data Processing Systems and Electronic Commerce, authored by Venu P. The content includes a syllabus, detailed units on DBMS concepts, database design, MS Access functionalities, and practical applications, along with model papers and a question bank. It highlights the importance of DBMS over traditional file management systems, addressing limitations, advantages, and key components of databases.
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)
30 views119 pages

BDPS

The document is a textbook for B.Com. students covering Business Data Processing Systems and Electronic Commerce, authored by Venu P. The content includes a syllabus, detailed units on DBMS concepts, database design, MS Access functionalities, and practical applications, along with model papers and a question bank. It highlights the importance of DBMS over traditional file management systems, addressing limitations, advantages, and key components of databases.
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/ 119

Apoorva Publishers 1

B.Com.
Computer Applications: Second Year

BUSINESS DATA PROCESSING SYSTEMS

AND

ELECTRONIC COMMERCE

(NEW and REVISED edition)

By:
Venu P. B.E. Comp.

APOORVA DEGREE COLLEGE


DISC COMPUTERS
Karimnagar.

B- Com II – BDPS & E-Commerce


2 Apoorva Publishers

In spite of many efforts taken to present the book without


errors, some errors might have crept in. Therefore, we do not
take any responsibility for such errors and omissions.
However if they are brought to our notice, they will be
corrected in the new edition.

No part of this book may be reproduced, stored in any


retrieval system or otherwise without the prior permission of
the author.

Price Rs. 170/- only

For Copies Contact:


Srinivasa book depot: 9848535542

Printed At:
Srinivasa book depot
Karimnagar.

B- Com II – BDPS & E-Commerce


Apoorva Publishers 3

BUSINESS DATA PROCESSING


SYSTEMS ---------- PAGE NO: 4

ELECTRONIC
COMMERCE ---------- PAGE NO: 120

B- Com II – BDPS & E-Commerce


4 Apoorva Publishers

BUSINESS DATA PROCESSING SYSTEMS

Contents Page no.


Syllabus 5
UNIT-I
1. DBMS Concepts 6
UNIT-II
2. Database Design 20
UNIT-III
3. MS-Access: Tables 39
UNIT-IV
4. Queries 53
UNIT-V
5. Forms 64
6. Queries 74
SLOVED PRACTICAL QUESTION BANK 81
Viva Questions 110
Model Paper-1 263
Model Paper-2 264
March-2010 265
March-2011 266
March-2012 267
March-2013 268
March-2014 269
B- Com II – BDPS & E-Commerce
Apoorva Publishers 5

SYLLABUS
PAPER-IV: BUSINESS DATA PROCESSING SY ST EM
Unit – I: Data and information-Limitations of manual data processing - Advantages of
data-basics-DBMS-Functions of DBA-Elements of DBMS:DDL,DML,Entities, Sets
and attributes. Data Base Tables: Keys-Primary, secondary, composite and
foreign key.

Unit – II: Relational Data Base: Entity relationship-Types-l:l, I:M, M:N, Strong and weak
entities, Recursive Data Base Design, Normalization. First, Second, third BCNF
fourth. Class diagrams and Entity relationship tables.

Unit – III: Creating Data Bases: Creating tables Modifying table structures-Data emry-
Edit-Deletc-Importing-Exporting table using MS Access.

Unit – IV: Queries: QBE-Select queries-Grouping-Parameters-Data formatting, queries


based on multiple sources-Cross tab queries-Actionqueries-Make table
queries-append-Delete and Update queries using MS-Acccss,

Unit-V: Forms and Reports; Forms: Functions and uses-Creating , Modifying labels-
List boxes-Dialog boxes. Reports. Creating-Modifying reports-Creating
Reports with Report wizard-Report Graphics-Label output format-Form
letters.(Using MS Access)

Tab Work: (MA Access)

Creating tables entering data, viewing , editing, sorting, deleting, moving data in Tables
Simple queries using Employee data base, inventory database, product data base, invoice
data base, customer database. Creating forms and reports using the database stated in
itemno.2

Books Recommended:

Perer Norton : Introduction to Computers (2ndEd),TMH,Nevv Delhi, 1998.


Basandra K.Suresh : Computers Today, GaIgotia Publications New deihi,2000,
RobPeter.and Semaan Elie : Data Bases: Design, Development & Development using
MS Access, TMH. New delhi,2000.

B- Com II – BDPS & E-Commerce


6 Apoorva Publishers

UNIT
I 1. DBMS Concepts
1) Define i)data ii) information iii) metadata. Give examples. Compare their
utility
2) What are the limitations of manual data processing?
3) What are the disadvantages of File processing systems? (or) What are the
disadvantages of File Management System?
4) What is DBMS? What are the functions of DBMS?
5) Define DBMS. Explain its advantages over traditional file management
system.
6) What are database components?
7) What are database elements?
8) What is an attribute? Explain types of attributes. (or) What are the
characteristics of attributes?
9) What is a Database Table and what are their components? (OR) What is a
key? Explain types of keys.
10) Explain DDL and DML commands.
11) Explain Information System Architecture.
Short Questions:
12) Define Data and information.
13) What is Data dictionary?
14) What is Storage location?
15) What is attribute?
16) What is Database system? (OR) What is DBMS? (OR) What are the
functions of DBMS?
17) What is primary key?
18) What are single attribute and composite attributes?
19) Explain the terms: entity and entity sets and attribute.
20) What is foreign key?
21) What is data processing?
22) What is Associative Entity?
23) What is metadata?

B- Com II – BDPS & E-Commerce


Apoorva Publishers 7
1. Define i)data ii) information iii) metadata. Give examples. Compare their utility

Data: Data is a raw collection of characters, facts about objects. Data includes text,
graphics, images, sound, etc that have meaning in the user’s environment.

Information: Information is meaningful data in an organized form. Information is


processed data that increases the knowledge of the person who uses the data

Metadata: Meta data is data about data. It describes the properties or characteristics
of other data. It includes field names, data-types and their size.

Data MetaData Information


Data is a raw
Information is meaningful
collection of Metadata is data about data.
data in an organized form.
characters, facts
Data exists with the Metadata is required for Information is required by
user entering data the user
It is unprocessed It requires defining using
This is processed data
data languages such as SQL.
Required for Required for decision-
Required for database design
database analysis making

Ravi 33 88 74 87 Data
(Here, it is not clear whether ‘33’ is rno or marks)
`
MetaData
(Meta Data includes: Field name, Data types, Size, Table names and etc)

Name Rno M1 M2 M3 Total


(Text) (Number) (Number) (Number) (Number) (Number)
Ravi 33 88 74 87 249
Kiran 44 98 87 65 250

Information

2. What are the limitations of manual data processing?

Manual data processing: Here, the processing is done by the human beings. As all the
calculations are done by the human beings, there is chance of having errors, which

B- Com II – BDPS & E-Commerce


8 Apoorva Publishers
leads to poor processing. This process is very slow and impractical in the case of large
amounts of data.

The limitation of manual of data processing:

1. Less Processing Speed: Manual data- processing consumes lots of time, even for
small amounts of work. This process is very slow and impractical in the case of
large amounts of data.
2. Less Accuracy: The data processed by the human beings is less accurate. The
saying ‘To err is human’ is very much true especially in the case of complex
calculations.
3. Storage problems: Large volumes of data cannot be conveniently stored and
accessed. All the data has to be stored in the form of documents, which may get
torn or damaged easily. The huge piles of documents will be damaged by pest.
4. Difficult to Manage information: We cannot easily access the required information
and prepare reports for managerial decision-making.
5. Cost overheads: Increase in cost occurs due to processing of huge data and record
keeping and the need of more workforce.
6. Diligence: Machines do not suffer from boredom, tiredness or lack of
concentration, even if millions of computations are to be performed. But this is not
so in the case of manual processing as it is done be human beings. One cannot
work for hours together as computers do.
7. No Backup and No Recovery: There is nothing like backup and recovery in the case
of manual data processing. The only way to backup is to keep multiple copies of
same documents, which again requires machines like copiers.

3. What are the disadvantages of File processing systems? (or) What are the
disadvantages of File Management System?

Several disadvantages are associated with conventional file processing systems. These
disadvantages are listed below:
 Program data dependence
 Duplication of data
 Limited data sharing
 Lengthy development times
 Excessive program maintenance

Program-Data Dependence: File descriptions are stored within each application


program that accesses a given file; any change to a file structure requires changes to
the file descriptions for all programs that access the file.

B- Com II – BDPS & E-Commerce


Apoorva Publishers 9
Duplication of Data: Since applications are often developed independently in file
processing systems, surely there will be duplicate data files. It results in loss of data
integrity. For example, the same data item may have different names in different files.

Limited Data Sharing: With the traditional file processing approach, each application
has its own private files and users have little opportunity to share data outside their
own applications.

Lengthy Development Times: With traditional file processing systems, there is little
opportunity to support previous development efforts. Each new application must be
started from scratch by designing new file formats and descriptions and the process
becomes very lengthy and time consuming.

Excessive Program Maintenance: The above factors all combine to create heavy
program maintenance load in organizations that rely on traditional file processing
systems.

4. What is DBMS? What are the functions of DBMS?

A database is a collection of logically related data stored in a standardized format and is


sharable by multiple users.

Database Management System (DBMS): DBMS is collection of database and a set of


application programs that allow us to organize, manipulate and retrieve information.

Functions of DBMS: A Database Management System (DBMS) is some software that


does the following functions:

 It manages the meta data in the data dictionary. Metadata is data aboutt data. It
includes information about tables i.e. their names, sturcture and relation between
those.
 It allows us to organize the data properly. A dbms arranges the data in chosen
structure automatically.
 It automatically transforms input data as per the requirements of data dictionary.
 It manages an environment to create and enforce securities: We can create
constraints, data validation rules, and define a range of values in dbms.
 It enforces data integrity at all levels as there will not be any anomolies in a DBMS.
 It supports query language to support creation, manipulation and retrievals.

5. Define DBMS. Explain its advantages over traditional file management system.

B- Com II – BDPS & E-Commerce


10 Apoorva Publishers
A database is a collection of logically related data stored in a standardized format and is
sharable by multiple users. DBMS is a collection of database and a set of application
programs that allow us to organize, manipulate and retrieve information.

Advantages DBMS:
 Program-Data Independence: The separation of metadata from the application
programs that use the data is called data independence. This allows data to
change without changing the application programs.
 Minimal Data Redundancy: Unnecessary data can be reduced. There will be not be
any duplicate records. Each primary fact is recorded in only one place in the
database.
 Improved Data Consistency: By eliminating data redundancy, we can improve data
consistency. For example, if a customer address is stored only once, updating that
becomes simple.
 Improved Data Sharing: A database is designed as a shared resource. Authorized
users are granted permission to use the database.
 Enforcement of Standards: These standards will include naming conventions, data
quality standards, and procedures for accessing, updating, and protecting data.
 Improved Data Accessibility: Without any programming experience, one can
retrieve and display data very easily. The language used to write queries is called
Structured Query Language (SQL).
 Focus on data: DBMS focuses on data. It first defines the data and then all queries,
reports and programs to access the data through the DBMS. The DBMS is
responsible for defining, storing and retrieving the data.

6. What are database components?

A database is a collection of logically related data stored in a standardized format.


Database components are
 Database Engine
 Data dictionary
 Query processor
 Report writer

 Database engine: The data base engine is the heart of the DBMS it is responsible for
storing, retrieving and updating the data. The security system of the engine identifies
users and controls access to the data.
 Data dictionary: The data dictionary holds the definitions of all of the data tables. For
example, Microsoft Access keeps a list of all the tables in a hidden system table called
MSYS objects. It actually has meta-data.

B- Com II – BDPS & E-Commerce


Apoorva Publishers 11
 Query processor: The query processor is a fundamental component of the DBMS. It
enables developers and users to store and retrieve data using queries. It executes
queries and fetches results
 Report writer: Most business users want to see summarized data in the form of reports. Many
of the reports follow common formats. A modern report writer enables you to set up the report
on the screen to specify how items will be displayed or calculated.

7. What are database elements?

A database is a collection of logically related data stored in a standardized format. The


primary database elements are tables and queries.

1. Table: Table is a collection of data in the form of rows and columns. Rows are
referred to as records. Columns are referred to as fields.

The other database components like entity, entity-type, entity-instance, entity-set


and attribute are associated with a table.

Entity: An entity is a person, place, object, event or concept in the user


environment about which an organization maintains the data. Some examples are
shown below.

Type ENTITY
Person EMPLOYEE, STUDENT
Place STOREHOUSE, LIBRARY
Object COMPUTER, BOOK

Entity type: A collection of entities that share common properties or


characteristics.

Entity instance: A single occurrence of an entity type is an entity instance. It is a


unique row of a table.

Entity set: An entity set is a named collection of related data. The data within an
entity set are related through their classification. For example, the data in an
EMPLOYEE entity set are related by the fact that only employee data are stored in
this set. In other words, the EMPLOYEE entity set contains a collection on
EMPLOYEE entities. You should not expect to find product entities in an EMPLOYEE
entity set. In simple language, it is a set of rows of a table.

Attribute: Attribute is a property or characteristic of an entity type. It is a field of a


table. For example, STUDENT table may have attributes like name, rno, and marks.
B- Com II – BDPS & E-Commerce
12 Apoorva Publishers
2. Queries: Queries are requests to access or alter the complete or part of
information from a database. Queries restrict the view as per the requirement.
They can include expressions and formulas such as sum, avg. and etc. There are
different types of query commands like DDL commands and DML commands.

Data Definition Language (DDL): DDL commands are used to define a database,
including creating, altering, and dropping tables and establishing constraints. DDL
deals with metadata. It includes command like create, alter, and drop.

Data Manipulation Language (DML): DML commands are used to manipulate and
access a database, including updating, inserting, modifying, and querying data. It
deals with data. It includes command like select, insert, update and delete.

8. What is an attribute? Explain types of attributes. (or) What are the characteristics of
attributes?

Attribute: Attribute is a property or characteristic of an entity type. It is a field of a


table. Following table shows attributes for few entity types:

Entity Attributes / Fields


STUDENT Name, Rno, Marks, Address
EMPLOYEE Ename, Job, Salary, Department

There are several types of attributes, which are discussed below.

1. Composite attribute: Composite attribute is an attribute that can be broken down


into two or more parts.
Example: “Name” attribute can be broken into “First_name” and
“Last_name”.

2. Simple (or atomic) attribute: Simple attribute is an attribute that cannot be


broken down into smaller components.
Example: “Age” attribute can be broken into parts i.e other attributes

3. Single valued attribute: It is an attribute that takes only one value for a given
entity instance.
Example: “Rno” attribute takes only one value for each record. i.e. every student
has only one “Rno”

4. Multivalued attribute: It is an attribute that may take on more than one value for
a given entity instance.

B- Com II – BDPS & E-Commerce


Apoorva Publishers 13
Example: “Languages_known” attribute may take multiple values for each record.
i.e. a student may know more than one language.

5. Derived attribute: It is an attribute whose values can be calculated from related


attribute values.
Example: “Average” attribute is a derived attribute, which can be calculated from
the other attributes “Marks1, Marks2 and Marks3”

6. Identifier attribute: It is an attribute used to identify a row uniquely


Example: “Rno” is an identifier attribute that identifies a row uniquely. It can be
referred to as “primary key attribute”

9. What is a Database Table and what are their components? (OR) What is a key?
Explain types of keys.

Table is a collection of data in the form of rows and columns. Rows are referred to as
records. Columns are referred to as fields.
A table includes several following components, which are called its keys.

Primary key: A primary key cannot allow Null values and must always have a unique
value. It is used to identify each row uniquely. For example, serial number must be
unique and cannot be null and can be selected as primary key.

Composite key: A primary key may be single attribute or may be composed of a


combination of attributes. A primary key that consists of a combination of attributes is
known as composite primary key. For example, if the “education” table contains the
attributes “emp_num” and “dept_code”, neither attribute can itself serve as a proper
primary key. But the combination “emp_num + dept_code” forms a proper primary
key.

Candidate key: Any attribute or combination of attributes that could serve the role as a
primary (PK) but that is not selected to be the PK, is known as candidate key.

Secondary key: A non-primary search key is known as a secondary key. If you don’t
know the PK value, some other attribute or combination of attributes may used for
searching.

Foreign Key: It is an attribute, which establishes the relationship between the tables.
The FK in one table is an attribute that matches the primary key of another table. This
can also be called a reference key.
Example: A matching “Dept_Number” in EMP and DEPT tables. In DEPT table, it is a
Primary Key and in EMP table, it is a Foreign Key.
B- Com II – BDPS & E-Commerce
14 Apoorva Publishers

10. Explain DDL and DML commands.

1. Data Definition Language (DDL): DDL commands are used to define a database,
including creating, altering, and dropping tables and establishing constraints. DDL
deals with metadata. The commands are:

Create To create database objects such as tables, views


Alter To alter the structure of a database object
Drop To delete a database object
Truncate To delete rows with auto commit
Rename To rename the database object

2. Data Manipulation Language (DML): DML commands are used to maintain


and access a database, including updating, inserting, modifying, and querying
data. It deals with data. The commands are:

Select To retrieve data from a table. It allows filtering.


Insert To inert data into a table
Update To update the values of attributes
Delete To delete rows from a table

11. Explain Information System Architecture.

INFORMATION SYSTEM

Software

Operating system

Application DBMS
PEOPLE

programs

Database

Hardware

Information is most important component of the decision making process. To generate


information and manage it there is a need of structured environment. Information
B- Com II – BDPS & E-Commerce
Apoorva Publishers 15
system is used to create structured environments. Information system includes data,
people, hardware, DBMS and software.

Data and Information: It includes facts about people, places things and etc which
require or create meaning to the user’s application.

Database: A database is a collection of logically related data stored in a standardized


format and is sharable by multiple users.

Database Management System (DBMS): DBMS is collection of database and a set of


application programs that allow us to organize, manipulate and retrieve information.

People: People include users, developers, database administrators, network


administrators and etc.

Application programs: These are computer programs, which are used to create and
maintain the database and provide information to users.

Software and Hardware: There is also need of different kinds of software such as
programming languages, Visual interfaces, etc. Similarly, there is a requirement of
hardware, which include network cables, cards, hard disks for backups etc.

SHORT QUESTIONS

12. Define Data and information.

Data: Data are Facts about people, places, things or events. Business data is likely to
include facts about employees, customers, products and so on. Data are recognized as
an important asset because data has the raw material from which information is
derived.

Information: Information is processed data. This is some meaningful form of data and
it is derived from data. Information forms foundation for decision-making.

Data Information
Data is a raw collection of Information is meaningful data
characters, facts in an organized form.
Information is required by the
Data exists with the user
user
It is unprocessed data This is processed data
Required for database analysis Required for decision-making

B- Com II – BDPS & E-Commerce


16 Apoorva Publishers

13. What is Data dictionary?

 Data dictionary is a compilation of data components, their names and their


characteristics.
 It also contains the definitions of the relationships of the data.
 It contains the meta-data (data about data)
 All database activities must be done through data dictionary.

14. What is Storage location?

Storage location is some portion of the computer’s memory that stores data or
programs. Generally, the memory is measured in bits and bytes. Storage location refers
to a group of bytes. Every storage location has some address.

15. What is attribute?

 Attribute is a characteristic of an entity. It refers to a field of a table.


 For example, EMPLOYEE entity is likely to have employee-name, salary, job as its
attributes.
 If the entity is arranged in the table form, columns-headers are nothing but the
attributes.

Entity Attributes / Fields


STUDENT Name, Rno, Marks, Address

There are several types of attributes such as composite attribute, atomic attribute,
derived attribute, storage attribute and so on.

16. What is Database system? (OR) What is DBMS? (OR) What are the functions of
DBMS?

Database Management System (DBMS): DBMS is collection of database and a set of application
programs that allow us to organize, update and retrieve information. A Database Management
System (DBMS) is some software that does the following functions:

 Managing the meta data in the data dictionary


 It allows us to organize the data properly.
 It automatically transforms input data as per the requirements of data dictionary.
 It manages an environment to create and enforce securities.
 It enforces data integrity at all levels.
 It suppots query language.

B- Com II – BDPS & E-Commerce


Apoorva Publishers 17
17. What is primary key?

A primary key cannot allow Null values and must always have unique values. A primary
key is used to relate a table to foreign keys in other tables. It is used to identify each
row uniquely. For example, serial number (must be unique and cannot be null) is a
primary key.

18. What are single attribute and composite attributes?

Composite attributes: An attribute that can be further subdivided into meaningful


components is known as a composite attribute.
Ex: Name is divisible into employee last name and first name.

Single valued attributes: An attribute that can have only one value is called a single
valued attribute.
Ex: Employee contains only one birth date.

19. Explain the terms: entity and entity sets and attribute.

Entity: An entity may be a person, place, thing, event, or even a concept. It may be
tangible or intangible. In short, an entity can be anything you want to keep track of. In a
business environment. Some examples are shown below.

Type ENTITY
Person EMPLOYEE, STUDENT
Place STOREHOUSE, LIBRARY
Object COMPUTER, BOOK
Event SALES, ADMISSION
Concept ACCOUNT, COURSE

Entity set: An entity set is a named collection of related data. The data within an entity
set are related through their classification. For example, the data in an EMPLOYEE
entity set are related by the fact that only employee data are stored in this set. In other
words, the EMPLOYEE entity set contains a collection on EMPLOYEE entities. You
should not expect to find product entities in an EMPLOYEE entity set.
Attribute: Attribute is a property or characteristic of an entity. It can also be called as
“field”. Attributes start with capital letters followed by small case letters. Every
attribute has a value for each record. Following table shows attributes for few entity
types:

B- Com II – BDPS & E-Commerce


18 Apoorva Publishers
Entity Attributes / Fields
STUDENT Name, Rno, Marks, Address
EMPLOYEE Ename, Job, Salary, Department

20. What is foreign key?

Foreign Key: It is an attribute, which establishes the relationship between the tables.
The FK in one table is an attribute that matches the primary key of another table. This
can also be called a reference key.
Example: A matching “Dept_Number” in EMP and DEPT tables. In DEPT table, it is a
Primary Key and in EMP table, it is a Foreign Key.

21. What is Data Processing?

Data Processing is a process of converting data into information. Data processing


involves reading the data, storing the data, manipulating the data and delivering the
data in usable form. More clearly, we can say that; it involves reading, analysing,
sorting, summarizing, calculating, distributing and storing data. Data processing is done
in three different ways.
1. Manual data processing
2. Mechanical Data processing and
3. Electronic data processing.

Types of Data Processing:


 Scientific data processing: Scientific data processing involves more
computations, small amount of input data, small amount of output. In the early
days of computers, the emphasis was upon scientific data processing.
 Commercial data processing: Commercial data processing involves less
computations, large amount of input data, large amount of output. Today, there
is a requirement of commercial data processing in almost every field.

22. What is associative entity?

Associative entity: It is an entity type that associates the instances of one or more
entity types and contains attributes that are peculiar to the relationship between those
entity instances.

In the following example, the associative entity “CERTIFICATE” has the


attributes “Cnum” and “Title” which are peculiar to the relationship. It associates the
instances of “ STUDENT” and “COURSE”.

B- Com II – BDPS & E-Commerce


Apoorva Publishers 19

Associative Entity

Rno Nam Num Date Cnum Title

STUDENT CERTIFICATE COURSE

23. What is metadata?

Metadata: Meta data is data about data. It describes the properties or characteristics
of other data. It includes field names their data types and size. These details are must
while designing the database. This requires defining using languages such as SQL
`
MetaData

Name Rno M1 M2 M3 Total


(Text) (Number) (Number) (Number) (Number) (Number)
Ravi 33 88 74 87 249

B- Com II – BDPS & E-Commerce


20 Apoorva Publishers

UNIT
II 2. Database Design
1) What is Relational Database Model? Explain its advantages. (or) Explain RDBMS.
2) What is an Entity? Explain the types: Strong Entity and Weak Entity.
3) Define a relationship. Explain different types of relationships.
4) What is recursive database design? (Or) Explain recursive relationship.
5) Define normalization and how do you determine normal forms 1NF, 2NF, and 3NF?
6) Explain how a table structure from 1NF to 2NF to 3NF can be changed. (Or) Explain
normalization with examples.
7) Explain the concepts of transitive and partial dependencies in the database design.
Give necessary examples.
8) Explain BCNF with a suitable example.
9) Explain Fourth Normal form with example.
10) Explain ERD symbols and ERD naming conventions. (Or) Explain ERD development
process with suitable example.
11) Explain cardinality constraints.
12) What is anomaly? What are types of anomalies?
13) What is relational database? Draw an E-R Diagram for Employee-Pay-Roll-System.

Short Questions

14) What is ERD? What are ERD segments?


15) What are Weak and Strong Entities?
16) Explain M: N Relationship?
17) What is Recursive relationship?
18) What is Cardinality?
19) Explain one-to-one relationship.
20) Explain Business rules.
21) What is Data Dependency?
22) What is dependency diagram?
23) What are the characteristics of Dependency Diagrams?
24) What is Data redundancy?
25) What is Anomaly?
26) Define Partial and Transitive Dependency?
27) What is the role of ERD in Normalization?
28) What is optional relationship?
29) What is partial dependency?
30) What do you mean by relationship?

B- Com II – BDPS & E-Commerce


Apoorva Publishers 21
1. What is Relational Database Model? Explain its advantages. (or) Explain RDBMS.

The Relational Data Model: E.F.Codd first introduced the relational data model in
1970. The relational data model represents data in the form of tables. The relational
model is based on mathematical set theory. This model considered second-generation
DBMS. A fourth-generation language called SQL (Structured Query Language) is used
for data retrieval.

RDBMS: RDBMS stands for Relational DataBase Management System. The software,
which manages the environment in which the relational database model exists is
RDBMS. The RDBMS takes care of the creation, use and management of the relational
database’s very complex physical details. The database’s structure and composition are
based on Codd’s rules.

Advantages of Relational model:


 In this model, data is arranged in the form of tables.
 This is most common database model for new systems.
 It defines simple tables for each relation and many-to-many relationships.
 Cross-reference keys link the tables together, representing the relationships
between entities.
 Primary and secondary key indexes provide rapid access to data.
 The relational model provides ease of access to nonprogrammers.

2. What is an Entity? Explain the types: Strong Entity and Weak Entity.

Entity: An entity is a person, place, object, event or concept in the user environment
about which an organization maintains the data. Some examples are shown below.

Type ENTITY
Person EMPLOYEE, STUDENT
Place STOREHOUSE, LIBRARY
Object COMPUTER, BOOK
Event SALES, ADMISSION
Concept ACCOUNT, COURSE

There are basically three types of entities:


1. Strong Entity
2. Weak Entity
3. Associative Entity

B- Com II – BDPS & E-Commerce


22 Apoorva Publishers
1. Strong Entity: Strong entity is an entity that does not depend on other entity
types. Examples include entities like STUDENT and EMPLOYEE. Instances of Strong
Entity have unique characteristics.

2. Weak Entity: Weak Entity is an entity type that depends on some other entity
type. This has no meaning without the entity on which it depends. The relationship
between weak entity and a strong entity is called “identifying relationship”. If a
STUDENT receives a CERTFICATE then CERTFICATE is weak entity because there
cannot be any CERTIFICTE without a STUDENT.

3. Associative Entity: These are formed from many to many relationships between
entity types. It contains attributes that are peculiar to the attributes of the entities
that participate in the relationship.

3. Define a relationship. Explain different types of relationships.

Relationship: Relationship is an association established between common fields


(columns) of two or more tables. A relationship can be one-to-one, one-to-many, or
many-to-many.
A relationship works by matching data in key fields usually a field with the same name
(data type must match) in both tables. In most cases, these matching fields are the
primary key in one table and a foreign key in the other table.

one-to-one relationship(1:1):
 In a one-to-one relationship, each record in a column can have only one matching
record in another related column.
 This indicates that one entity is related to only one other entity.
 For example, Each student has a unique roll-number.
 You might use a one-to-one relationship to divide a table with many fields or to
store information that applies only to a subset of the main table.

one-to-many relationship(1:M):
 A one- to- many relationship is the most common type of relationship.
 In a one-to-many relationship, a record in table A can have many matching records
in table B, but a record in table B has only one matching record table A.
 For example, one customer can generate many invoices, but each invoice is
generated by only one customer.
 Similarly, an employee may be assigned to only one department, which may have
many employees assigned to it.

many-to-many relationship(M:N):

B- Com II – BDPS & E-Commerce


Apoorva Publishers 23
 In a many to many relationship, a record in table A can have many matching
records in table B, and a record in table B can have many matching records in table
A.
 This type of relationship is only possible by defining a third table whose primary
key consists of two fields: the foreign keys from both tables A and B.
 A many-to-many relationship is actually a set of one-to-many relationships with
third table. For example, an employee may have earned many degrees: a BA, and
an MBA. And many employees may have earned a BA and an MBA degree
 M:N relationships should never be implemented in a relational database
environment to reduce data redundancy.

4. What is recursive database design? (Or) Explain recursive relationship.

Recursive database design is the one in which recursive relationship exists. Recursive
relationship is a relationship that exists if an entity can be related to itself.

For example, few coursers require one or more other courses as prerequisites. Here
“course entity is related to another course entity” becomes recursive relation ship. It
also happens to be M:N or 1:N relationships also i.e. a course can have many
prerequisites and a course can be a prerequisite to many other courses.

This kind of relationship is a unary relationship because this relationship is between the
instances of a single entity type.

For example, in the following ERDs:

Recursive Relationships

PERSON Is married to EMPLOYEE Manages

One-to-one One-to-many

 “Is married to” is recursive one-to-one relationship between instances of the


PERSON type i.e. one person gets married to another person.
 “Manages” is recursive one-to-many relationship between instances of the
EMPLOYEE type i.e. an employee manages another employee.

B- Com II – BDPS & E-Commerce


24 Apoorva Publishers
To achieve recursive relationship we need to setup recursive foreign key in a table as
shown below:

PK FK
Emp_Num Ename Job Sal Manager_id

This is a foreign key (Manager_Id) in a table that references the primary key
(Emp_Num) values of the same table. Thus, the above relationship is recursive
relationship.

5. Define normalization and how do you determine normal forms 1NF, 2NF, and 3NF?

Normalization:
 The process of changing table structures to increase their normal form rating from
1NF to 2NF to 3NF is normalization.
 It is a step-by-step decomposition of complex records into simple records. In
general, it is used to avoid unnecessary data-redundancy and to retrieve
information easily.
 The relations in a relational database are always normalized. The different forms of
normalization forms are 1NF, 2NF, 3NF and BCNF.

1. First Normal Form (1NF): The lowest possible implementation of normal forms is
1NF. The 1NF condition does not preclude the existence of partial and transitive
dependencies.

A database table in 1NF must satisfy the following conditions:


 The PK entity integrity requirements are met
 Each row/column intersection can contain one and only one value.
 All of the table’s attributes are dependent on the PK.

2. Secondary Normal Form (2NF): This theory is based on partial dependency. A


relation is said to be in 2NF if and only it is in 1NF and every non-key attributes is
fully functionally dependent on every candidate key of the table i.e. secondary-key
attributes should not depend on part of the primary key.

A database table in 2NF must satisfy the following conditions:


 All 1NF conditions are met.
 Contains no partial dependencies.

B- Com II – BDPS & E-Commerce


Apoorva Publishers 25
3. Third Normal From (3NF): This theory is based on the concept of transitive
dependency. A relation is in the 3NF if and only if it is in 2NF and no key attribute is
transitively dependent on the primary key.

A database table in 3NF must satisfy the following conditions:


 Meets all the 2NF conditions.
 Contains no transitive dependencies.

Remove multivalued Remove partial Remove transitive


attributes dependencies dependencies

TABLE FIRST SECOND THIRD


WITH NORMAL NORMAL NORMAL
ANOMALIES FORM FORM FORM

6. Explain how a table structure from 1NF to 2NF to 3NF can be changed. (Or) Explain
normalization with examples.

 The process of changing table structures to increase their normal form rating from
1NF to 2NF to 3NF is normalization.
 It is a step-by-step decomposition of complex records into simple records. In
general, it is used to avoid unnecessary data-redundancy and to retrieve
information easily.
 The different forms of normalization forms are 1NF, 2NF, 3NF and BCNF.

RNO SNAME LANGUAGES_KNOWN SUBJECT FEE


101 Ravi Telugu C++ 2000
Hindi
English

The above table consists of multi-valued attribute (LANGUAGES_KNOWN). This is


removed in 1NF. It consists of partial dependency (SNAME, Subject, FEE are dependent
on RNO i.e. part of Primary Key), which is removed in 2NF. It also contains transitive
dependency (FEE is dependent on SUBJECT) which is removed in 3NF.
First Normal Form (1NF):
A database table in 1NF must satisfy the following conditions:
 The PK entity integrity requirements are met
 Each row/column intersection can contain one and only one value.
 All of the table’s attributes are dependent on the PK.

B- Com II – BDPS & E-Commerce


26 Apoorva Publishers
RNO SNAME LANGUAGES_KNOWN SUBJECT FEE
101 Ravi Telugu C++ 2000
101 Ravi Hindi C++ 2000
101 Ravi English C++ 2000

Secondary Normal Form (2NF):


A database table in 2NF must satisfy the following conditions:
 All 1NF conditions are met.
 Contains no partial dependencies.

RNO SNAME SUBJECT FEE

RNO LANGUAGES_KNOWN

Third Normal From (3NF):


A database table in 2NF must satisfy the following conditions:
 Meets all the 2NF conditions.
 Contains no transitive dependencies.

RNO SNAME SUBJECT

SUBJECT FEE

RNO LANGUAGES_KNOWN

7. Explain the concepts of transitive and partial dependencies in the database design.
Give necessary examples.

1. Partial dependency: A dependency based on only part of the PK (Primary Key) is


known as a partial dependency.

Example: The following table has partial dependency i.e. Sname, Group and Fee
are functionally dependent on part (but not all) of the primary key (Rno).
Table: STUDENT

Rno Sname GROUP Fee Skills

Removing Partial Dependency:

Table: STUDENT

B- Com II – BDPS & E-Commerce


Apoorva Publishers 27
Rno SNAME GROUP Fee

Table: SKILL
Rno Skills

Now, the above is in second normal form (2NF) because it has no partial
dependency. But it has transitive dependency i.e. dependency between “Fee” and
“Group” attributes

2. Transitive dependency: A dependency based on an attribute that is not part of the


primary key is known as transitive dependency.

Removing Transitive Dependency:

Table: GROUPS Table: STUDENT


GROUP Fee Rno Sname GROUP

Table: SKILL
Rno Skills

Now, the above tables are in third normal form (3NF) because it is in second
normal form and has no transitive dependencies.

8. Explain BCNF with a suitable example.

BCNF stands for Boyce-Codd Normal Form. This normal form is considered to be a
special case of 3NF. But, there are few differences between BCNF and 3NF.
3NF is satisfying 2NF and removing transitive dependency. Transitive dependency exists
only when a non-key attribute determines another non-key attribute (Non-key
attribute is the one that is neither a PK [primary key] nor a part of a PK).
But, It is possible for a non-key attribute to be the determinant of PK or part of PK
without violating the 3NF requirements. This is nothing but BCNF. A table is in BCNF if
and only if every determinant in the relation is a candidate key.

Consider the following example:


 Panel 1 exhibits 3NF because it satisfies 2NF and contains no transitive
dependency.
 Panel 2 exhibits only 2NF because it has partial dependency. Here E determines B
and hence can be a part of PK.

B- Com II – BDPS & E-Commerce


28 Apoorva Publishers
 Panel 3 exhibits 3NF and BCNF because it has no transitive dependency and a non-
key attribute E is the determinant of PK. Here E is FK (Foreign Key)

Panel 1: 3NF,
but not BCNF
A B C D E F

Panel 2:
Conversion to
2NF A E C D B F

Panel 3: 3NF
and BCNF A E C D F E B

Consider the following table

SID Subject Faculty


123 Physics Ramesh
123 Computers Arun
423 Physics Ramesh
423 Computers Arun
537 Computers Amar

The above table that is in 3NF can be converted to a table in BCNF using a simple two-
step process.

1. The table is modified so that the determinant in the table that is not a candidate
key( here Faculty) becomes a component of the primary key of the revised table.

SID Faculty Subject

2. Decomposing the table to eliminate the partial functional dependency. Subject


(non-key) is functionally dependent on faculty (key). Thus, there exists partial
B- Com II – BDPS & E-Commerce
Apoorva Publishers 29
functional dependency. Removing this results the following tables which satisfy
BCNF:

SID Faculty Faculty Subject

9. Explain Fourth Normal form with example.

Fourth Normal Form: It is a table in BCNF that contains no multivalued dependencies.


When a relation is in BCNF, there will not be any anomalies. However, there may be
anomalies that result from multivalued dependencies.

Multivalued dependency: The type of dependency that exists when there are at least
three attributes (A, B and C) in a relation, with a well defined set of B and C values for
each A value, but B and C values are independent of each other.

Consider the following table with multivalued dependencies.

Course Faculty Textbook


Java Murali Dietel
Sitaram Norton
Sanjay
Oracle Naveen Peters
Hoffer

Which on removing multiple values for the attributes becomes:

Course Faculty Textbook


Java Murali Dietel
Java Murali Norton
Java Sitaram Dietel
Java Sitaram Norton
Java Sanjay Dietel
Java Sanjay Norton
Oracle Naveen Peters
Oracle Naveen Hoffer

To be in Fourth Normal form, we remove multi-valued dependency in the above table.


And, it is split as:

B- Com II – BDPS & E-Commerce


30 Apoorva Publishers
Course Faculty Course Textbook
Java Murali Java Norton
Java Sitaram Java Dietel
Java Sanjay Oracle Peters
Oracle Naveen Oracle Hoffer

10. Explain ERD symbols and ERD naming conventions. (Or) Explain ERD development
process with suitable example.

ER-Diagram: An E-R Diagram, which consists of graphical components, can express the
overall logical structure of database graphically. It can be treated as a graphical
representation of databases or relationships. The symbols are shown in the diagram:

BASIC SYMBOLS IN ERD


Strong Entity Weak Entity Relationship Identifying relationship

Associative Entity Attribute Multivalued Attribute Derived Attribute

Optionality

Before you represent a database using ERD the following naming conventions must be
followed.
 An entity name is always a noun.
 All entity names must be capitalized
 ERD uses a diamond to represent a relationship. A line connects the relationship to
the entity.
 All relationships must be in lowercase and they must be verbs.
 A relationship must be always written 1 to M side
 A circle includes optional relationship.
 A single character indicates connectivity must be written next to each entity.
 Each entity is labeled to indicate its cardinality.

ERD development Process: To develop an ERD, we first need to understand business


rules and relationship between the tables and cardinality constraints. For example, if
the following are the given business rules, the ERD will be as shown in the diagram
below.

B- Com II – BDPS & E-Commerce


Apoorva Publishers 31
 A customer buys a product or many products.
 Product details must be maintained in product_details book
 An employee, who is a clerk, creates product_details book.

CUSTOMER
1 M PRODUCT
buys
1
needs

M
1 1 1 M
EMPLOYEE is a CLERK writes PROD_DET

The above diagram incorporates all the required entities and relationships including
cardinalities.

11. Explain cardinality constraints.

Cardinality constraint: Specifies the number of instances of one entity that can be
associated with each instance of another entity.

Minimum cardinality: The minimum number of instances of one entity that may be
associated with each instances of one entity
Maximum cardinality: The maximum number of instances of one entity that may be
associated with each instances of one entity
Example:

STUDENT CERTIFICATE
Gets

In the above example, the minimum and maximum cardinalities for CERTIFICATE
are 0 and many. This is called as optional-many cardinality relationship. A STUDENT
may have no CERTIFICATE or many CERTIFICATEs.
Similarly, as the relationship is bi-directional, there is also cardinality notation after
STUDENT entity. Here, both the minimum and maximum cardinalities are one. This is
called as mandatory-one cardinality. In other words, each CERTIFICATE should belong
to exactly one STUDENT. Here, the participation of the STUDENT is mandatory
(compulsory).

B- Com II – BDPS & E-Commerce


32 Apoorva Publishers

12. What is anomaly? What are types of anomalies?

 An anomaly is defined as “a departure from a usual process; abnormality”.


 Any departure from the standard is considered to be an anomaly.
 For example, if the general rule specifies that an employee has a last name, an
employee without the last name would represent an anomaly.
 From a database perspective, anomalies cause the destruction of data integrity.
Anomalies are of 3 types: modification anomalies, insertion anomalies and deletion
anomalies.

1. Modification anomalies: If there is some redundant data, and when you modify
that, the value must be modified in many places. Failure to do so causes
modification anomaly, which results different values for the same attribute.

2. Insertion anomalies: If there is some redundant data, and when you insert new
values for that, the values must be inserted in many places. Failure to do so causes
insertion anomaly, which results different values for the same attribute.
3. Deletion anomalies: If there is some redundant data, and when you delete values
for that, the values must be deleted in many places. Failure to do so causes
deletion anomaly, which results “having values” and “deleted values” for the same
attribute.

13. What is relational database? Draw an E-R Diagram for Employee-Pay-Roll-System.

The relational model was introduced in 1970 by E. F. Codd. In the Relational Model, all
data is maintained in the form of tables consisting of rows and columns. Data in two
tables is related through common columns and not through pointers. This makes
querying much easy in a Relational DBMS. Unlike the Hierarchical and Network models,
there are no physical links in relational model. The relationship type is often shown in a
relational-schema. A table yields complete data and structural independence.

Example: The following set of tables - is an example for Relational Model

Table: EMPLOYEE Table: DEPARTMENT

EmpNo Ename Job DeptNo DeptNo Dept_name


(Foreign Key) PrimaryKey
123 Ravi Manager 10 10 Finance
124 Rajesh Clerk 20 20 Accounts
125 Amar Clerk 10 30 Marketing
126 Kiran Accountant 30

B- Com II – BDPS & E-Commerce


Apoorva Publishers 33
Advantages:
 Structural independence
 Improved conceptual simplicity
 Easier database design, implementation, management, and use
 It can handle complex queries also
 Powerful database management system which isolates end-users from physical
design
Disadvantages:
 Requires large hardware and system software overhead
 Possibility of poor design and implementation
 Potential “islands of information” problems

Following is an ER Diagram for EMPLOYEE-PAYROLL system with the following entities


and attributes:
 Employee (emp_id, emp_name, job)
 Salary (sal_id, emp_id, basic)
 Allowance (allowance_id, emp_id, allowance_amount)
 Deductions (deduction_id, emp_id, deduction_amount)
 Payroll (pay_id, emp_id, pay_date, basic, allowance, deductions, basic, net)

Has

SHORT QUESTIONS

14. What is ERD? What are ERD Segments?

B- Com II – BDPS & E-Commerce


34 Apoorva Publishers

ER-Diagram: An E-R Diagram, which consists of graphical components, can express the
overall logical structure of database graphically. It can be treated as a graphical
representation of databases or relationships. The three different segments of ERD are
listed below:

 Entity: The Entity name is a noun and is generally written in capital letters and is
written in the singular form. An entity is represented in the ERD by a rectangle.
 Attribute: An attribute is represented by an ellipse. Each entity is described by a
set of attributes.
 Relationship: Relationships describe associations among data. The ER model uses
the term connectivity to indicate the relationship types. The name of the
relationship usually is a verb. For example, a PAINTER paints many PAINTINGs.
Relationship is represented by a diamond.

15. What are Weak and Strong Entities?

Weak Entity: Weak entity is the one which depends upon other entities. It is an entity
that meets two criteria:
 It is existence dependent on a related entity.
 Its primary key is at least derived from the related entity’s PK.

Strong Entity: Strong entity is the one which does not depend upon other entities. It is
an entity that meets two criteria:
 It should not be existence dependent.
 The primary key must not be derived
For example, If we are to record STUDENT receiving a CERTIFICATE, we need to have
two entities STUDENT and CERTIFICATE. Here STUDENT becomes strong entity, because
there can be a STUDENT without a CERTIFICATE. And, CERTIFICATE becomes weak
entity, because there cannot be a CERTIFICATE without a STUDENT.

16. Explain M: N Relationship?

many-to-many relationship(M:N):
 In a many to many relationship, a record in table A can have many matching
records in table B, and a record in table B can have many matching records in table
A.
 This type of relationship is only possible by defining a third table whose primary
key consists of two fields: the foreign keys from both tables A and B.

B- Com II – BDPS & E-Commerce


Apoorva Publishers 35
 A many-to-many relationship is actually a set of one-to-many relationships with
third table. For example, an employee may have earned many degrees: a BA, and
an MBA. And many employees may have earned a BA and an MBA degree
 M:N relationships should never be implemented in a relational database
environment to reduce data redundancy.

17. What is Recursive relationship?

 Recursive relationship is a relationship that exists if an entity can be related to


itself.
 For example, few coursers require one or more other courses as prerequisites.
 Here “course entity is related to another course entity” becomes recursive relation
ship.
 It also happens to be an M: N relationship i.e. a course can have many
prerequisites and a course can be a prerequisite to many other courses.

18. What is Cardinality?

 The minimum and maximum values for the entity occurrences that occur in a
related table.
 For example, in a 1: M relationship between CUSTOMER and an optional INVOICE:
 The cardinality (O, N) written next to the CUSTOMER indicates that a customer
may never have generated an invoice or may have generated many invoices.
.
19. Explain one-to-one relationship.

 In a one-to-one relationship, each record in a column can have only one matching
record in another related column.
 This indicates that one entity is related to only one other entity.
 For example, Each student has a unique roll-number.
 You might use a one-to-one relationship to divide a table with many fields or to
store information that applies only to a subset of the main table.
20. Explain Business rules.

Business rules are short and concise statements that establish the existence and
composition of entities, attributes, relationships (expressed in terms of connectives and
cardinalities), and constraints. For example, the following declarations are business
rules.
 No more than one sales representative can be assigned to a customer.
 Each sales representative must be assigned at least one customer.
 A driver may be assigned to many trips.

B- Com II – BDPS & E-Commerce


36 Apoorva Publishers
 A driver may not drive more than 10 hours in any 24-hour period.
 Minimum amount for a bank FDR is 10000 and minimum period is 30 days.

21. What is Data Dependency?

 When the value of one attribute is dependent on another attribute, it is said to be


data dependency.
 A dependency can be indicated as: X  Y (here Y determines the value of X)
 There are two types of data dependencies: partial and transitive dependency.

22. What is dependency diagram?

 When the value of one attribute is dependent on another attribute, it is said to be


data dependency.
 Data dependency diagrams are structures that display all dependencies and their
sources.

Invoice_Code Product_Code Product_Title Customer_Code

Transitive dependency
Partial dependency

23. What are the characteristics of Dependency Diagrams?

Data dependency diagrams are structures that display all dependencies and their
sources.

Characteristics of Data dependency diagrams:


 All attributes are listed by name, and each appears in a rectangle to match its
header. Primary key attributes must be in bold face and underlined.
 The primary key dependencies are shown above the attribute list. The partial and
transitive dependencies are shown below the list.
 The arrows emerge from the determinant and the arrowheads point to the
dependent attributes.

24. What is Data redundancy?

 Existence of Partial and Transitive dependencies is Data redundancy.


 Data redundancy exists when two conditions met:

B- Com II – BDPS & E-Commerce


Apoorva Publishers 37
1. Multiple values of an attribute exist within a table
2. The multiple values are not required to establish relationships between tables.
 In simple terms, it is an excessive data that can be avoided.
 Data redundancy leads to data anomalies.

25. What is Anomaly?

 An anomaly is defined as “a departure from a usual method; abnormality”.


 Any departure from the standard is considered to be an anomaly.
 For example, if the general rule specifies that an employee has a last name, an
employee with out the last name would represent an anomaly.
 From a database perspective, anomalies cause the destruction of data integrity.
Anomalies may be of types: modification anomalies, insertion anomalies and
deletion anomalies.

26. Define Partial and Transitive Dependency?

Partial dependency: A dependency based on only part of the PK (Primary Key) is known
as a partial dependency.

Transitive dependency: A dependency based on an attribute that is not part of the


primary key is known as a transitive dependency.

Note: refer to the diagram in the question: What is dependency diagram?

27. What is the role of ERD in Normalization?

ERD plays very important role in normalization. Although normalization is an important


database design tool, you should not rely on it alone to produce good database
designs. Some tables though they satisfy 3NF structure, they fail to meet design
requirements. For Example, they may use undesirable multi-value attributes. To
produce a viable design, we need to assemble them into structures as dictated by ERD.
We can use ERD techniques to create a set of tables that can be implemented
successfully. Therefore it takes a combination of ERD Techniques and normalization
procedures to produce a well-designed data base system. And this combination yields
an iterative process: produce an initial ERD, check normalization, revise the ERD, check
normalization, and make final revisions as needed.

28. What is optional relationship?

B- Com II – BDPS & E-Commerce


38 Apoorva Publishers
 It is a relationship that exists when an entity occurrence on one side of the
relationship does not require a corresponding entity occurrence on the other side
of the relationship.
 For example a STUDENT may receive one or more CERTIFICATEs but we cannot
expect every STUDENT to have CERTIFICATE.

STUDENT (0,N) CERTIFICATE


receives

29. What is Partial dependency?

Partial dependency: A dependency based on only part of the PK (Primary Key) is known
as a partial dependency.

For example, consider the following table. The field lang_known (which is a part of a
primary key) is a determinant of another field lang_teacher. Thus, there exists partial
dependency between lang_known and lang_teacher.

PK
Stu_ID Lang_Known Name Marks Lang_Teacher

30. What do you mean by Relationship?

Relationship: Relationship is an association established between common fields


(columns) of two or more tables. It tells how an entity can be associated with another
entity. A relationship can be one-to-one, one-to-many, or many-to-many.

A relationship works by matching data in key fields usually a field with the same name
(data type must match) in both tables. In most cases, these matching fields are the
primary key in one table and a foreign key in the other table.

B- Com II – BDPS & E-Commerce


Apoorva Publishers 39

UNIT
III 3. MS-Access: Tables
1) What are elements (database objects) of Access?
2) How do you create a new database?
3) Explain the steps involved in creating a database and creating
relationships with other databases.
4) How do you create a Table?
5) What are various table operations?
6) How do you create a table by entering data in a data-sheet.
7) What is relationship? How do you create relationships between tables?
8) What is a join? Give an account of outer joins.
9) Explain the process of Importing and exporting tables
10) How do you Modify table structure?
11) Write Short note on Input mask?
12) Explain Importing, Exporting, and Linking of files in Access
13) Explain the procedure for the creation of Bank-Customer file

Short Questions

14) What is Access? What are the features of the Access?


15) Explain data entry in tables. (OR) How do you add records to the table?
16) How do you edit the data in a table?
17) What is a data validation?
18) What are Default values?
19) What is equi-join?
20) What are Indexes?
21) What is a database table?
22) What is QBE?

B- Com II – BDPS & E-Commerce


40 Apoorva Publishers

1. What are elements (database objects) of Access?

Database: Database is a collection of related data in an organized form. In MS-Access a


database constitutes of tables, queries, modules, forms and reports.

Elements of Access (Database Objects):

 Table: Table can be a collection of data in the form of rows and columns. Rows are
referred as records. Columns are referred as fields.
 Queries: Queries are requests to access or alter the complete or part of
information from a database. Queries restrict the view as per the requirement.
They can include expressions and formulas such as sum, avg. and etc.
 Forms: Form is a user-friendly on-screen arrangement that makes it easy to alter
and view the data. The main use of forms is on screen, to improve the interface for
data entry. You can add graphics to them and specify shading, colors, styles and
many more.
 Reports: Report is mainly for the purpose of printing needed information of a
table. It is basically a layout that arranges the records in printable form.
 Macros: Macros are tools used to automate repetitive tasks. Macros are basically
actions such as go to record, go to page, find record, beep and etc. These actions
can be stored as macros and can be attached to events.
 Modules: Modules are pieces of code, which get executed upon calling. They give
much programming flexibility. These modules can be attached to any events of
interfacing elements such as buttons.

2. How do you create a new database?

Database is a collection of related data in an organized form. In access a database


constitutes tables, queries, modules, forms and reports.
Database can be created in two different ways:
 Selecting “open blank database”
 Selecting “database wizard”

1. Selecting “open blank database”


 Choose File/New or Ctrl+N (or) click new button on data base tool bar.
 In new dialog box double click on blank database.
 When you see file new data base dialog box type a file name.
 Choose the folder name. By default it is stored in My documents.
 Click “create”.
 You can see a new empty database window.

B- Com II – BDPS & E-Commerce


Apoorva Publishers 41
 Click the New, you will be offered a number of choices. Select table wizard and
click Ok.

2. Selecting “database wizard”


 Select database wizard option.
 It is a method to design databases by a step by step procedure.
 Choose some of the ready made databases like ledger, accounts
 When you see file new data base dialog box type a file name.
 Choose the folder name. By default it is stored in My documents.
 Click “create”.
 Choose columns and sample data if required for your database.
 Choose ready-made templates for applying styles to the forms and reports.
 Click finish.

3. Explain the steps involved in creating a database and creating relationships with
other databases.

A database can be created in two different ways:

a) Selecting “open blank database”


 Choose File/New or Ctrl+N (or) click new button on data base tool bar.
 In new dialog box double click on blank database.
 When you see file new data base dialog box type a file name.
 Choose the folder name. By default it is stored in My documents.
 Click “create”.
 You can see a new empty database window.
 Click the New, you will be offered a number of choices. Select table wizard
and click Ok.

b) Selecting “database wizard”


 Select database wizard option.
 It is a method to design databases by a step by step procedure.
 Choose some of the readymade databases like ledger, accounts
 When you see file new data base dialog box type a file name.
 Choose the folder name. By default, it is stored in My documents.
 Click “create”.
 Choose columns and sample data if required for your database.
 Choose ready-made templates for applying styles to the forms and reports.
 Click finish.
Relationship with other databases: Relationship with other tables can be established
using two ways. While creating a table, click on “link table” or “Import table” and
perform the following steps.
B- Com II – BDPS & E-Commerce
42 Apoorva Publishers
Link Table:
1. This wizard creates tables in the current database that are linked to tables in the
external file
2. When you select this option, it asks for an existing database file.
3. Enter the database file name in the dialog window.
4. Select the tables, you want to link.
5. The linked table appears in the current database.
6. When you alter the records of a table the original table also gets affected.

Import Table:
1. Import table wizard is to import tables from external databases.
2. Choose the database name and table name you would like to import.

4. How do you create a Table?

Table can be a collection of data in the form of rows and columns. Tables can be
created in five different ways that are shown below.
1. Data sheet view
2. Design view
3. Table wizard
4. Link table
5. Import table

1. Data sheet view


 It allows creating new tables in data sheet view i.e. a grid that is similar to Excel
sheet
 In the data grid directly you can rename the field names, which are initially field1,
field2… by default.
 Data can be directly entered into the cells

2. Design View:
 In design view you need to enter the field names first.
B- Com II – BDPS & E-Commerce
Apoorva Publishers 43
 You can also setup data type for each field.
 The size of the fields can be changed or it will have the default values.
 Save the table. Give a name for the table
 Add primary key if required.
 Open the table to add/edit records

3. Table wizard
 Open table wizard.
 Select either business of personal.
 Click on table of interest to view sample fields in the sample fields list.
 To add fields from the sample fields list to your new table you can either double
click on a field name or click on >. To add all fields to your table click on > >.
 To remove field from your table select it and then click on <
 Enter the name of table. Table names can be up to 64 characters long.
 To add primary key click on “set primary key” button,
 You can start entering data into the table that the wizard will create or you can
directly enter data into the table.
 You will see a form, which contains the field names and empty text boxes to enter
the data.
 Save the form by selecting File/Save or Ctrl + S.

4. Link Table:
 This wizard creates tables in the current database that are linked to tables in the
external file
 When you select this option, it asks for an existing database file.
 Enter the database file name in the dialog window.
 Select the tables, you want to link.
 The linked table appears in the current database.
 When you alter the records of a table the original table also gets affected.

5. Import Table:
 Import table wizard is to import tables from external databases.
 Choose the database name and table name you would like to import.

5. What are various table operations?

Table operations include the following:


 Creating a table: Tables can be created in several ways such as Data sheet view,
Design view, Table wizard and so on. When you save the table, it asks for table
name, and conformation of adding a primary key.
 Modifying a table: Select the table, which you want to modify, and click “design”
button. To append an attribute, move to field line and mention name of the
B- Com II – BDPS & E-Commerce
44 Apoorva Publishers
attribute and the data type. To delete an attribute, select the field to be deleted
and click “delete” button. To modify an attribute, click the field name and rename
it or change the data type.
 Adding indexes: MS-Access allows adding indexes. Index speeds up searching and
sorting in a table based on key values. The primary key of a table is automatically
indexed. Some field can’t be indexed because of their data type.
 Data entry: Data entry is entering records for a table. Click “open” button of
“table” dialog box. Enter records directly into the table by pressing “tab” key.
 Deleting a table: To delete a table, select the table and press “delete” button on
the keyboard. It asks for confirmation say “yes” to delete it.
 Creating relationship: To create a relationship, first create two tables and click on
“relationships” option of “tools” menu. It asks you to select tables. Select tables
and drag a field from a table into another table and drop it on the field that
matches with the first.
 Import/export of tables: Import and Export of tables can be done easily by
selecting “import table” from new table dialog window. Select table of some other
databases, or spreadsheet to import tables. To export select “export” option from
“file” menu and proceed further.

6. How do you create a table by entering data in a data-sheet.

Table can be a collection of data in the form of rows and columns. The steps to create a
table using data-sheet view are discussed below:
 Open a new database.
 Select “table” tab form database dialog Window
 Click on “new” button.
 Select “data-sheet view” from the list.
 It allows creating new tables in data sheet view i.e. a grid that is similar to Excel
sheet
 In the data grid directly you can rename the field names, which are initially field1,
field2… by default.
 Data can be directly entered into the cells
 Click on save and give a name for the table when it asks for the name.
 It asks to have a primary key. Select one if you require.

7. What is relationship? How do you create relationships between tables?

Relationship is relating two common columns or columns of same type among multiple
tables. It helps to fetch records from multiple tables.

B- Com II – BDPS & E-Commerce


Apoorva Publishers 45

Procedure to create relationships:


1. Open a new database and Create appropriate tables.
2. Click “relationships” option of “tools” menu.
3. It opens a dialog Window asking you to select tables
4. Select the tables for which you want to create relationship.
5. Drag the field that you want to relate from one table to the related field in the
other table.
6. To drag multiple fields, press the CTRL key and click each field before dragging them.

8. What is a join? Give an account of outer joins.

Join: An association between a field in one table or query and a field of the same data
type in another table or query. This allows us to fetch information from multiple tables.
 A join tells Microsoft Access how data is related.
 When you add tables to a query, and those tables have a defined relationship, MS-
Access automatically creates an inner join that selects records from both tables
when the values in the joined fields are equal.
 You can also create joins manually. Access allows you to create inner joins, outer
joins, and self- joins.
 The outer join is the tailor- made to spot and report the FK/ PK inequalities. The
two types of outer joins are left outer join and right outer join.

Left outer Join: An outer join in which all the records from the left side of the Left Join
operation in the SQL statement are added to the query’s results, even if there are no
matching values in the joined field from the table on the right. This means that a left
outer join returns all the values from the left table, plus matched values from the right
table
Ex: select * from emp,dept where emp.empno = dept.empno (+)

Right outer Join: An outer join in which all the records from the right side of the Right
Join operation in the statement are added to the Query’s results, even if there are no
matching values in the joined field from table on the left. This means that a right outer
join returns all the values from the right table, plus matched values from the left table
Ex: select * from emp,dept where emp.empno(+) = dept.empno

B- Com II – BDPS & E-Commerce


46 Apoorva Publishers

9. Explain the process of Importing and exporting tables

Importing:
 Importing data creates a copy of its information in a new table in your Access
project. The source table or file is not altered in this process.
 When importing data, you can’t append data to existing tables (except when
importing spreadsheet or text files).
 You can also import database objects other than tables such as forms or reports,
from another Access database or Access project.

Exporting:
 Exporting is a way to output data and database objects to another database,
spreadsheet or file format.
 Another database application or program can use the data or database objects.
 Exporting is similar in functionality to copying and pasting. In general, you use the
“Export” command on the “File” menu to export data or database objects.

10. How do you Modify table structure?

MS-Access allows you to modify the structure of a table in the easiest manner. Steps to
modify the structure of a table are discussed below:

1. Open an existing database.


2. Click on “table” tab of database dialog Window.
3. Select the table, which you want to modify, and click “design” button.
4. To append an attribute, move to field line and mention name of the attribute and
the data type.
5. To delete an attribute, select the field to be deleted and click “delete” button.
6. To modify an attribute, click the field name and rename it or change the data type.
7. Click on “save” option of “file” menu.

11. Write Short note on Input mask?

 Input Mask property is used to make data entry easier and to control the values in
a text box control.
 For example, you could create input for a date that shows you exactly how to enter
a new date: “--/--/--”
 We can even restrict the user to enter the input in a preformatted manner.
 It is often easier to use the input mask wizard to set the property for you.
 When you create an input mask, you can use special characters to ensure that
proper data is entered.

B- Com II – BDPS & E-Commerce


Apoorva Publishers 47
 Password is also a setting of input mask
 You can define an input mask by using the following characters.

Character Description
0 Digit (0 to 9, entry required, ‘+’ and ‘–’ signs not allowed).
# Digit or space (entry not required, ‘+’ and ‘–’ signs allowed )
L Letter (A to Z, entry required).
? Letter (A to Z, entry optional).
A Letter or digit (entry required).
A Letter or digit (entry optional).
< Causes all characters to be converted to lowercase.
> Causes all characters to be converted to uppercase.

12. Explain Importing, Exporting and Linking of files in Ms-Access.

It is possible to import, link and export database elements like tables, forms and
reports. These are explained below:

Importing:
 Importing data creates a copy of its information in a new table in your Access
project. The source table or file is not altered in this process.
 When importing data, you can’t append data to existing tables (except when
importing spreadsheet or text files).
 You can also import database objects other than tables such as forms or reports,
from another Access database or Access project.

Exporting:
 Exporting is a way to output data and database objects to another database,
spreadsheet or file format.
 Another database application or program can use the data or database objects.
 Exporting is similar in functionality to copying and pasting. In general, you use the
“Export” command on the “File” menu to export data or database objects.

Linking:
 This wizard creates tables in the current database that are linked to tables in the
external file
 When you select this option, it asks for an existing database file.
 Enter the database file name in the dialog window.
 Select the tables, you want to link.
 The linked table appears in the current database.
 When you alter the records of a table the original table also gets affected.

B- Com II – BDPS & E-Commerce


48 Apoorva Publishers

13. Explain procedure for the creation of a Bank-Customer file.

To Create a Bank-Customer file we need to follow these following steps:


1. Create “Bank” database
2. Create CUSTOMER and ACCOUNTS tables.
3. Create relationship between those tables.

1) Creating Bank database:


 Choose File/New or Ctrl+N (or) click new button on data base tool bar.
 In new dialog box double click on blank database.
 When you see file new data base dialog box type a file name.
 Choose the folder name. By default it is stored in My documents.
 Click “create”.
 You can see a new empty database window.
 Click the New, you will be offered a number of choices.
 Select table wizard and click Ok.

2) Creating Tables:
For CUSTOMER table:
1. Click “tables” tab and then “design view” from the “new table” dialog.
2. Create the CUSTOMER table with the following attributes
Field name Data type
CustomerID(PK) Number
Name Text
Address Text
Pin Number

For ACCOUNTS table:


3. Click “tables” tab and then “design view” from the “new table” dialog.
4. Create the ACCOUNTS table with the following attributes
Field name Data type
AccountNo (PK) Number
AccountType Text
DateOpened Date
Balance Number
CustomerID (FK) Number

B- Com II – BDPS & E-Commerce


Apoorva Publishers 49
5. Save both the tables and enter records appropriately
6. Sample records are shown below

Customer Table
CustomerID Name Address Pin
1001 Ravi 7/g, Mukarampura 505001
1002 Kiran 9/22-1, Vidyanagar 505001
1003 Ramu 8/44, Nakkalagutta 506001
1004 Raju 9-897, Sreenagar 505001
Accounts Table
AccountNo CustomerID AccountType DateOpened Balance
9987 1001 Current 10/12/2008 5000.00
9980 1001 Savings 10/12/2009 2000.00
8811 1002 Savings 01/05/2004 1000.00
4422 1003 Current 12/01/2010 6000.00
3322 1004 Savings 08/22/2007 500.00
3) Creating Relationship
1. Click on the relationships from tools menu.
2. From the appeared dialog box select both the tables to create a relationship
between them.
3. Select the CustomerID of ACCOUNTS table and drag it to CustomerID of
CUSTOMER. Select the check box “Enforce Referential Integrity”
4. The relationship will be created between these two tables.

SHORT QUESTIONS

14. What is Access? What are the features of the Access?

Access is database management software that allows the user to store, organize, find,
sort, display and print the information of a database. Database is an ordered collection
B- Com II – BDPS & E-Commerce
50 Apoorva Publishers
of related data.

Features of MS-Access:
 Stores large amount of data.
 Organizes the data as per the requirement of the user.
 Retrieve information based on the criteria you mention.
 Creates forms that act like user interfaces to work with the database.
 Generates meaningful reports for the purpose of printing.
 Imposes constrains on data to have proper data.

15. Explain data entry in tables. (OR) How do you add records to the table?

To add records to a table, we follow these steps given below.


 Open the database and the table of interest.
 Choose Data Entry from the Records menu. You will see a blank row with a
triangle at its left edge, indicating that the empty row is the current second.3
 Start typing in the first field. Press TAB or ENTER Key to move to the next fields of
interest.
 When you reach the last fields in the last record and presses TAB or ENTER. Access
gives you a new blank record to enter new data

16. How do you edit the data in a table?

We can edit the records of a table manually or using update query.


Editing Manually: To edit records to a table manually, we follow these steps given
below.
 Open the database and the table of interest.
 Move to any column if any record you want to modify.
 Just enter the new value.
 Save the table
Using Update query: To update a table using queries, we follow these steps given
below.
 Click on “queries” tab”
 Select “design view” option from the “new queries” dialog window.
 Add the table from the “show table” dialog.
 Click on “update query” from “query” menu.
 It displays “update to” fields in the design
 Move to “update to” field of required fields and give new values
 Save the query and open it to update values for the fields.

17. What is a data validation?

B- Com II – BDPS & E-Commerce


Apoorva Publishers 51

 Data validation is the process that verifies the proper data entry.
 The validation rule may be set at the table’s field property’s box.
 Data validation ensures appropriate data for fields.
 For example, the validation rule for field “sex” could be “male” or “female”. If the
user tries to enter some other value for that field our application should raise
error.
 To help the end user understand the data entry requirements, the validation rule is
best accompanied by validation text that contains some message and displayed by
a message box.

18. What are Default values?

Default value is a value that is assigned to an attribute automatically without end-


user’s involvement. MS-Access lets you define default values in the properties of a field
such as date. Date may take current date as its default value, avoiding user’s entry for
date.
19. What is equi-join?

 Equi-join links two tables by letting the Foreign key in one table to point to the
Primary key in the related table.
 If the FK in first table as the same values as the PK in second table, the equi-join
can be completed.
 To establish the equi-join, we need the following:
o Tables to be joined.
o Relationship between tables (It must be 1: 1 or 1: M)
 Equi-join fetches records from both the tables that agree with the joining field.

20. What are Indexes?

 Indexes enforce uniqueness on the rows in a table.


 Index speeds up searching and sorting in a table based on key values.
 The primary key of a table is automatically indexed.
 Some field can’t be indexed because of their data type.
 It slows data entry because Microsoft Access must update the indexes each time a
record is added or changed or deleted.

21. What is a database table?

B- Com II – BDPS & E-Commerce


52 Apoorva Publishers
A database table (or, simply a table) is a two-dimensional structure composed of rows
and columns. A table is also called a relation. A table contains a group of related
records. Each record is a collection of unique fields.

The Characteristics (properties) of table:


 A table is a two-dimensional structure composed of rows and columns.
 Each table row is unique.
 Each table column represents a unique attribute with a unique name.
 Each cell represents only one value.
 The order of the rows and columns is not important.
 Each table must have a primary key.

For example, the following table is a valid database-table


EmpNo Ename Job
123 Ravi Manager
124 Rajesh Clerk
125 Amar Clerk

22. What is QBE?

Query-By-Example (QBE) is a direct manipulation database language that uses a


graphical approach to query construction. Here constructing queries is very easy. QBE
is especially useful for end-user database programming. The visual programming
environment gives opportunity to develop queries interactively on a screen in a format
that looks like the desired output.
In most programs, both queries and results are shown in the same format, usually a
spreadsheet-type format. Complete database applications can also be written in QBE.
MS-Access supports QBE.

Advantages:
 QBE is fully visual and very easy to operate.
 Both data retrieval and data modification can be done by entering keywords,
constants, and enter data into the cells of a table layout.
 Even data definition is done through a table layout interface. In MS Access 2000
clicking on an SQL button will reveal the Access SQL code for that data definition.
 Constructing some queries such as self-join query is much easier using a QBE
because its visual representation is clearer than a complex syntax.

B- Com II – BDPS & E-Commerce


Apoorva Publishers 53

UNIT
IV 4. Queries
1) Define the term Query. What are the types of queries?
2) Define query? How do you create a Query?
3) Explain the method of creating a simple select query in MS-Access.
4) Explain the method of creating a cross-tab query in MS-Access.
5) Explain the steps involved in creating a parameter query that prompts for
criteria each time it’s run. List the rules in respect of creation of parameter
queries.
6) What are mathematical delimiters? Explain date constraints based on
mathematical delimiters.
7) What is an action query? Explain the various types of action queries.
8) Explain sorting options in queries and procedure to sort records.
9) How do you perform data organizing (grouping) of records?
10) Explain the process of output formatting using properties box.
11) What is expression builder? How an expression is created?

Short Questions
12) Write a Short notes on Query.
13) What is select query?
14) What is cross tab query?
15) What is a Parameter Query?
16) What is SQL (Structured Query Language)?
17) How do you use wild card characters in queries?
18) What is make table query?

B- Com II – BDPS & E-Commerce


54 Apoorva Publishers

1. Define the term Query. What are the types of queries?

Queries are requests to access or alter the complete or part of information from a
database.

There are several types of queries supported by MS-Access. Types of queries are listed
below

1. Select Query: It allows us to specify desired search criteria. Gives the records as
per the conditions. For example, we can print names of only managers in
“employee” table.

2. Parameter Query: Displays a dialog box prompting you for information.


Forms/Reports use this to display customized forms/reports. Based on the given
parameter, it performs the query.

3. Cross Tab Query: It allows you display the data with row and column headings i.e
in matrix form i.e. with row headings and column headings.

4. Action Query: It does not give any result set but modifies the contents of table or
creates a new table (in the case of “make table”). The subtypes allow you to
append, delete, update and make another table.
 Make Table Query: To create another table from an existing table
 Update Query: To update information of a table
 Append Query: To append records to an existing table
 Delete Query: To delete information from an existing table5.Union Query: A
query used to take union of multiple tables. Here number of columns and their
data types should match.

5. Pass-through Query: It sends commands to sql database.

6. Data Definition Query: Which is another type related to sql and deals with data
definitions and data. Here We can use sql commands directly.

2. Define query? How do you create a Query?

Queries: Queries are requests to access or alter the complete or part of information
from a database.

Queries can be created mainly in three different ways.


1. Design view

B- Com II – BDPS & E-Commerce


Apoorva Publishers 55
2. Simple query wizard
3. Cross tab query wizard

1) Design view:
 Choose new query from the new query dialog box.
 This will bring up a dialog box where you will design the query and enter
your search criteria.
 Add fields you want to include by scrolling through the field list and
double clicking on each field you want to display in your results.
 Be sure to include the field or fields you want to use to specify search
criteria
 Specify sorting options. Do this by clicking sort row. Pick ascending or
another option from the drop down list that is revealed when you click on
the arrow box.
 If you want to limit the display of records to only those meeting search
criteria, type the search criteria in the appropriate criteria box.
 Once you have completed your query, click on the run to run the query
and displaying the resulting dynaset.

Query - Design View

2) Simple query wizard:


 Select simple query wizard
 It displays the list of the tables. Select a table
 Add fields you would like to have in the result using “<” and “<<” buttons

B- Com II – BDPS & E-Commerce


56 Apoorva Publishers
 You can make it a detail report or a summarized report.
 If it is a summarized report add functions like sum, average etc.
 Click “finish”.

3) Cross tab query wizard: It is possible to see the results of queries summarized into
meaningful groups.
 Select the cross tab query wizard or double click on the choice.
 Start reading the wizard dialog boxes, making choices and watching the
example to develop.
 Pick the field or fields to be shown at the left edge of the dynaset
 Specify the field type you want to use to create columns. Double click to
select it click next when you are ready to move.
 You must decide what you want to calculate. You can use the list of function
choices like count, average etc. Pick one.
 Name the query if you like and then click finish.

3. Explain the method of creating a simple select query in MS-Access.

Refer to “design view” in the previous question. (“How do you create a query”)

4. Explain the method of creating a cross-tab query in MS-Access.

Refer to “cross tab query wizard” in the previous question. (“How do you create a
query”)

5. Explain the steps involved in creating a parameter query that prompts for criteria
each time it’s run. List the rules in respect of creation of parameter queries.

Parameter query:
 These are the queries whose output is defined by the specified parameter.
 It does not fetch the result directly like ordinary queries.
 It opens a dialog window asking you to enter values for the “parameters”
 A Parameter query can takes any number of parameters.
 These are best used for customized reports such as monthly collection.
 A parameter query displays one or more predefined dialog boxes that prompt you
for the parameter value.

Procedure for creating a parameter query:


1. Create a “select” or “cross-tab” query.
2. In query Design view, drag the fields from the field list to the query design grid.

B- Com II – BDPS & E-Commerce


Apoorva Publishers 57
3. In the Criteria cell for each field you want to use as a parameter, type a prompt
enclosed in square brackets.
Ex: [enter name:]
4. Microsoft Access will display this prompt when the query is run. The text of the
prompt must be different from the field name.
5. To specify a range of values for dates, in the field's Criteria cell, type
Between [Type the beginning date:] And [Type the ending date:]
6. You can also add data types for parameters by choosing “parameters” option in
“query” menu.

Rules in respect of creation of parameter queries:


 For all parameters, prompt must be used. This should be a user friendly message
which tells the user what to be entered.
 The prompt must be enclosed in square brackets.
 While entering the values, the data type and format should match with as those of
the parameter.
 For NULL values, we should use “Is Null” but not blank.
 Mathematical delimiters can be used for customized result.

6. What are mathematical delimiters? Explain date constraints based on mathematical


delimiters.

Mathematical delimiters:
 Some SQL queries include constraints to fetch the appropriate records.
 The SQL constraint “between-and” can be easily replaced with the mathematical
delimiters.
 Mathematical Delimiters are shown below:

MATHEMATICAL DELIMITERS
DELIMITER MEANING
= Equal to
< Less than
<= Less than or equal to
> Greater than
>= Greater than or equal to
<> Not equal to
We can use the mathematical delimiters on any numeric or date fields.
Example:
 To display employees information, whose salary is greater than 1000 and less than
or equal to 15000. We may write:
>= 1000 and <= 15000 in criteria text field of salary column.
B- Com II – BDPS & E-Commerce
58 Apoorva Publishers
 You can also use mathematical delimiters on date fields as follows:
>= # 1/1/95 # AND <= # 12/31/97 #
The dates must be enclosed in “#” symbols.

7. What is an action query? Explain the various types of action queries.

An action query is a query that makes changes to many records in just one operation.
There are four types of action queries:

 Delete query
 Update query
 Append query
 Make-table query

Delete query: Deletes a group of records from one or more tables. For example you
could use a delete query to remove products that are discontinued or for which there
are no orders. With delete queries, you always delete an entire record, not just
selected fields within records.

Update query: Makes global changes to a group of records in one or more tables. For
example, you can raise prices by 10 percent for all dairy products, or you can raise
salaries by 5 percent for the people within a certain job category. With an update
query, you can change data in existing tables.

Append query: Adds a group of records from one or more tables at the end of one or
more tables. For example, suppose that you acquire some new customers and a
database containing a table of information about those customers. To avoid typing all
this information you’d like to append it to your Customers table. Append queries are
also helpful for appending fields based on criteria.

Make-table query: Creates a new table from all or part of the data in one or more
tables Make-table queries are helpful for:
 Creating a table to export to other Microsoft Access databases.
 Creating data access pages that display data from a specified point in time.
 Making a backup copy of a table
 Creating a history table that contains old records.
 Improving performance of forms and reports.

8. Explain sorting options in queries and procedure to sort records.

B- Com II – BDPS & E-Commerce


Apoorva Publishers 59
Queries allow us to sort records either in ascending or descending order. We also have
then by option which sorts according to the then by column specified, when sort by
column has equal values for more records.

Procedure to sort records:


 Open a new database. Create appropriate tables.
 Enter the data into the table by clicking on “open” button of table dialog Window
 Save the table and click on “query” tab of database dialog Window.
 Clcik on “new” button to open “new query” dialog.
 Click on “design” button.
 Add the tabel and select the fields which you require.
 If you want to sort records according to a particular column move to “sort” list field
of that column.
 Choose ascending / descending option.
 Save the query and open it to view the sorted records.

9. How do you perform data organizing (grouping) of records?

Queries allow us to group records and then perform group functions such as sum,
average, count and etc.

Grouping Records in queries

Procedure to organize (group) records:


 open a new database. Create appropriate tables.
 Enter the data into the table by clicking on “open” button of table dialog Window
 Save the table and click on “query” tab of database dialog Window.
 Clcik on “new” button to open “new query” dialog.
 Click on “design” button.
 Add the tabel and select the fields which you require.
 Before you group, make sure of adding “totals” option i.e click on “totals” option
of “view” menu.

B- Com II – BDPS & E-Commerce


60 Apoorva Publishers
 If you want to group records according to a particular column move to “totals” list
field of that column. And then choose “group by” option.
 Choose another column for which you want to f ind sum/avg/count and move to
“totals” list field. And then choose “sum/avg/count” option.
 Save the query and open it to view the grouped records displying sum/avg/count.

10. Explain the process of output formatting using properties box.

Properties box Output Formatting

Queries allow us to format records as per our requirement. For example, cost of an
item could be displyed in rs or $ or using commas.

Procedure to format records:


 Open a new database. Create appropriate tables.
 Enter the data into the table by clicking on “open” button of table dialog Window
 Save the table and click on “query” tab of database dialog Window.
 Clcik on “new” button to open “new query” dialog.
 Click on “design” button.
 Add the tabel and select the fields which you require.
 Select the coulmn which you want to sort and then click right button.
 It displays a pop-up menu containing “propertis” option.
 Click on “properties” option that opens “field properties dialog box.
 Give values for “tilte” and/or “format” and/or “input mask” as per the
requirement.
 Save the query and open it to view the formatted records.

11. What is expression builder? How an expression is created?

Expression Builder: It is a dialog window that allows us to create expressions that


include fields, operators and functions. The Expression Builder has three sections:

B- Com II – BDPS & E-Commerce


Apoorva Publishers 61
 In the upper section of the builder is an expression box where we build the
expression.
 We can also type parts of the expression directly into the expression box.
 In the middle section of the builder are buttons for commonly used operators.
 We use the lower section of the builder to create elements of the expression. In
the lower section of the builder are three boxes:
o The left box contains folders that list the table, query, form, and report
database objects, built-in and user-defined functions etc.
o The middle box lists specific elements or categories of elements for the folder
selected in the left box.
o The right box lists the values, if any, for the elements, you select in the left and
middle boxes.

Creating an expression using the Expression Builder:


1 Start the Expression Builder.
2 In the lower-left box of the Expression Builder, double-click or click the folder
containing the element you want.
3 In the lower-middle folder, double-click an element to paste it into the expression
box, or click a category of elements.
4 If you select a category in the lower-middle box, values display in the lower-right
box. Double-click a value to paste it in the expression box.
5 Paste any operators you want in the expression and clicking one of the operator
buttons that are in the middle of the builder.
6 When your expression is complete, click OK.

Microsoft Access copies your expression to the location where you started the
Expression Builder.

SHORT QUESTIONS

12. Write Short notes on Query. Give an example

 Query is a question about the data or a request to perform an action on the data.
 A query can bring together data from multiple tables to serve as the source of
data.
 In an MS-Access, you can create a query, and store it as a separate object.
 There are also several types of queries such as select query, action query and etc.
 Queries such as “action queries” perform insertion, deletion, and appending
instead of fetching information.
 Query allows mentioning criteria to limit record set.
 It also finds out sums, averages and etc.
 They can be used to sort the records also.
B- Com II – BDPS & E-Commerce
62 Apoorva Publishers
Example: For example following query is used to get all the records of employee table.
SELECT * FROM EMP;

13. What is select query?

 A select query is the most common type of query.


 It retrieves data from one or more tables and displays the results in a data-sheet
where you can perform operations such as updating, insertion, and deletion.
 You can also use a select query to group records and calculate sums, counts,
averages, and other types of totals.
 A select query selects and displays record for one or more tables. The record

selection may be limited by


o restricting the number of fields to be displayed
o Restricting the record selection based on the some specified limitation.
o Restricting the number of fields to be displayed and the record selection based
on some combination of criteria.

14. What is cross tab query?

 A cross-tab query displays summarized values (sums, counts, and averages) of a


field in the table.
 It groups them by one set of values listed down the left side and another set of
values listed across the top.
 It arranges the data in matrix form.
 It summarizes huge amount of data in a very limited display-area.
 The result includes row headings and column headings and summary columns.
 It is used to overcome the summarizing limitation what we have with select
queries.

B- Com II – BDPS & E-Commerce


Apoorva Publishers 63
15. What is a Parameter Query?

 These are the queries whose output is defined by the specified parameter.
 It does not fetch the result directly like ordinary queries.
 It opens a dialog window asking you to enter values for the “parameters”
 A Parameter query can takes any number of parameters.
 These are best used for customized reports such as monthly collection.
 For example, you can create a monthly collection report based on a parameter
query. When you print the report, MS-Access displays a dialog box asking for the
month for which you want to have report. When you enter the month, MS-Access
prints the appropriate report.

16. What is SQL (Structured Query Language)?

 SQL stands for Structured Query Language


 It allows you to write queries in an easy way
 It is a unified and 4th generation language.
 A user interface uses SQL to interact with the back-end database.

17. How do you use wildcard characters in queries?

Using wild cards in queries: We can use wild card characters in search criteria that are
in queries. They are:
1. Asterisk (*): The asterisk matches any number or uses it as the first or last
characters in the character string.
2. Question mark (?): The question mark character matches any single character, You
can use more than one question mark.

18. What is make-table query?

Make-table query: Creates a new table from all or part of the data in one or more
tables Make-table queries are helpful for:
 Creating a table to export to other Microsoft Access databases.
 Creating data access pages that display data from a specified point in time.
 Making a backup copy of a table
 Creating a history table that contains old records.
 Improving performance of forms and reports.

B- Com II – BDPS & E-Commerce


64 Apoorva Publishers

UNIT
V 5. Forms
1) How do you create a form? (OR) Explain the options available in new
form dialog box.
2) Explain the procedure for creating a form with the Form Wizard.
3) What are main forms and sub-forms? Explain the steps involved in
creating them.
4) What are forms and its prerequisites?
5) Write the features of menus and explain the process of creating menu
form.
6) How do you create customized form letters?
7) Explain the procedure for modifying form’s presentation.
8) What is list box on forms?
9) What is super type/ sub type relationship?
10) Distinguish between linked objects and embedded objects in MS-
Access. Give suitable examples.

Short Questions

11) What is OLE?


12) What is memo field?
13) What are the uses of forms?
14) What are the functions of forms in database application?
15) What are Command Buttons?
16) What are dialog-boxes?
17) What is tab order?
18) What is trim function?
19) What is message box?
20) What is a sub-form?

B- Com II – BDPS & E-Commerce


Apoorva Publishers 65
1. How do you create a form? (OR) Explain the options available in new form dialog box.

Form is a user-friendly on-screen arrangement that makes it easy to alter and view the
data. The main use of forms is on screen, to improve the interface for data entry. You
can add graphics to them and specify shading, colors, styles and many more.
Form can be created in many ways:
 Form wizard
 Design view
 Pivot table wizard.
 Auto tables (column, row, and data sheet).

1. The form wizard:


 Select form wizard in the form dialog window.
 To choose fields, select available fields. You can add fields by using “<” “<<”
buttons.
 You will be presented with a choice of three layouts. You can click on a layout
name to display a brief description of its function at the bottom of the dialog box.
 The wizard will offer some pre-defined style choices. Clicking on the appropriate
radio button chooses them.
 You will be presented with the wizard’s final dialog box, which gives you a chance
to modify the form. This is also where you create a title for your form.
 Click on the finish.

2. Design view:
 You modify forms in design view, which you can reach by clicking on the design
view.
 Forms are broken into three sections. They are Header, Detail, and Footer.
 Headers and footers contain things like form titles, page number and soon. The
detail section is where you specify which fields will be displayed, what they will
look like etc.

B- Com II – BDPS & E-Commerce


66 Apoorva Publishers
 Moving items in forms: To move items in forms is shift to design view and select
the items then drag the selected items. Alignment of the items can be done.
 Adding fields: To add additional fields to a form, drag them from the field list from
the design view.

3. Pivot table wizard: It is useful for printing the records in a matrix form
 Click on the pivot table wizard in form dialog window.
 It opens the pivot table wizard, where you can choose the fields.
 Fields can be placed as rows or columns whose intersection could be another field.
 We can also choose summarized fields such as sum, count

4. Auto table:
 Select the table and choose column auto table, row auto table or data sheet auto
table.
 Forms will be created accordingly i.e. as per their meaning.

2. Explain the procedure for creating a form with the Form Wizard.

1. To create a form with the form wizard, use the following steps:
2. Open the database of your choice and click on the table you want to create the
form
3. Click Forms tab.
4. Click new button in the form window.
5. Select form wizard in the form dialog window.
6. To choose fields, select available fields. You can add fields by using “<” “<<”
buttons.
7. You will be presented with a choice of three layouts. You can click on a layout
name to display a brief description of its function at the bottom of the dialog box.
8. The wizard will offer some pre-defined style choices. Clicking on the appropriate
radio button chooses them.
9. You will be presented with the wizard’s final dialog box, which gives you a chance
to modify the form. This is also where you create a title for your form.
10. Click on the finish.

3. What are main forms and sub-forms? Explain the steps involved in creating them.

Main form and Sub-form:


 The primary form is called the main form and the form within the form is called the
sub-form.
 A form/sub-form combination is often referred to as a hierarchical form, a
master/detail form, or a parent/child form.

B- Com II – BDPS & E-Commerce


Apoorva Publishers 67
 Sub-forms are especially effective when you want to show data from tables or
queries with a one-to-many (1: M) relationship.
 The table on the main form is “one” side of the relationship 1: M. The table on the
sub-form is the “many” side of the relationship.
 The main form and sub-form in this type of form are linked so that the sub-form
displays only records that are related to the current record in the main form.
 For example, when the main form displays the “cool drinks” category, the sub-
form displays only the products of the “cool-drinks” category.
 A main form can have any number of sub-forms and a sub-form can also have
other sub-forms.

Procedure to create main form and sub-form:


1. Create two tables and set up relationship accordingly.
2. In the Database window, click “forms”.
3. Click the “new” button on the Database window toolbar.
4. In the New Form dialog box, double-click Form Wizard in the list.
5. In the first wizard dialog box, select a table or query from the list.
6. Double-click the fields you want to include from this table (“one side of 1: M”) or
query.
7. In the same wizard dialog box, select another table (“main side of 1: M ”) or query
from the list. Double-click the fields you want to include from this table or query.
8. When you click “next”, if you set up the relationships correctly before starting the
wizard the wizard asks which table or query you want to view. Select as per the
requirement.
9. In the same wizard dialog box, select the Form with Sub-form(s) option.
10. Follow the directions in the remaining wizard dialog boxes. When you click
“finish”, Microsoft Access creates two forms: main form and sub-form.

4. What are forms and its prerequisites?

 It is an MS-Access database-object on which you place controls for performing


actions or for entering, displaying, and editing data in fields.
 A form is a formatted data and / or information input device.
 Most forms display table and / or query contents in a predefined format.
 Some are designed to be dialog boxes, while others are used to receive input.
 In a Microsoft Access environment, forms can also be used as a basis for executing
macro commands that open other forms, reports queries.

Prerequisites:
1. A form may be based on one or more tables. The table(s) must exist before the
form is created.

B- Com II – BDPS & E-Commerce


68 Apoorva Publishers
2. A form may be based on one or more queries. The query (or queries) must exist
before the form is created.
3. A form may be used based on a combination of tables and queries.
4. If the form is based on multiple tables, the relationships between those tables
must be established before you try to create the form.
5. A form may be based on an unbound control. An unbound control is one that does
not have a data source attached to it. Unbound controls are commonly used to
create input spaces, labels, and instructions.
6. Forms such as dialog boxes and menus do not use any record source. Selecting the
blank form option from access creates such forms.

5. Write the features of menus and explain the process of creating menu form.

Features of Menus:
 Menus are used to create fully integrated database applications systems.
 Menus are forms that contain labels and command buttons.
 Menus help make the database applications system user-friendly by eliminating
the need to remember command languages.
 Control access by providing only those options that allow people to do their jobs
efficiently, shielding the other database options and components from casual use.
 Provide an environment in which system-level database security is easier to create
and manage. Create an environment that is tailored to specific types of
applications and end users.

Process of creating menus:


1. Open a new database.
2. Create appropriate tables.
3. Click “forms” tab on the database dialog-Window.
4. Select “design view” from the forms Dialog-Window.
5. Drag a command button form the toolbox and place it on the form.
6. In the properties of command button select “picture” and attach a macro or
procedure.
7. Repeat the last two steps for creating some more command buttons.
8. Now the form serves as a menu, collection of several command options.

6. How do you create customized form letters?

Process of creating form letter:


1. Open a new database. Create appropriate tables.
2. Create a report using “label wizard”.
3. Select the report and click on design to convert it into a form letter.

B- Com II – BDPS & E-Commerce


Apoorva Publishers 69
4. Drag the report header to make it large enough to receive the letter header.
5. Select the Label from the toolbox to create an unbound control for entering date.
6. Create the text boxes to print the recipient name and the address, using the bound
text box format. Create a text box to receive the salutation.
7. Next use the toolbox’s Label button to draw a large box and then start typing the
letter.
8. Press the keyboard’s ctrl key and press the enter key to move to new line.
9. Use space bar to introduce spaces instead of using tab button.
10. Use the toolbox’s line button to draw the line just above the page footer.

7. Explain the procedure for modifying form’s presentation.

Form is an interface that displays records and allows modifying them and inserting new
records. It allows the end-user to interact with the database. Forms’ presentation can
be modified as and when needed.

Procedure for modifying form’s presentation:


1. open a new database. Create appropriate tables.
2. Enter the data into the table by clicking on “open” button of table dialog Window
3. Save the table and click on “forms” tab of database dialog Window.
4. Clcik on “new” button to open “new form” dialog.
5. Select a table and click on “auto form: columnar” button.
6. Save the form and click on “design” button after selecting that form.
7. Click right button on the form and select “properties” from the pop-up menu.
8. Change values for the properties such as “height”, “name”, “backcolor” and etc.
9. You can even chang the order or sizes of the controls such as labels and text fields
by selecting them
10. Save the form and open it to view the modified form.

8. What is list box on forms?

List box control displays multiple columns and multiple rows at a time. This saves the
user from taking many text boxes on a form.

Procedure for modifying form’s presentation:


1. open a new database. Create appropriate tables.
2. Enter the data into the table by clicking on “open” button of table dialog Window
3. Save the table and click on “forms” tab of database dialog Window.
4. Clcik on “new” button to open “new form” dialog.
5. Select a table and click on “design view” option
6. Select a list box from the tool box and palce it on th form.

B- Com II – BDPS & E-Commerce


70 Apoorva Publishers
7. It immediately opens “list wizard” asking you to choose “ list box to lookup values
in the table”. Select it and click on “next”
8. choose the table, then fields, then order, then name for the form in sequentially
appearing dialog boxes of list wizard.
9. Save the form and open it to view list field with the records on the form.

9. What is super type/ sub type relationship?

 Super type/ Subtype relationship is a relationship that maintains 1:1 relationship.


 The super type is the entity set that contains common attributes.
 The subtype is the entity set that contains unique attributes.
 This indicates that one entity is related to only one other entity.
 For example, Employees have many unique characteristics such as commission
apart from some common properties such as names.
 These unique attributes (commission) are best stored in a subtype-table.
 The common attributes (names) are best stored in super-type table.
 The super type/ subtype relationship is usually used to avoid nulls.

10. Distinguish between linked objects and embedded objects in MS-Access. Give
suitable examples.

1) Linked Object:
 A linked object maintains its tie to the originating software.
 Therefore, if the original object is changed, the modification is reflected onto the
linked object too.
 A linked object is “dynamic” because it is subjected to frequent changes.
 In Access, it resides in a bound object frame. This is available in the toolbox that
appears when designing a form.

2) Embedded Object:
 An embedded object no longer has ties to the software from which it was
generated.
 Therefore the embedded object is not updated when the original object is
changed.
 An embedded object is “static” because it is not subjected to any changes.
 In Access, it resides in an unbound object frame. This is available in the toolbox
that appears when designing a form.

Example:
 We may use an excel sheet as a linked object. If we perform any changes in the
original excel sheet, then the linked object also gets updated.

B- Com II – BDPS & E-Commerce


Apoorva Publishers 71
 We may use pictures as an embedded object in the case where we don’t need the
changes made to the original picture to be reflected onto the embedded one.

SHORT QUESTIONS

11. What is OLE?

 OLE stands for Object Linking and Embedding.


 This is a protocol by which an object such as spreadsheet, a picture, video sound
etc. can be inserted and used by an application.
 It includes options such as editing, replacing and changing options.
 Some other third party components such as calendar control can also be places on
forms or reports

12. What is memo field?

 Memo field is type of field that is supported by MS-Access.


 It is basically a character type that accepts large text such as documents.
 Generally it displays the field size as 10 characters on screen at the time of creating
the field.

13. What are the uses of forms?

 Forms play a important role in the database applications because they help
connect the end user to the database.
 Forms are used to enter new data and to edit existing data
 It provides logically connected and visually appealing interfaces.
 Data entry and edit procedures are subject to human error. Fortunately, forms
extend the data validation rules through queries, value lists and other input control
devices.
 Forms are used to tie together the database components through menu
structures.
 Forms enable the designer to control database access paths, which deal with
security measures.

14. What are the functions of forms in database application?

Functions of Forms:
 Forms are used to enter new data and modify the existing data.
 Forms provide visually appealing and logically connected interfaces.

B- Com II – BDPS & E-Commerce


72 Apoorva Publishers
 Forms may be designed to extend the data validation rules through queries, lists
etc.
 Forms are used to tie together the database components through menu structures.
Forms can be used to control database access paths.
 End user does not require complete knowledge of database system to operate the
form.

15. What are Command Buttons?

 A command button is a user-interfacing element placed on the form or reports.


 This is used to start an action or a set of actions.
 You can create a command button to activate actions such as opening another
form.
 To make a command button do something on a form, you write a macro or
procedure and attach it to the Button’s on click property.
 You can create several types of command buttons with the command button
wizard.

16. What are dialog-boxes?

 Dialog boxes are special purpose windows that communicate something to a user
or demands response from users.
 It may also take list of options to be selected by the user.
 These are of two types: modal dialog boxes and modeless dialog boxes
 Modeless dialog boxes do not allow the user to work with other Windows unless it
is closed.
 For example, access initial dialog boxes has several tabs such as tables, forms and
etc.

17. What is tab order?

 It is a procedure that controls the sequence of the cursor movements from one
control to another on forms.
 For example, assume you have placed three command buttons on a form and want
to move focus to third button directly, you can change its tab order by clicking on
right button and adjusting the order.
 You can also write value for “tab index” property of “field properties” dialog.

18. What is trim function?

 Trim is a function that removes spaces left side and right side of a string.

B- Com II – BDPS & E-Commerce


Apoorva Publishers 73
 This function can be used in MS-Access modules.
 There are also ltrim (removes spaces left side) and rtrim (removes spaces right
side).
Ex: trim(“ hello ”) gives “hello” whose length now is 5 i.e. after removing spaces

19. What is message box?

 It is a window that enables you to communicate with the end-user by displaying


messages.
 For example if the end user fails to enter a required value, the message box might
display the message “please enter the required value”.
 It demands response from the user i.e. pressing buttons such as “ok”.

20. What is a sub-form?

 Sub-forms are especially effective when you want to show data from tables or
queries with a one-to-many (1: M) relationship.
 The table on the main form is “one” side of the relationship 1: M. The table on the
sub-form is the “many” side of the relationship.
 The main form and sub-form in this type of form are linked so that the sub-form
displays only records that are related to the current record in the main form.
 For example, when the main form displays the “cool drinks” category, the sub-
form displays only the products of the “cool-drinks” category.
 A main form can have any number of sub-forms and a sub-form can also have
other sub-forms.

B- Com II – BDPS & E-Commerce


74 Apoorva Publishers

UNIT
V 6. Reports
1) Discuss the preliminary activities involved in creating a report? (OR)
Explain the options available in new report dialog box.
2) What is a report? What are the components (elements) of a report?
3) Explain the procedure to create a report using report wizard.
4) Explain reports based on cross tab query.
5) Explain procedure for creating Detail line headers (Sub-headers)?
6) Explain the procedure for adding Report graphics and Editing Graphics.
7) Explain how to create report with a subtotals and totals.
8) How to produce mailing labels? (OR) Explain designing of a mailing
label using the label wizard.

Short Questions
9) What is mailing label?
10) What is report?

B- Com II – BDPS & E-Commerce


Apoorva Publishers 75
1. Discuss the preliminary activities involved in creating a report? (OR) Explain the
options available in new report dialog box.

Report is mainly for the purpose of printing needed information of a table. For
example, bills, invoices, account information come under reports. Access provides a
number of ways to put data on paper. Some of these options include.
Reports can be made mainly in three different ways
1. Design view.
2. Report wizard.
3. Auto report.

1. Design view:
 Using design view we can manually create and modify the reports.
 Switch to the database window. Click on the report tab and then on the design
view.
 You will see a design view dialog window.
 The design view window is divided into many report sections like report header,
page header, detail section, page footer and report footer.
 Each section contains controls like text boxes, expressions and soon.
 You make changes to the report by altering these controls and their portieres

2. Report Wizard:
 This can be used to create reports like the list of expenses, sorted by expense
category and payee. We go for advanced reports.
 These reports may contain sub totals of various groups, titles, dates and page
numbers.
 Select table and click “report wizard” in report dialog.
 Choose fields for your report.
 You will be asked how you want the report grouped. You have to specify how to
group data n each field click next.
 You will be asked to choose a layout for you data you can choose vertical or
tabular, portrait or landscape. Select a layout.
 In the style dialog box click on each button and watch the example until you find
the one you like. When you have chosen on appropriate style, click next
 Click “finish”

3. Auto Report:
 Auto report is another way to create basic reports containing headings, page
numbers and so on.
 Choose Auto report form the tool bar.
 Auto report can be made “tabular” or “column” just by selecting the required
option.
B- Com II – BDPS & E-Commerce
76 Apoorva Publishers

2. What is a report? What are the components (elements) of a report?

Report is mainly for the purpose of printing needed information of a table.


The various components of the report are:

a) Report header: The report header contains a label with the report title and other
controls.
b) Page header: Page headers contain information that will repeat on every page.
Like column headings.
c) Detail section: The detail section contains labels and field controls that specify
which data will be printed.
d) Group footers: Group footers are used to specify sub total. Depending on your
report design, you may have more than one group footer or none.
e) Page footer: The page footer contains text and expression that print on each page.
f) Report footer: The report footer contains items that appear only at the end of a
report, like grand totals.

3. Explain the procedure to create a report using report wizard.

This can be used to create reports like the list of expenses, sorted by expense category
and payee. We go for advanced reports.
These reports may contain sub totals of various groups, titles, dates and page numbers.

Procedure for creating report using report wizard:


1. Select the database and create the table.
2. Click the report button and then click the new button in report
3. Select table and click “report wizard” in report dialog.
4. Choose fields for your report.
5. You will be asked how you want the report grouped. You have to specify how to
group data n each field click next.
6. You will be asked to choose a layout for you data you can choose vertical or
tabular, portrait or landscape. Select a layout.
7. In the style dialog box click on each button and watch the example until you find
the one you like. When you have chosen on appropriate style, click next
8. Click “finish”

4. Explain reports based on cross tab query.

Cross-tab queries are wonderful tools that provide very useful summary results. To
create a report based on cross tab query, first create a cross-tab query and use it as a
data source for the report.

B- Com II – BDPS & E-Commerce


Apoorva Publishers 77
1. Select the cross tab query wizard or double click on the choice.
2. Start reading the wizard dialog boxes, making choices and watching the example to
develop.
3. Pick the field or fields to be shown at the left edge.
4. Specify the field type you want to use to create columns. Double click to select it
click next when you are ready to move.
5. You must decide what you want to calculate. You can use the list of function
choices like count, average etc. Pick one.
6. Name the query and save it.
7. Now, open a “new report” dialog window.
8. Select the cross tab query and click on design view.
9. Select all the fields, layout, style and click on “finish”
10. Save the report and again move to layout by clicking on “design” button.
11. Add fields for report footer i.e sum, avg and etc.
12. Save the modifications and open it to view the report based on cross-tab query.

5. Explain procedure for creating Detail line headers (Sub-headers)?

MS-Access allows you to create reports that involve more flexibility. It is possible to
create detail headers (sub-headers) by grouping fields such as month. Report displays
details explicitly for each group i.e. month.

Creating Detail Headers

Process of creating detail headers:


1. Open a new database. Create appropriate tables.
2. Click “reports” tab on Database-Window.
3. Click on “new” button to open “new report” dialog.
4. Select “report wizard” and “ok”. Before clicking “ok” select the table.
5. Select the “fields” for the report.
6. Give a name for the report and Click “finish”.
B- Com II – BDPS & E-Commerce
78 Apoorva Publishers
7. Select the report and click on “design” button.
8. Right click on the report layout and choose “sorting and grouping” option.
9. When it displays “sorting and grouping” dialog box write value for
“field/expression”.
10. Select “group header” option as “yes”
11. It adds group header to the report.
12. Drag the field, which you have used for grouping onto the group header.
13. Save the report to view the report that shows group headers.

6. Explain the procedure for adding Report graphics and Editing Graphics.

MS-Access allows you to add graphics such as charts on reports. For this, we should
make use of chart wizard.

Procedure for adding report graphics:

1. Open a new database. Create appropriate tables.


2. Click “reports” tab on Database-Window.
3. Click on “new” button to open “new report” dialog.
4. Select “report wizard” and “ok”. Before clicking “ok” select the table.
5. Select the “fields” for the report.
6. Give a name for the report and Click “finish”.
7. Select the report and click on “design” button.
8. Click on “chart” option of “insert” menu.
9. Select table for which you want to create chart, and then fields in chart wizard
dialog.
10. Select chart type, chart layout and then a name for your chart in sequentially
appearing dialog boxes.
11. Save the report to view the report that shows group headers.

Procedure for editing report graphics:


1. To edit the chart you have created, select the chart and right click on that.
2. It opens a pop-up menu containing “edit” option.
3. Click on “edit” option to change the properties of the graph.
4. Proceed further to change layout, X,Y values, chart type and etc.

7. Explain how to create report with a subtotals and totals.

 A report is an effective way to present your data in a printed format.


 Because you have control over the size and appearance of everything on a report,
you can display the information in a way you want to see it.

B- Com II – BDPS & E-Commerce


Apoorva Publishers 79
 One of the advantages of using report is that they can provide activity summaries.
 For example, use sales subtotal for each employee, as well as the total sales for al
employees.

Process of creating report with a subtotals and totals:


1. Open a new database. Create appropriate tables.
2. Click “reports” tab on Database-Window.
3. Click on “new” button to open “new report” dialog.
4. Select “report wizard” and “ok”. Before clicking “ok” select the query, which
combines records of both tables.
5. Select the “fields” for the report.
6. It asks you to select the sub group. Select one.
7. Select grouping levels in the next appearing dialog box.
8. In the next dialog box click on “summary options”. Check “sum” option.
9. Choose required layout, styles and then give a name for the report.
10. Click “finish” to view the report that shows sub totals and totals.

8. How to produce mailing labels? (OR) Explain designing of a mailing label using the
label wizard.

Mailing Labels:
 Labels on a form or report or data access page displays short text such as title,
address and etc.
 Like paper clips mailing labels are very handy and yes they are taken for granted.
 These can be then printed, cut and pasted on envelopes.

Procedure to create mailing labels:


1. Open a new database.
2. Create appropriate tables.
3. Click on “reports” tab and then select “label wizard”
4. You may choose label dimensions, the number of labels printed across a page,
label type and so on.
5. Select the “font”. Click “next”
6. Select fields for the label and mention a field for “sort by” option.
7. Click on the “next” button and enter a name.
8. Click on the Finish button to see the label on you screen

SHORT QUESTIONS

9. What is mailing label?

B- Com II – BDPS & E-Commerce


80 Apoorva Publishers
 Labels on a form or report or data access page displays short text such as title,
address and etc.
 Like paper clips mailing labels are very handy and yes they are taken for granted.
 These can be then printed, cut and pasted on envelopes.

10. What is report?

 Report is a way to present information in printed format.


 These are used to print details of records, which are arranged intially in different
layouts and styles.
 It also provides sevral options such as grouping, sorting, creatign detail headers
and adding graphics.

11. Explain Data Types in MS-Access

The following table summarizes all the field data types that are available in Access, the
usage of the data types.

Data Type Usage


Text Text or combinations of text and numbers in the field, such
as addresses.
Memo Lengthy text and numbers, such as notes or descriptions.
Number Numeric data that can be used for mathematical
calculations.
Date/Time Dates and times.
Currency Currency values.
AutoNumber Unique sequential (incrementing by 1) or random numbers
that are automatically inserted when a record is added.
Yes/No Fields that will contain only one of two values, such as
Yes/No, True/False, On/Off.
OLE Object Objects (such as Microsoft Word documents, Microsoft
Excel spreadsheets, pictures, sounds, or other binary data).

B- Com II – BDPS & E-Commerce


Apoorva Publishers 81

BUSINESS
DATA-PROCESSING


Solved
PRACTICAL
QUESTION BANK

B- Com II – BDPS & E-Commerce


82 Apoorva Publishers

1. Create a table named STUDENT with the following structure and set the validation
rules while creating the structure:

FieldName DataType Validation Rules / Constraints

Student # AutoNumber Primary Key

Name Text (20)

Qualification Text (20) MCA or MSc(CS) or BE or ME

Date of Birth Date Between 1st January 1980 and 3 1st March 1985

Enter data in the above table and do the following:

a) Display the names of students whose names begin with 'S'.


b) Display the details of students whose qualification is 'MCA'.
c) Display the details of students whose age is greater than 24.

PROCEDURE:
66333
Creating Table:

1. Open a blank database.


2. Click “tables” tab and then “design view” from the “new table” dialog.
3. Create the STUDENT table with the following attributes

Field name Data type Validation rule


Studentno Auto Primary key
Number
Name Text (20)
Qualification Text (20) MCA or MSC(CS) or BE or ME
Date of birth Date Between 1st January 1980 and 31st March
1985

Implementing validation rules:

1. In the Studentno field select the datatype as “Auto Number” and right click to
select as a Primary Key.

B- Com II – BDPS & E-Commerce


Apoorva Publishers 83
2. In the NAME field select the datatype as “Text” and give the field size as 20 in
“General” tab.
3. In the QUALIFICATION field select the datatype as “Text” and give the field size as
20 in “General” tab.
4. Click on the “look up” tab and select the list box in the “Display Control” row.
5. Select the “value list” in the Row Source Type.
6. Type “MCA”;“MSC(CS)”;“BE”;“ME” in the Row Source.
7. In the DOB(Date of Birth) field select the datatype as “Date/Time”.
8. Click on the “General” tab type “Between #1/1/80# And #3/31/85# in the
Validation Rule field.

Creating queries:

a) Display the names of students whose names begin with 'S'.

1. Select the queries tab and click on the new button.


2. Select “design view” option from the “new queries” dialog window.
3. Add the table STUDENT from the “show table” dialog window.
4. Select all the fields by double clicking on them.
5. In the name field, type “LIKE S*” in the criteria.
6. Save the query.
7. To see the result, select the query and click on the open command button in the
queries tab.

b) Display the details of students whose qualification is 'MCA'.

1. Select the queries tab and click on the new button.


2. Select “design view” option from the “new queries” dialog window.
3. Add the table STUDENT from the showtable dialog window.
4. Select all the fields by double clicking on them.
5. In the Qualification field, type “MCA” in the criteria.
6. Save the query.
7. To see the result, select the query and click on the open command button in the
queries tab.

c) Display the details of students whose age is greater than 24.

1. Select the queries tab and click on the new button.


2. Select “design view” option from the “new queries” dialog window.
3. Add the table STUDENT from the show table dialog window.
4. Select all the fields by double clicking on them.

B- Com II – BDPS & E-Commerce


84 Apoorva Publishers
5. Select the last column and click on “build tool” from the “query design tool bar”,
which opens expression builder.
6. Type the following in the expression toolbar:
AGE: CInt(DateDiff(‘m’,[DOB],Date())/12)
7. In the AGE field, type the formula as “>24” in the criteria.
8. Save the query.
9. To see the result, select the query and click on the open command button in the
queries tab.

2. Create an EMPLOYEE table with the following details:

Employee # Name Basic DA HRA GrossPay


Assume all constraints, enter the data and calculate DA, HRA and Gross Pay.

PROCEDURE:

Creating Table:
1. Open blank new database
2. Click “tables” tab and then select “design view” from the “new table” dialog.
3. Create the EMPLOYEE table with the following attributes with the given constraints

Field name Data type Constraints


Empno Number Primary key
Name Text Not null
Basic Number
Da Number
Hra Number
Grosspay Number

4. Save the table, and open the table to enter records.


5. Enter the values for the fields empno,name,basic,
Calculate the da,hra,grosspay fields using queries.

Creating query:
1. Select queries tab and click on new button from the database dialog Window.
2. Select “design view” option from the “new queries” dialog window.
3. Add “Employee” table from the “show table” dialog.
4. Select “da”, “hra”, “grosspay” fields of the table by double clicking them.
5. Click on “update query” from “query” menu.
6. It displays “update to” fields in the design
7. Move to “update to” field of “da”, “hra” and “grosspay” and enter values as

B- Com II – BDPS & E-Commerce


Apoorva Publishers 85
“[basicpay]*0.1” ,
“[basicpay]*0.2”,
“[basicpay]+[basicpay]*0.1+[basicpay]*0.2” respectively.
8. Save the query and open it to update values for the fields “da”, “hra” and
“grosspay” .

3. Create a table called Student Details by importing the details of students from MS-
EXCEL Worksheet.

PROCEDURE:

Creating Table:

1. Create the STUDENT DETAIL table in MS-EXCEL with the following information.
2. Save the file.

Studentno Name Marks


101 Ramana 500
102 Amani 450
103 Balu 475
104 Chandu 520

Importing table from Excel:

1. Open blank new database.


2. Click “tables” tab and then select “import table” from the “new table” dialog.
3. Select the file of type as “Microsoft Excel” and then select the filename from the
“import” dialog window.
4. Click on “import” button.
5. Then it opens “import spread sheet wizard”. From that you can select the sheet by
clicking on the “show work sheets” option button.
6. Click on next button.
7. Click on the “First row contains Column Headings” check box if you want the first
row as column heading.
8. Click on next button and select “in a new table”.
9. Click on next button. Change the field names if you require.
10. Select the primary key and click on the next.
11. Give a name and save it.

4. Create the CATALOG table with the following fields:

B- Com II – BDPS & E-Commerce


86 Apoorva Publishers
CATALOG
ISBN Title Author Publisher Year Price
Name

Create queries as per the following specifications:


a) Get the details of all the books whose price is between 1000 and 1500.
b) Get the details of all the books whose price is between 1000 and 1500 in the
descending order of the prices.
c) Get the details of all the books whose stock level is zero.

PROCEDURE:

Creating Tables:
1. Open blank new database
2. Click “tables” tab and then “design view” from the “new table” dialog.
3. Create the CATALOG table with the following attributes

Field name Data type


ISBN Number
TITLE Text
AUTHOR Text
PUBLISHER Text
YEAR Number
PRICE Number

4. Save the table and enter appropriate records.

a) Get the details of all the books whose price is between 1000 and 1500.

1. Select the queries tab and click on the new button.


2. Select “design view” option from the “new queries” dialog window.
3. Add the table CATALOG from the “show table” dialog window.
4. Select all the fields by double clicking on them.
5. In the PRICE field, type the formula as BETWEEN 1000 AND 1500 in the criteria.
6. Save the query. To see the result click on the open command button in the queries
tab.

b) Get the details of all the books whose price is between 1000 and 1500 in the
descending order of the prices.

1. Select the queries tab and click on the new button.

B- Com II – BDPS & E-Commerce


Apoorva Publishers 87
2. Select “design view” option from the “new queries” dialog window.
3. Add the table CATALOG from the showtable dialog window.
4. Select all the fields by double clicking on them.
5. In the PRICE field, type the formula BETWEEN 1000 AND 1500 in the criteria.
6. Select the PRICE field, in the sort row, select descending.
7. Save the query. To see the result click on the open command button in the queries
tab.

c) Get the details of all the books whose stock level is zero.

1. Add the column stock to the table by selecting design command button from table
tab.
2. Insert rows for the field stock.
3. Select the queries tab and click on the new button.
4. Add the table CATALOG from the show table dialog window.
5. Select all the fields by double clicking on them.
6. In the STOCK field, type the “0” in the criteria.
7. Save the query. To see the result click on the open command button in the queries
tab.

5. Create a table named PERSON with Name and Age as attributes. Enter the data for 10
rows.

a) Modify the structure of the table to add a new column "Address".


b) Make the name and address as the Primary Key for this table.

PROCEDURE:

Creating Table:
1. Open blank new database
2. Click “tables” tab and then “design view” from the “new table” dialog.
3. Create the PERSON table with the following attributes

Field name Data type


Name Text
Age Number

4. Save table and open it to enter 10 rows.

a) Modify the structure of the table to add a new column "Address".


1. Select the “person” table and click on design.

B- Com II – BDPS & E-Commerce


88 Apoorva Publishers
2. Add the field “address” datatype as text
3. Click on save button.

b) Make the name and address as the Primary Key for this table.

1. Select the “person” table and click on design.


2. Select the name field and right click on the field.
3. From the appeared menu select primary key.
4. Hold the ctrl key and select the address field.
5. Right click on the field address and select the primary key.

6. Create two tables EMPLOYEE and DEPARTMENT with the following details:

EMPLOYEE

Employee # Name Job HireDate Salary DeptNo

DEPARTMENT

DeptNo Name Location

a. Make Employee # and DeptNo the primary keys for EMPLOYEE and DEPARTMENT
tables respectively.
b. Make DeptNo of Employee table, the foreign key for the DEPARTMENT table.
c. Display the details of Employees, whose salary is greater than Rs. 5000.
d. Display the names of places, where different employees are working.

PROCEDURE:

Creating Tables:
1. Open blank new database
For EMPLOYEE table:
2. Click “tables” tab and then “design view” from the “new table” dialog.
3. Create the EMPLOYEE table with the following attributes

Field name Data type


Empno Number
Name Text
Job Text
Hiredate Date

B- Com II – BDPS & E-Commerce


Apoorva Publishers 89
Salary Number
Deptno Number

For DEPARTMENT table:


1. Click “tables” tab and then “design view” from the “new table” dialog.
2. Create
3. the DEPARTMENT table with the following attributes

Field name Data type


Deptno Number
Name Text
location Text

4. Save both the tables and enter records appropriately

a) Make Employee # and DeptNo the primary keys for EMPLOYEE and DEPARTMENT
tables respectively.
1. Click “tables” tab and select the EMPLOYEE table
2. Click on the design.
3. Select the empno field and right click on the field.
4. From the appeared menu select primary key.
5. Click “tables” tab and select the DEPARTMENT table
6. Click on the design.
7. Select the deptno field and right click on the field.
8. From the appeared menu select primary key.

b) Make DeptNo of Employee table, the foreign key for the DEPARTMENT table.
1. Click on the relationships from tools menu.
2. From the appeared dialog box select the tables to create a relationship between
them.
3. Select the deptno of DEPARTMENT table and drag it to deptno of EMPLOYEE.
Select the check box “Enforce Referential Integrity”
4. The relationship will be created between these two tables.

B- Com II – BDPS & E-Commerce


90 Apoorva Publishers

c) Display the details of Employees, whose salary is greater than Rs. 5000.

1. Select the queries tab and click on the new button.


2. Select “design view” option from the “new queries” dialog window.
3. Add the table EMPLOYEE from the “show table” dialog window.
4. Select all the fields by double clicking on them.
5. In the salary field, type the formula as >5000 in the criteria.
6. Save the query. To see the result click on the open command button in the queries
dialog window.

d) Display the names of places, where different employees are working.


1. Select the queries tab and click on the new button.
2. Select “design view” option from the “new queries” dialog window.
3. Add the two tables DEPARTMENT and EMPLOYEE from the “showtable” dialog
window.
4. Select the location and name from the DEPARTMENT table and name from the
EMPLOYEE table.
5. Save the query and run it.

7. Create the CATALOG table with the following fields

CATALOG
ISBN Title Author Publisher Year Price
Name

a) Get the details of all the books whose year of publishing is 2005.
b) Get the details of all the books whose year of publishing is 2002 or 2005.
c) Get the details of all the books whose year of publishing is between 2000 and
2005.

PROCEDURE:

Creating Tables:
1. Open blank new database
2. Click “tables” tab and then “design view” from the “new table” dialog.
3. Create the CATALOG table with the following attributes

Field name Data type


ISBN Number
TITLE Text

B- Com II – BDPS & E-Commerce


Apoorva Publishers 91
AUTHOR Text
PUBLISHER Text
YEAR Number
PRICE Number

4. Save the table and enter appropriate records.

a) Get the details of all the books whose year of publishing is 2005.

1. Select the queries tab and click on the new button.


2. Select “design view” option from the “new queries” dialog window.
3. Add the table CATALOG from the show table dialog window.
4. Select all the fields by double clicking on them.
5. In the YEAR field, type the formula as 2500 in the criteria.
6. Save the query. To see the result click on the open command button in the queries
tab.

b) Get the details of all the books whose year of publishing is 2002 or 2005.

1. Select the queries tab and click on the new button.


2. Select “design view” option from the “new queries” dialog window.
3. Add the table CATALOG from the show table dialog window.
4. Select all the fields by double clicking on them.
5. In the YEAR field, type the formula as 2002 or 2005 in the criteria.
6. Save the query. To see the result click on the open command button in the queries
tab.
c) Get the details of all the books whose year of publishing is between 2000 and 2005.

1. Select the queries tab and click on the new button.


2. Select “design view” option from the “new queries” dialog window.
3. Add the table CATALOG from the show table dialog window.
4. Select all the fields by double clicking on them.
5. In the YEAR field, type the formula as between 2000 and 2500 in the criteria.
6. Save the query. To see the result click on the open command button in the queries
tab.

8. Create the table EMPLOYEE with the following details:

EMPLOYEE
Employee # Name Job HireDate Salary DeptNo

B- Com II – BDPS & E-Commerce


92 Apoorva Publishers
Enter details of 10 employees and create queries as per the following specifications:

a) Modify the Job of all employees to 'MANAGER'.


b) Enhance the salary of all employees by 10%.
c) Delete the details of all the employees, whose salary is less than Rs. 5000 /-.

PROCEDURE:

Creating Table:

1. Open blank new database


2. Click “tables” tab and then “design view” from the “new table” dialog.
3. Create the EMPLOYEE table with the following attributes

Field name Data type


Empno Number
Name Text
Job Text
Hiredate Date
Salary Number
Deptno Number

4. Save the table and enter records appropriately


a) Modify the Job of all employees to 'MANAGER'.

1. Select queries tab and click on new button from the database dialog Window.
2. Select “design view” option from the “new queries” dialog window.
3. Add “EMPLOYEE” table from the “show table” dialog.
4. Select “JOB” field of the table by double clicking it.
5. Click on “update query” from “query” menu.
6. It displays “update to” fields in the design
7. Move to “update to” field of “JOB” and give the formula as “MANAGER”.
8. Save the query and open it to update values for the field “JOB”.

b) Enhance the salary of all employees by 10%.

1. Select queries tab and click on new button from the database dialog Window.
2. Select “design view” option from the “new queries” dialog window.
3. Add “EMPLOYEE” table from the “show table” dialog.
4. Select “SAL” field of the table by double clicking it.
5. Click on “update query” from “query” menu.

B- Com II – BDPS & E-Commerce


Apoorva Publishers 93
6. It displays “update to” fields in the design
7. Move to “update to” field of “SAL” and give the formula as “[SAL]+[SAL]*0.1”.
8. Save the query and open it to update values for the field “JOB”.

c) Delete the details of all the employees, whose salary is less than Rs. 5000 /-

1. Select the queries tab and click on the new button.


2. Select “design view” option from the “new queries” dialog window.
3. Add the table EMPLOYEE from the showtable dialog window.
4. Select the field SAL by double clicking on it.
5. Select the query menu from the menu bar and select the delete query.
6. In the SAL field, type “<5000” in the criteria box.
7. Save the query.
8. To run this query, select the query and click on the open command button in the
queries tab.
9. To view the result, click on the “tables” tab select the table and click on open. You
should see the record missing.

9. Illustrate the use of Append Query.

PROCEDURE:
Creating Tables:
1. Open blank new database
2. Click “tables” tab and then “design view” from the “new table” dialog.
3. Create the STD1, STD2 table with the following attributes

Field Data type


Sname Text
Rno Number
Marks Number

4. Save the tables and enter records.

Creating appending query:

1. Select the queries tab and click on the new button.


2. Select “design view” option from the “new queries” dialog window.
3. Add the table, whose records have to be appended (STD2) -from the “show table”
dialog window.
4. Select all the fields by double clicking on them.
5. Click on the “queries” on the menu bar.

B- Com II – BDPS & E-Commerce


94 Apoorva Publishers
6. Select the append query. Give the name of the table to which you want to append
(STD1) in “append to” field.
7. Save the query. To see the result click on the open command button in the queries
tab.
8. To see the appended records click on the “tables” tab and select the table STD1
and click on the open button.

10. Consider the following tables:

EMPLOYEE
Employee # Name Job HireDate Salary DeptNo

DEPARTMENT
DeptNo Name Location

Enter relevant data and create queries as per the following specifications:

a) Display name and location of the department, where ALLEN is working.


b) Display number and name of all employees who earn more than 2600 in
alphabetical order by name?
c) Write a query that will accept a given job title and displays all rows according to
that title?

PROCEDURE:

Creating Tables:

Note: Create the tables EMPLOYEE and DEPARTMENT using the steps as in question
number 6. Also create the relationship between the two tables and enter appropriate
records.

Creating queries:

a) Display name and location of the department, where ALLEN is working.

1. Select the queries tab and click on the new button.


2. Select “design view” option from the “new queries” dialog window.
3. Add the tables EMPLOYEE and DEPARTMENT from the “showtable” dialog window.

B- Com II – BDPS & E-Commerce


Apoorva Publishers 95
4. Select the fields employee.name, department.name, department. location by
double clicking on them.
5. In the employee name field, type “ALLEN” in the criteria.
6. Save the query. To see the result click on the open command button in the queries
tab.

b) Display number and name of all employees who earn more than 2600 in
alphabetical order by name.

1. Select the queries tab and click on the new button.


2. Select “design view” option from the “new queries” dialog window.
3. Add the table EMPLOYEE from the showtable dialog window.
4. Select all the fields EMPNO,NAME,SALARY by double clicking on them.
5. In the salary field, type >2600 in the criteria.
6. In the NAME field select “ascending” in the sort row.
7. Save the query. To see the result click on the open command button in the queries
tab.

c) Write a query that will accept a given job title and displays all rows according to
that title.
1. Select the queries tab and click on the new button.
2. Select “design view” option from the “new queries” dialog window.
3. Add the table EMPLOYEE from the show table dialog window.
4. Select all the fields by double clicking on them.
5. In the JOB field, type the formula as [ENTER THE JOB TITLE] in the criteria.
6. Save the query. To see the result click on the open command button in the queries
tab.
7. When it asks for “job title” give some job whose records you want to see and click
“OK”.
8. It will display the records with the given job title.

11. Consider the following tables:

EMPLOYEE
Employee # Name Job HireDate Salary DeptNo

DEPARTMENT
DeptNo Name Location

a) Write a query to duplicate the EMPLOYEE table.

B- Com II – BDPS & E-Commerce


96 Apoorva Publishers
b) Calculate the total compensation expense for each department for one year.
c) Find the department number where more than one clerk is working?

PROCEDURE:
Creating Tables:

Note: Create the tables EMPLOYEE and DEPARTMENT using the steps as in question
number 6. Also create the relationship between the two tables and enter appropriate
records.

Creating queries:

a) Write a query to duplicate the EMPLOYEE table.

1. Select the queries tab and click on the new button.


2. Select “design view” option from the “new queries” dialog window.
3. Add the tables EMPLOYEE from the “show table” dialog window.
4. Select all the fields by double clicking on them.
5. Click on the “queries” on the menu bar.
6. Select the make-table query.
7. Give the name for the new table, say “EMP2” in the appeared dialog window.
8. Select the option button “Current Database”.
9. Save the query. To see the result click on the open command button in the queries
tab.
10. Move to table dialog window and you will the new table “EMP2”

b) Calculate the total compensation expense for each department for one year.

1. Select the queries tab and click on the new button.


2. Select “design view” option from the “new queries” dialog window.
3. Add the tables EMPLOYEE from the showtable dialog window.
4. Select the field DEPTNO by double clicking on it.
5. To calculate the total compensation type TSAL: Sum([SAL])*12 in the next column.
6. Right click on the query dialog window. Select the totals from the popup menu.
7. In the DEPTNO field select as group by in the total row.
8. Save the query. To see the result click on the open command button in the queries
tab.

c) Find the department number where more than one clerk is working?

1. Select the queries tab and click on the new button.


2. Add the table EMPLOYEE from the showtable dialog window.

B- Com II – BDPS & E-Commerce


Apoorva Publishers 97
3. Select the fields EMPNO, JOB, DEPTNO by double clicking on them.
4. Right click on the query dialog window. Select the totals from the popup menu.
5. In the EMPNO field select as count in the total row and type “>1” in the criteria.
6. In the JOB field type “CLERK” in the criteria.
7. In the DEPTNO field select as group by in the total row.
8. In the show row deselect EMPNO field check box and JOB field check box to hide
them in the output.
9. Save the query. To see the result click on the open command button in the queries
tab.

12. Create a database named Recruitment, with the tables Application, Interview and
Recruitment. The structure of the tables are given below:

Application

FieldName DataType Validation Rules / Constraints

Cand Id AutoNumber Primary Key

Name Text (20)

Qualification Text (20) MCA or MSc(CS) or BE or ME

Appl_Date Date Between May 15tflto June 30th 2005

B- Com II – BDPS & E-Commerce


98 Apoorva Publishers
Date_of_Birth Date Between 1 January 1980 And 3 1st March 1985
st

Percentage Number Between 70 and 100

Interview

FieldName DataType Validation Rules / Constraints

Intv_Id Auto Number

Cand_id AutoNumber Foreign Key to Cand_Id of Applications table

Intv_Marks Number Between 1 and 100

Recruitment

FieldName DataType Validation Rules / Constraints

Recruit_Id Text(7)

Intv_Id AutoNumber

Join_Date Date > Current Date + 1 month AND <


Current Date + 2 months

Post_Recruited Text(25)

Set the validation rules, while creating the tables and enter data into it.

PROCEDURE:

Creating Table:

1. Click on the new blank database.


2. Give the name as “RECRUITEMENT” and click on the “create” command
button.
3. Click “tables” tab and then select “design view” from the “new table” dialog.
B- Com II – BDPS & E-Commerce
Apoorva Publishers 99
4. Create the APPLICATION table with the given attributes

Field name Data type Validation rule


Cand_id Auto Primary key
Number
Name Text (20)
Qualification Text (20) MCA or MSC(CS) or BE or ME
th th
Appl_date Date Between May 15 and June 30 2005
Date_of_birth Date Between 1st January 1980 and 31st
March 1985
Percentage Number Between 70 and 1000

Implementing validation rules:

1. Select the CAND_ID field select the datatype as “Auto Number” and right click
to select it as a Primary Key.
2. Select the NAME field select the datatype as “Text” and give the field size as
20 in “Field Properties  General” tab.
3. Select the QUALIFICATION field, select the datatype as “Text” and give the
field size as 20 in “General” tab. Click on the “look up” tab and select the list
box in the “Display Control” row.
4. Select the “value list” in the Row Source Type.
5. Type “MCA”;“MSc(CS)”;“BE”;“ME” in the Row Source.
6. In the APPL_DATE field select the datatype as “Date/Time”.
7. Click on the “General” tab type “Between #5/15/05# And #6/30/05#” in the
Validation Rule filed.
8. In the DOB (Date_of_Birth) field select the datatype as “Date/Time”.
9. Click on the “General” tab type “Between #1/1/80# And #3/31/85# in the
Validation Rule field.
10. In the PERCENTAGE field select the datatype as “Number” .
11. Click on the “General” tab type “Between 70 And 100 in the Validation Rule
field.

Create the INTERVIEW table with the following attributes

Field name Data type Validation rule


Intv_id Auto Number Primary key
Cand_id Number Foreign key to Cand_id of Application table.
Intv_Marks Number Between 1 and 100

B- Com II – BDPS & E-Commerce


100 Apoorva Publishers
To make Cand_id, the foreign key of the APPLICAITON table the following steps are
followed.
1. Click on the relationships from tools menu.
2. From the appeared dialog box select the tables to create a relationship
between them.
3. Select the Cand_id of APPLICATION table and drag it on Cand_id of
INTERVIEEW table.
4. Select the check box “Enforce Referential Integrity” and click “OK”.
5. The relationship will be created between these two tables.

6. Select the Intv_ID field, select the datatype as “Auto Number” and right click
to select it as a Primary Key.
7. Select INTV_MARKS field, select the datatype as “Number” .
8. Click on the “General” tab type “Between 1 And 100” in the Validation Rule
field.

Create the RECRUITMENT table with the following attributes

Field name Data Validation rule


type
Recrui_id Text (7)
Intv_id Number
Join_Date Date >Current Date + 1 month AND < Current
Date + 2 month
Post_Recruited Text (25)

1. Select the Recrui_id field, select the datatype as “Text” and give the field size
as 20 in “General” tab.
2. In the Join date field In the APPL_DATE field select the datatype as
“Date/Time”.
3. Click on the “General” tab type “>Dateadd(‘m’,1,date()) And
<Dateadd(‘m’,2,date())” in the Validation Rule field.
4. Select the Post_Recruited field, select the datatype as “Text” and give the field
size as 20 in “General” tab.

13. Using the tables from Question 12, perform the following operations:

a. Create a simple query named Interview List to select only the Cand_Id from
the Applications table with the candidates having above 70% and with the
qualification as MCA or MSc(CS).

B- Com II – BDPS & E-Commerce


Apoorva Publishers 101
b. From the Interview Table, select only the Intv_Id having Intv_Marks of more
than 70, who are to be recruited for posts.
c. Create a look up field for Post_Recruited having the values Software
Engineer, Systems Engineer, Supports Incharge, Senior Manager.

PROCEDURE:

Creating Tables:

Note: Create the tables as in the question number 12

Creating queries:

a) Create a simple query named Interview List to select only the Cand_Id from
the Applications table with the candidates having above 70% and with the
qualification as MCA or MSc(CS).

1. Select the queries tab and click on the new button.


2. Add the table APPLICATION from the showtable dialog window.
3. Select the fields CAND_ID,QUALIFICATION, PERCENTAGE by double clicking on
them.
4. In the QUALIFICATION field type “MCA” OR “MSC(CS)” in the criteria field.
5. In the PERCENTAGE field type the formula as “>70” in the criteria.
6. In the show row deselect QUALIFICATION and PERCENTAGE fields check boxes
to hide them in the output.
7. Save the query with the name Interview List.
8. To see the result select the query and click on the open command button in
the queries tab.

b) From the Interview Table, select only the Intv_Id having Intv_Marks of more
than 70, who are to be recruited for posts.

1. Select the queries tab and click on the new button.


2. Add the table INTERVIEW from the showtable dialog window.
3. Select the fields INTV_ID,INTV_MARKS by double clicking on them.
4. In the INTV_MARKS field type the formula as “>70” in the criteria.
5. Save the query.
6. To see the result, select the query and click on the open command button in
the queries tab.

c) Create a look up field for Post_Recruited having the values Software


Engineer, Systems Engineer, Supports Incharge, Senior Manager.

B- Com II – BDPS & E-Commerce


102 Apoorva Publishers

1. In the “tables” tab select the table RECRUITEMENT and click on the design
command button.
2. Select the POST_RECRUITED field select the datatype as “Text” and give the
field size as 25 from “General” tab.
3. Click on the “look up” tab and select the list box as “Display Control”.
4. Select the “value list” in the Row Source Type.
5. Type “Software Engineer”;“Systems Engineer”;“Supports Incharge”;“Senior
Manager” in the Row Source.
6. When you open the table, you will find a list of values when cursor moves into
the “Post_Recruited” field.

14. Using the tables from Question 12, build a form with the details of candidates
selected for Interview. The details are to be automatically updated to the Interview
table.

PROCEDURE:

Creating Tables:
Note: Create the table “INTERVIEW” as in the question number 12

Creating Form:

1. Click on FORMS tab from the database window. Click on the new button.
2. Select the table INTERVIEW and choose “Auto Form: Columnar”.
3. Save the form as “Interview”.
4. Select the “FORMS” tab.
5. Select the form and click on open button.
6. Enter few records and press “enter”.
7. You will see the new records you have entered in the table when you open it.

15. Using the tables from Question 12, build a form with the details of candidates who
have been recruited to various posts, using the information from the Recruitment
table.

PROCEDURE:

Creating Tables:
Note: Create the table “RECRUITMENT” as in the question number 12

Creating Form:

B- Com II – BDPS & E-Commerce


Apoorva Publishers 103
1. Click on FORMS tab from the database window. Click on the new button.
2. Select the table RECRUITEMENT and choose “Auto Form: Columnar”.
3. Save the form as “Recruitment”.
4. Select the “FORMS” tab.
5. Select the form and click on open button.
6. Enter few records and press “enter”.
7. You will see the new records you have entered in the table when you open it.

16. Create the CATALOG table with the following fields:

CATALOG
ISBN Title Author Publisher Year Price
Name

Create queries as per the following specifications:

a) Find the names of all the books that start with the letter 'C'.
b) Find the details of the book with the title "TechnoTrends".

PROCEDURE:

Creating Table:
1. Open blank new database.
2. Click “tables” tab and then “design view” from the “new table” dialog.
3. Create the CATALOG table with the following attributes

Field name DATA TYPE


ISBN Number
TITLE Text
AUTHOR Text
PUBLISHER Text
YEAR Number
PRICE Number

4. Save the table and enter appropriate records.

Creating queries:

a) Find the names of all the books that start with the letter 'C'.

1. Select the queries tab and click on the new button.

B- Com II – BDPS & E-Commerce


104 Apoorva Publishers
2. Select “design view” option from the “new queries” dialog window.
3. Add the table CATALOG from the show table dialog window.
4. Select all the fields by double clicking on them.
5. In the TITLE field, type “LIKE C*” in the criteria.
6. Save the query.
7. To see the result, select the query and click on the open command button in
the queries tab.

b) Find the details of the book with the title "TechnoTrends".

1. Select the queries tab and click on the new button.


2. Select “design view” option from the “new queries” dialog window.
3. Add the table CATALOG from the show table dialog window.
4. Select all the fields by double clicking on them.
5. In the TITLE field, type “Techno Trends” in the criteria.
6. Save the query.
7. To see the result, select the query and click on the open command button in
the queries tab.

17. Illustrate the use of Make-Table Query.

PROCEDURE:

Creating Tables:
1. Open blank new database
2. Click “tables” tab and then “design view” from the “new table” dialog.
3. Create the STD1 table with the following attributes

Field Data type


Sname Text
Rno Number
Marks Number

4. Save the table and enter records.

Creating make table query:

1. Select the queries tab and click on the new button.


2. Select “design view” option from the “new queries” dialog window.
3. Add the table (STD1) for which you want to have duplicate- from the
showtable dialog window.

B- Com II – BDPS & E-Commerce


Apoorva Publishers 105
4. Select all the fields by double clicking on them.
5. Click on the “queries” on the menu bar.
6. Select the make-table query.
7. Give the name for the new table (STD2) in the appeared dialog window.
8. Select the option button “Currrent Database”.
9. Save the query.
10. To see the result, select the query, click on the open command button in the
queries tab.
11. To see the created tables click on the table tab and select the table STD2 and
click on the open button.

18. Create the CATALOG table with the following fields:

CATALOG
ISBN Title Author Publisher Year Price
Name

Create queries as per the following specifications:


a) Find the price of the book "Rapid Application Development".
b) Change the price of the book "Software Engineering" to Rs. 500/-.
c) Delete the record for the book named "The Internet Applications".

PROCEDURE:
Creating Tables:
1. Open blank new database
2. Click “tables” tab and then “design view” from the “new table” dialog.
3. Create the CATALOG table with the following attributes

Field name DATA TYPE


ISBN Number
TITLE Text
AUTHOR Text
PUBLISHER Text
YEAR Number
PRICE Number

4. Save the table and enter appropriate records.

Creating queries:
a) Find the price of the book "Rapid Application Development".
1. Select the queries tab and click on the new button.

B- Com II – BDPS & E-Commerce


106 Apoorva Publishers
2. Select “design view” option from the “new queries” dialog window.
3. Add the table CATALOG from the showtable dialog window.
4. Select all the fields by double clicking on them.
5. In the TITLE field, type Rapid Application Development in the criteria box.
6. Save the query.
7. To see the result, select the query and click on the open command button in
the queries tab.

b) Change the price of the book "Software Engineering" to Rs. 500/-.


1. Select the queries tab and click on the new button.
2. Select “design view” option from the “new queries” dialog window.
3. Add the table CATALOG from the showtable dialog window.
4. Select the fields TITLES, PRICE by double clicking on them.
5. Select the query menu from the menu bar and select the update query.
6. Select the PRICE field and type the formula “500” in the update to row.
7. In the TITLE field, type the formula as “Software Engineering” in the criteria
box.
8. Save the query.
9. To see the result, select the query and click on the open command button in
the queries tab.

c) Delete the record for the book named "The Internet Applications".

1. Select the queries tab and click on the new button.


2. Select “design view” option from the “new queries” dialog window.
3. Add the table CATALOG from the showtable dialog window.
4. Select the field TITLE by double clicking on it.
5. Select the query menu from the menu bar and select the delete query.
6. In the TITLE field, type the formula as “The internet applications” in the
criteria box.
7. Save the query.
8. To run this query, select the query and click on the open command button in
the queries tab.
9. To view the result, click on the “tables” tab select the table and click on open.
You should see the record missing.

19. Generate a report based on the tables Stud_DetaiIs, Marks_Details,


Group_Mast_Details and place it in the Students Report, using the Report
Wizard.

STUD DETAILS

B- Com II – BDPS & E-Commerce


Apoorva Publishers 107
Stud_id Name DOB Address Group_Id
GROUP MAST DETAILS
Groupld Group_Name

MARKS DETAILS
Stud_id PCS BE MM OA TOTAL

PROCEDURE:

Creating Table:
1. Open blank new database
2. Click “tables” tab and then “design view” from the “new table” dialog.
3. Create the STUD_DETAILS, GROUP_MAST_DETAILS, MARKS_DETAILS tables
with the following attributes

Field name Data type Field name Data type Field name Data type
Studid Number Groupid Number Studid Number
Name Text Group_Name Text PCS Number
DOB Date BE Number
Address Text MM Number
GroupId Number OA Number
TOTAL Number
4. Create the relationship between Stud_Id of STUD_DETAILS table and Stud_Id
of MARKS_DETAILS table. Using Toolsrelationships
5. Also, create the relationship between Group_id of GROUP_MAST_DETAILS and
Group_Id of STUD_DETAILS table. Using Toolsrelationships
Creating report:

1. Select reports tab and click on new button from the database dialog Window.
2. Select “Report wizard” option from the “new report” dialog window.
3. Select all the fields from three tables ( Select 3 tables from the combo box )
and click on next.
4. Select the field on which you want to sort the records in ascending or
descending order.
5. Click on next and select any one layout.
6. Click on next and select any style.
7. Click on next and give the name for report to save.
8. Open the report to see the result.

20. Create a macro that saves the report StudentsReport whenever an updation is
performed on the tables of Q.No 19

B- Com II – BDPS & E-Commerce


108 Apoorva Publishers
PROCEDURE:
Creating Table:
Refer to question number 19, i.e. create the table as in the question 19

Create a report:
Refer to question number 19, i.e. create the report as in the question 19

Procedure for creating a macro and attaching it to a command button:


1. In the Database window, click the Macros tab.
2. Click New.
3. It opens “macro” dialog Window.
4. Select the following actions and action arguments
Action Action Arguments
RunCommand SaveRecord
OpenReport StudentReport
Save StudentReport

5. Save the macro and give a name say macro1.


6. Open a new form by clicking “forms” tab and then “new” button.
7. Select auto-form:tabular for the table student.
8. Save the form
9. Open this form in design mode.
10. Select a command button from the toolbox and place it on the form.
11. It immediately opens a command button wizard.
12. Choose “miscellaneous” option from “categories” list.
13. Choose “run macro” option from “actions” list.
14. It asks for the name of the macro, which you have created.
15. Save the form and open it.
16. It displays the command button with macro icon on it.
17. Click the command button to run.
18. This macro saves updates the data and saves the report also.

Adding a Macro to a command button

B- Com II – BDPS & E-Commerce


Apoorva Publishers 109
21. Create a list of labels regarding the addresses of all of your classmates.

PROCEDURE:

Creating a suitable Table for labels:

1. Open blank new database


2. Click “tables” tab and then “design view” from the “new table” dialog.
3. Create the table ADDRESS with the following attributes

Field Data type


FirstName Text
LastName Text
Hno Text
Street Text
City Text
District Text
Pin Number

4. Save the table and enter records.

Creating labels:
1. Click on “reports tab” from database-Window.
2. Select the table and “label-wizard” option from the “new report” dialog.
3. Select the table name before you say “ok”
4. Choose the size and style in the next dialog boxes.
5. Choose the fields for the mailing list i.e. “name”, “house_no”, “street”, “city”.
6. Save the report. Click on “finish”.
7. Select a rectangle and draw in such a way that it covers all the textboxes.
8. Move to “rectangle” properties. Type the value “transparent” “format  back
style”
9. Save the report and run it to view the results.

B- Com II – BDPS & E-Commerce


110 Apoorva Publishers

BDPS : VIVA –QUESTIONS


1. What is Data?
Data is a raw collection of characters, facts about objects. Data includes text, graphics,
images, sound, etc that have meaning in the user’s environment.

2. What is Information?
Information is meaningful data in an organized form. Information is processed data that
increases the knowledge of the person who uses the data

3. What is Metadata?
Meta data is data about data. It describes the properties or characteristics of other data. It
includes field names, data-types and their size.

4. What are the disadvantages of File Management System?


 Program data dependence
 Duplication of data
 Limited data sharing
 Lengthy development times
 Excessive program maintenance

5. What is a database?
A database is a collection of logically related data stored in a standardized format and is
sharable by multiple users.

6. What is Database Management System (DBMS)?


DBMS is a collection of database and a set of application programs that allow us to organize,
manipulate and retrieve information.

7. What are the Functions of DBMS?


 It manages the meta data in the data dictionary.
 It allows us to organize the data properly.
 It automatically transforms input data as per the requirements of data dictionary.
 It supports query language to support creation, manipulation and retrievals.

8. What are the Advantages DBMS?


 Program-Data Independence:
 Minimal Data Redundancy:
 Improved Data Consistency:
 Improved Data Sharing:
 Enforcement of Standards:
 Improved Data Accessibility:
 Focus on data:

B- Com II – BDPS & E-Commerce


Apoorva Publishers 111
9. What are database components?
 Database Engine
 Data dictionary
 Query processor
 Report writer

10. What is Database engine?


The data base engine is the heart of the DBMS it is responsible for storing, retrieving and
updating the data. The security system of the engine identifies users and controls access to
the data.

11. What is Data dictionary?


The data dictionary holds the definitions of all of the data tables. For example, Microsoft
Access keeps a list of all the tables in a hidden system table called MSYS objects. It actually
has meta-data.

12. What are database elements?


Tables, queries, forms, reports and etc.

13. What is a Table?


Table is a collection of data in the form of rows and columns. Rows are referred to as
records. Columns are referred to as fields.

14. What is an Entity?


An entity is a person, place, object, event or concept in the user environment about which
an organization maintains the data. Some examples are shown below.

15. What is an Entity type?


A collection of entities that share common properties or characteristics.

16. What is Entity instance?


A single occurrence of an entity type is an entity instance. It is a unique row of a table.

17. What is an Entity set?


An entity set is a named collection of related data. The data within an entity set are related
through their classification. In simple language it is a set of rows of a table.

18. What is an attribute?


Attribute is a property or characteristic of an entity type. It is a field of a table. For example,
STUDENT table may have attributes like name, rno, and marks.

19. What is a Query?


Queries are requests to access or alter the complete or part of information from a database.
Queries restrict the view as per the requirement.

B- Com II – BDPS & E-Commerce


112 Apoorva Publishers
20. What is DDL?
DDL stands for Data Definition Language. DDL commands are used to define a database,
including creating, altering, and dropping tables and establishing constraints. DDL deals
with metadata. It includes command like create, alter, and drop.

21. What is DML?


DML stands for Data Manipulation Language. DML commands are used to manipulate and
access a database, including updating, inserting, modifying, and querying data. It deals
with data. It includes command like select, insert, update and delete.

22. What is Composite attribute?


Composite attribute is an attribute that can be broken down into two or more parts.
Example: “Name” attribute can be broken into “First_name” and “Last_name”.

23. What is Simple (or atomic) attribute?


Simple attribute is an attribute that cannot be broken down into smaller components.
Example: “Age” attribute can be broken into parts i.e other attributes

24. What is Single valued attribute?


It is an attribute that takes only one value for a given entity instance.
Example: “Rno” attribute takes only one value for each record. i.e. every student has only
one “Rno”

25. What is Multivalued attribute?


It is an attribute that may take on more than one value for a given entity instance.
Example: “Languages_known” attribute may take multiple values for each record. i.e. a
student may know more than one language.

26. What is Derived attribute?


It is an attribute whose values can be calculated from related attribute values.
Example: “Average” attribute is a derived attribute, which can be calculated from the other
attributes “Marks1, Marks2 and Marks3”

27. What is Identifier attribute?


It is an attribute used to identify a row uniquely. Example: “Rno” is an identifier attribute
that identifies a row uniquely. It can be referred to as “primary key attribute”

28. What is a Primary key?


A primary key cannot allow Null values and must always have a unique value. It is used to
identify each row uniquely. For example, serial number must be unique and cannot be null
and can be selected as primary key.
29. What is a Composite key?
A primary key may be single attribute or may be composed of a combination of attributes. A
primary key that consists of a combination of attributes is known as composite primary key.

B- Com II – BDPS & E-Commerce


Apoorva Publishers 113
For example, if the “education” table contains the attributes “emp_num” and “dept_code”,
neither attribute can itself serve as a proper primary key. But the combination “emp_num +
dept_code” forms a proper primary key.

30. What is a Candidate key?


Any attribute or combination of attributes that could serve the role as a primary (PK) but
that is not selected to be the PK, is known as candidate key.

31. What is a Secondary key?


A non-primary search key is known as a secondary key. If you don’t know the PK value,
some other attribute or combination of attributes may used for searching.

32. What is a Foreign Key?


It is an attribute, which establishes the relationship between the tables. The FK in one table
is an attribute that matches the primary key of another table. This can also be called a
reference key. Example: A matching “Dept_Number” in EMP and DEPT tables. In DEPT table,
it is a Primary Key and in EMP table, it is a Foreign Key.

33. List few DDL commands.


Create To create database objects such as tables, views
Alter To alter the structure of a database object
Drop To delete a database object
Truncate To delete rows with auto commit
Rename To rename the database object

34. List few DML commands


Select To retrieve data from a table. It allows filtering.
Insert To inert data into a table
Update To update the values of attributes
Delete To delete rows from a table

35. What is Data Processing?


Data Processing is a process of converting data into information. Data processing involves
reading the data, storing the data, manipulating the data and delivering the data in usable form.

36. What are the different ways of Data processing?


o Manual data processing
o Mechanical Data processing and
o Electronic data processing.

37. What are the Types of Data Processing?


 Scientific data processing: Scientific data processing involves more computations,
small amount of input data, small amount of output.

B- Com II – BDPS & E-Commerce


114 Apoorva Publishers
 Commercial data processing: Commercial data processing involves less
computations, large amount of input data, large amount of output.

38. What is Relational Data Model?


E.F.Codd first introduced the relational data model in 1970. The relational data model
represents data in the form of tables. The relational model is based on mathematical set
theory. This model considered second-generation DBMS. A fourth-generation language
called SQL (Structured Query Language) is used for data retrieval.

39. What is RDBMS?


RDBMS stands for Relational DataBase Management System. The software, which manages
the environment in which the relational database model exists is RDBMS. The RDBMS takes
care of the creation, use and management of the relational database’s very complex
physical details.

40. What are the types of entities?


1. Strong Entity
2. Weak Entity
3. Associative Entity

41. What is Strong Entity?


Strong entity is an entity that does not depend on other entity types. Examples include
entities like STUDENT and EMPLOYEE. Instances of Strong Entity have unique
characteristics.

42. What is Weak Entity?


Weak Entity is an entity type that depends on some other entity type. This has no meaning
without the entity on which it depends. The relationship between weak entity and a strong
entity is called “identifying relationship”. If a STUDENT receives a CERTFICATE then
CERTFICATE is weak entity because there cannot be any CERTIFICTE without a STUDENT.

43. What is associative entity?


It is an entity type that associates the instances of one or more entity types and contains
attributes that are peculiar to the relationship between those entity instances.

44. What is a relationship?


Relationship: Relationship is an association established between common fields (columns)
of two or more tables. A relationship can be one-to-one, one-to-many, or many-to-many.

45. What is one-to-one relationship(1:1)?


In a one-to-one relationship, each record in a column can have only one matching record in
another related column.

46. What is one-to-many relationship(1:M)?

B- Com II – BDPS & E-Commerce


Apoorva Publishers 115
In a one-to-many relationship, a record in table A can have many matching records in table
B, but a record in table B has only one matching record table A.

47. What is many-to-many relationship(M:N)?


In a many to many relationship, a record in table A can have many matching records in table
B, and a record in table B can have many matching records in table A.

48. What is Normalization?


The process of changing table structures to increase their normal form rating from 1NF to
2NF to 3NF is normalization. It is a step-by-step decomposition of complex records into
simple records. In general.

49. What are the types of Normalizations?


The different forms of normalization forms are 1NF, 2NF, 3NF, BCNF and 4NF.

50. What is First Normal Form (1NF)?


A database table in 1NF must satisfy the following conditions:
 The primary key is set.
 Each row/column intersection can contain one and only one value.
 All of the table’s attributes are dependent on the PK.

51. What is Secondary Normal Form (2NF)?


A database table in 2NF must satisfy the following conditions:
 All 1NF conditions are met.
 Contains no partial dependencies.

52. What is Third Normal From (3NF)?


A database table in 3NF must satisfy the following conditions:
 Meets all the 2NF conditions.
 Contains no transitive dependencies.

53. What is BCNF?


BCNF stands for Boyce-Codd Normal Form. A table is in BCNF if and only if every
determinant in the relation is a candidate key.

54. What is Fourth Normal form (4NF)?


It is a table in BCNF that contains no multivalued dependencies.

55. What is Partial dependency?


A dependency based on only part of the PK (Primary Key) is known as a partial dependency.

56. What is Transitive dependency?


A dependency based on an attribute that is not part of the primary key is known as
transitive dependency.

B- Com II – BDPS & E-Commerce


116 Apoorva Publishers
57. What is Data Dependency?
When the value of one attribute is dependent on another attribute, it is said to be data
dependency. A dependency can be indicated as: X  Y (here Y determines the value of X)

58. What is Multivalued dependency?


The type of dependency that exists when there are at least three attributes (A, B and C) in a
relation, with a well defined set of B and C values for each A value, but B and C values are
independent of each other.

59. What is an ER-Diagram?


An E-R Diagram, which consists of graphical components, can express the overall logical
structure of database graphically. It can be treated as a graphical representation of
databases or relationships.

60. What are the symbols used in ERD?


Note: Refer to Qno: 10, P.No: 30

61. What is Cardinality constraint?


It specifies the number of instances of one entity that can be associated with each instance
of another entity.

62. What is anomaly?


An anomaly is defined as “a departure from a usual process; abnormality”. Any departure
from the standard is considered to be an anomaly.

63. What are types of anomalies?


Anomalies are of 3 types: modification anomalies, insertion anomalies and deletion
anomalies.
Note: Refer to Qno: 12 P.No: 32

64. What is Data redundancy?


Existence of Partial and Transitive dependencies is Data redundancy. In simple terms, the
presence of unnecessary data and duplicate data is data redundancy.

65. What is MS-Access?


MS-Access allows you to create DBMS (Database Management Software). DBMS is set of
user interfacing programs to store, access and manipulate the data of a database.

66. What is a DBMS?


DBMS stands for Database Management Software. It is a set of database and application
programs that allow us to create, alter, or maintain the data.

67. How do you create a database?


By opening a blank database and using database wizard

B- Com II – BDPS & E-Commerce


Apoorva Publishers 117
68. What are the elements (objects) of database?
Tables, Queries, Forms, Reports, Macros and Modules

69. What is a Table?


Table is a collection of data in the form of rows and columns.

70. What is a Query?


Queries are requests to access or alter the complete or part of information from a database.

71. What is a Form?


Form is a user-friendly on-screen arrangement that makes it easy to alter and view the data.

72. What is a Report?


Report is mainly for the purpose of printing needed information of a table. It is basically a
layout that arranges the records in printable form.

73. What is a Label?


A control on an Access from or report that is used to display text material.

74. What is a Macro?


Macros are tools used to automate repetitive tasks i.e. these are actions such as go to
record, go to page, find record, beep and etc. These actions can be stored as macros and
can be attached to events.

75. What are Modules?


Modules are pieces of code, which get executed upon calling.

76. How do you create a Table?


Using Data-sheet view, Design view, Table wizard, Link table and Import table

77. What is the difference between Link Table and Import Table?
Link table does not create new copy of a table, but, It only creates a link to the source table.
Whereas, Import Table creates a new copy of the table.

78. What are the Data-types in Access?


Text, Memo, Number, Date, Currency, Yes/No, OLE, Hyperlink

79. What is Primary Key?


Primary Key is an attribute which does not allows duplicate values or null values.

80. What is a Foreign Key?


Foreign Key refers to the values of Primary of key of another table.

81. What is a Relationship?

B- Com II – BDPS & E-Commerce


118 Apoorva Publishers
A relationship tells how an entity (table) can be associated with other entities (tables).

82. What are types of Relationships?


One-to-one, one-to-many, and many-to-many

83. How do you create a query?


Using design view, simple query wizard, cross-tab query wizard

84. What are the types of Queries?


Select Query, Parameter Query, Action Query, Union Query, Union Query, Pass-through
Query and Data-definition Query.

85. What is Select Query?


It allos us to specify desired search criteria and lists the records as per the conditions.

86. What is parameter query?


It displays a dialog box prompting for a value which substitutes the parameter used in a
query.

87. What is action query?


It does not give any result set but modifies the contents of table or creates a new table
(in the case of “make table”).

88. What is cross tab query?


It allows you display the data with row and column headings i.e in matrix form. A cross-
tab query displays summarized values (sums, counts, and averages) of a field in the
table.

89. What are the subtypes of action query?


 Make Table Query: To create another table from an existing table
 Update Query: To update information of a table
 Append Query: To append records to an existing table
 Delete Query: To delete information from an existing table

90. What is Union query?


It is query used to create union of multiple tables. Here, number of columns and their data
types should match.

91. What is Pass-through query?


A query that sends commands to SQL database

92. What is Data definition query?

B- Com II – BDPS & E-Commerce


Apoorva Publishers 119
A query that uses sql and deals with data definitions and data

93. What is SQL?


SQL stands for Structured Query Language. It is a language that allows us to create, alter
and maintain databases.

94. How do you create a form?


Using Form wizard, Design view, Pivot table wizard and Auto tables (column, row, and data
sheet)

95. How do you create a Report?


Using Design view, Report wizard, Auto report (Tabular, Columnar), Chart Wizard and Label
Wizard.

96. What is Input mask?


This is a condition used to force a desired data entry format.

97. What is Super-type/subtype relationship?


A relationship in which the super-type is the entity set that contains common attributes and
the subtype is the entity set that contains unique attributes.

98. What is OLE?


OLE stands for Object Linking and Embedding. It allows linking or embedding of other
objects like bitmap image or work sheet or video clip.

99. What is Schema?


In the SQL environment, a schema is a group of database objects such as tables and indexes,
which are related to each other. Usually, the schema belongs to a single user or application.

A single database can hold multiple schemas belonging to different users or applications.
Schemas are used to define a portion of a database that a particular user owns. Schemas
are dependent on a catalog. Schemas enforce a first level of security by allowing each user
to see only the tables that belong to that user.

B- Com II – BDPS & E-Commerce

You might also like