BDPS
BDPS
B.Com.
Computer Applications: Second Year
AND
ELECTRONIC COMMERCE
By:
Venu P. B.E. Comp.
Printed At:
Srinivasa book depot
Karimnagar.
ELECTRONIC
COMMERCE ---------- PAGE NO: 120
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-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)
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:
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?
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.
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.
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)
Information
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
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
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.
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.
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.
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.
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.
Type ENTITY
Person EMPLOYEE, STUDENT
Place STOREHOUSE, LIBRARY
Object COMPUTER, BOOK
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.
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?
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.
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.
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
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:
INFORMATION SYSTEM
Software
Operating system
Application DBMS
PEOPLE
programs
Database
Hardware
Data and Information: It includes facts about people, places things and etc which
require or create meaning to the user’s application.
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
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
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.
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:
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.
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:
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.
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.
Associative Entity
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
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
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.
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
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.
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):
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.
Recursive Relationships
One-to-one One-to-many
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.
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 LANGUAGES_KNOWN
SUBJECT FEE
RNO LANGUAGES_KNOWN
7. Explain the concepts of transitive and partial dependencies in the database design.
Give necessary examples.
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
Table: STUDENT
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
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.
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.
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
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.
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.
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:
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.
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.
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).
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.
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.
Has
SHORT QUESTIONS
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.
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.
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.
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.
Transitive dependency
Partial dependency
Data dependency diagrams are structures that display all dependencies and their
sources.
Partial dependency: A dependency based on only part of the PK (Primary Key) is known
as a 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
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.
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
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.
3. Explain the steps involved in creating a database and creating relationships with
other databases.
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.
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
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.
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.
Relationship is relating two common columns or columns of same type among multiple
tables. It helps to fetch records from multiple tables.
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
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.
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:
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.
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.
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.
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
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
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?
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.
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.
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.
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?
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.
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.
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.
Queries: Queries are requests to access or alter the complete or part of information
from a database.
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.
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.
Refer to “design view” in the previous question. (“How do you create a query”)
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.
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.
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.
Queries allow us to group records and then perform group functions such as sum,
average, count and etc.
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.
Microsoft Access copies your expression to the location where you started the
Expression Builder.
SHORT QUESTIONS
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;
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.
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.
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.
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
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).
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.
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.
Prerequisites:
1. A form may be based on one or more tables. The table(s) must exist before the
form is created.
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.
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.
List box control displays multiple columns and multiple rows at a time. This saves the
user from taking many text boxes on a form.
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.
SHORT QUESTIONS
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.
Functions of Forms:
Forms are used to enter new data and modify the existing data.
Forms provide visually appealing and logically connected interfaces.
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.
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.
Trim is a function that removes spaces left side and right side of a string.
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.
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?
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
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.
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.
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.
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.
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.
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.
SHORT QUESTIONS
The following table summarizes all the field data types that are available in Access, the
usage of the data types.
BUSINESS
DATA-PROCESSING
Solved
PRACTICAL
QUESTION BANK
1. Create a table named STUDENT with the following structure and set the validation
rules while creating the structure:
Date of Birth Date Between 1st January 1980 and 3 1st March 1985
PROCEDURE:
66333
Creating Table:
1. In the Studentno field select the datatype as “Auto Number” and right click to
select as a Primary Key.
Creating queries:
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
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
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.
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
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.
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.
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
b) Make the name and address as the Primary Key for this table.
6. Create two tables EMPLOYEE and DEPARTMENT with the following details:
EMPLOYEE
DEPARTMENT
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
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.
c) Display the details of Employees, whose salary is greater than Rs. 5000.
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
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.
EMPLOYEE
Employee # Name Job HireDate Salary DeptNo
PROCEDURE:
Creating Table:
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”.
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.
c) Delete the details of all the employees, whose salary is less than Rs. 5000 /-
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
EMPLOYEE
Employee # Name Job HireDate Salary DeptNo
DEPARTMENT
DeptNo Name Location
Enter relevant data and create queries as per the following specifications:
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:
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.
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.
EMPLOYEE
Employee # Name Job HireDate Salary DeptNo
DEPARTMENT
DeptNo Name Location
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:
b) Calculate the total compensation expense for each department for one year.
c) Find the department number where more than one clerk is working?
12. Create a database named Recruitment, with the tables Application, Interview and
Recruitment. The structure of the tables are given below:
Application
Interview
Recruitment
Recruit_Id Text(7)
Intv_Id AutoNumber
Post_Recruited Text(25)
Set the validation rules, while creating the tables and enter data into it.
PROCEDURE:
Creating Table:
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.
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.
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).
PROCEDURE:
Creating Tables:
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).
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. 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:
CATALOG
ISBN Title Author Publisher Year Price
Name
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
Creating queries:
a) Find the names of all the books that start with the letter 'C'.
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
CATALOG
ISBN Title Author Publisher Year Price
Name
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
Creating queries:
a) Find the price of the book "Rapid Application Development".
1. Select the queries tab and click on the new button.
c) Delete the record for the book named "The Internet Applications".
STUD DETAILS
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 Toolsrelationships
5. Also, create the relationship between Group_id of GROUP_MAST_DETAILS and
Group_Id of STUD_DETAILS table. Using Toolsrelationships
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
Create a report:
Refer to question number 19, i.e. create the report as in the question 19
PROCEDURE:
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.
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.
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.
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.
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.