You are on page 1of 9

UNIT~ Ill· D

· atabase Man,1gcmcnt SystC'm

CHAPTER l]
Creating and Using Tables -~
Microsoft Ace ess is· t he most popular and powerful Relational Database Management system (RDBMS) · 1t .IS a ,
.
. and manrpulate
. It has a graphical user interface (GUI) and .,s used to organise
part of the MS Office suite. ninte
aIarg ir,
of data eff · I . .. evo1 UrtJ;
icient y. It organises data in the form of tables and provides the facility to create relationship b
. ~~
using common fields. the~

Some common features of MS Access are:

• It provides the facility to break large information into small parts, so that it becomes easily accessible.

• Data redundancy is reduced, which in turn minimises data inconsistency. Data redundancy occurs wh
. en data ,
duplicated at multiple locations.

• It increases the efficiency, speed, and flexibility for searching and accessing information.

• Access facilitates the sharing of data. Different users can use the same database to extract data accordingtothe1,

needs.

■ fl DATABASE OBJECTS
There are four main objects in any database - Tables, Queries, Forms, and Reports. These objects are discussedai

follows:

TABLES
Tables store the complete data in a structured manner, in the form of rows and columns. Every table has afinite

number of columns but it can have infinite rows.

Elements of a Table
Fields: All the columns in a table are called Fields. For example, the field ID in the Employee table will store the /Ds'ol

all the employees.


Records: The rows in a table are called Records. A record contains the values for all the fields that belong to asingle
eemployee
f
person or an object. For example, a collection of fie Ids, such as Name, Department, Age, Salary, etc., or on

makes a single record. · g' 35,


ters that represents a valid value is known as Data. For example, 101, 'Rahul', 'Marketin '
Data: A set of charac
for some specific fields of the table as shown in Figure 11.l.
20000 are the data va 1ues

, .. arnina
=t ◄ w, 44

101 Rahul Marketing


f
35
~
20000
,
Rec
102 Ayu Sales 40 22000

103 Bhumi ,,,-;.-;-


Sales • ( 42 .) ("24000 ·

I t f -J
oata
Fig. 111 : Employee Table

auERIES
f
As the name suggeS t s, queries are used to a_sk questions frnm the database to retrieve records data based on certain
criteria. They are also used to perform actions, such as insert, delete, update, etc., on the data depending upon the
. •ia specified by the user.
enter

roRMS { ..
Aform has an attractive interface that accepts data from the user and inserts it in the corresponding table or query.
You can also use these forms to update any record in the table or query.

REPORTS
Reports are used to display the selected data in a printable format. These ·are used for decision-making and analysing

the data by the organisations. Microsoft Office


New
I ll STARTING MS ACCESS Digital Certificate for VBA Projects
rJew
To start MS Access on your computer, follow the steps given below: Microsoft Access 2010
New
• Open the Start menu by clicking on the Start button.
Microsoft Clip Organizer
• Alist of installed apps will be displayed in an alphabetical order. New
Microsoft Excel 2010
• Scroll the list and click on Microsoft Office > Microsoft Access 2010. New
Microsoft lnfoPath Designer 2010
You will get the Backstage view of the MS Access application.
New

ITTs Acce~s INTERFACE Fig. 11 .2: Starting Microsoft Access

The elements of MS Access window are as follows:


Backstage View: It contains information and commands that apply to the entire database. You can open the

Backsta~e view by clicking on the File tab.


• Quick Access Toolbar: It contains the buttons to access t.he commands that you frequently use. You can also add

rnore commands to it as per your requirement.


• rttle Bar: It displays the name of the current document and application.
Navigation Pane: It displays a list of new or existing database objects, such as Tables, Queries, Form~ and Reports.

It can also be called the All Access Objects pane. • -


• Documents Tab: It tab displays the opened database objects.
• R·b
1 bon: It is located just below the Title bar. It has two parts: Tabs and Groups.

Learning
Computers with Kl• PS 211
File Tab I Quick Access Tille Bar

hl AB 12 rn ""lo., &Tin.,

y
Group
p
tN•w
Documonts
[ Tab

Navtgallon
Pane
Work Area

Navigation Buttons J
Status Bar
HCh

Fig . 11 .3: Components of Microsoft Access

■ II CREATING DATABASE
To create a database in MS Access, follow the given steps:

♦ Open Microsoft Access. You will get the Backstage View of Access.

..... "'--0.-----11'1 .......... 0

11, .... 01,,111,,1


i1IJ""0.-111-111Jl
A.9Wftll!Ml-ptnw

0- -- 41

... ......
~
.....I! 2
ill.,..._•a•
4lo.i1111un,.,..
1)1LMt1~-- - ......
OltlCIIC.T~H
......
-·- •-o
l,bt~~

-·... -
.,,
..
, a.,, , ..,..,

□••

Fig . 11 .4: Creating a Blank Database

♦ Click on the Blank database option under the Available Templates category. The Blank Database option facilitatei
you to create a database from the scratch. This is a good option if you have very specific design requirernen~
or existing data that you need to accommodate. The Blank database task pane appears on the rig . ht 51·de tha-
prompts you to create a file.

♦ Specify the file name in the File Name text box.

♦- If required, you can change the location of the file by clicking on the Browse button next to the File Name text boi

Click on the create button. This will create the database with an empty table named Tablel.

Learning
Computers with
KIP
·S
f.ATING TABLES
-you IIKflcR
ow t hat tables are the basic building blocks of a database D t . st
. no wizard to create the table in MS A · a a is ored . in it by using tables. Unlike Ubreoff,ce

• aase,
there 15
. . . d
ccess.

.
"'",,n create tables
. in an ex1st1ng atabase by any of th e f ollow,ng
. methods

r
oesign view
l)Slflg
. oatasheet View
v us1ng
iNG TABLES IN DESIGN VIEW
c.PfAr
" th• esign VieW, you can create a table from scratch by det·'"'.ng t he field
.
arne Dand field types. To create the table ' click on the Table Oes1gn
• option
.
STables O
0nt group of the Create tab. A table will be created and pene d ·in
Fig. 11 .5: Selecting Table Design Option
th•heoesign VieW as shown in Figure 11.6. In this view, the Object window
1

consists of two panes . The first pane is called the Field Entrv pane and the

other is called the field Properties pane.

Adding fields in Design View


• for each field in the table, type a name in the Field Name column and then press the Tab key to move to the oat•
rype column . BY default, the Text data type appears in this column. Change it to Number data type as shown r

• Figure 11.6.
In the oescription column, you can type a description for each field. The description text is displayed on the Status

bar when you select t hat field in the Datasheet View.

• Select the save button present on the Quick Access Toolbar. - o " T
Sb,,dcf\U: o,t.l:I ISC 'AcC.U J 20J7l Micros

[)CWIIJlvft
oau Type
Number
TeJrt
s_Nam• Teal
0•"~ r-,tu,nber

I
McU5"6!' Number
Tut1an_fee

Object Window

I.......
~;t:;7,1:tlOOI ~,
t tlf"AIPHlfl
put th~•
•l"'on
Lol"llll111CIIC'

Off• uh ~• "' 1
otdlllO~filu ,
>1,,Jdf'Ot1T u 1
11:tqJ •td

l
Field Properties

c ._n ~
Pane

J a J •°' ..,,
~---
;:,:;,~,,
,e."1tJ' 9"

P •'1 lfP
Fig . 11 .6: Adding fields in the Design View

' The Save As dialog box appears. rype the required name and click on OK.
Learning
Computers with
K"lPS <2~
l J'>
- ~ ~-- -- ---
~ not enter the data while cre . . n View. To add data in the
ating a table in the Desig table, switch to th
-- -- ~ , - -- _ e Dat~
CREATING TABLES IN DA ..
--- ,~
TASHEET VIEW
In the Datasheet View, yo
u can en ter , ed it, or h d t of the cre ate d tab les .
~
· up date t e a a Th is view d0
design the table struc
ture from scratch. . h t View follow es not
To wo rk in the Da tas ee the giv en ste ps ·
' ·
a11l\t.
♦ Select a table that you have cre ·ri
ate d in the De sign Vie w. Atable appears. Enter
way that you enter in a sp the data in the tab1 .
readsheet. Or e inth
+ Cli ck on the Cr ea t
te tab and select the Table option in
the Tables group.
+ Atable appears tha
t has an empty row and the
cursor is placed in the firs t em pty cell in the Click t
+ Access automatical OAdd

ly creates the first field cal
• led ID. By de fault, this field is designated as the
which contains an en try tha tabl , _ ~
t wil l un iqu ely ide ntify the record. es Pr1111ar
1
+ The data type of the
• ID field is set to AutoNum
ber which means
' tha t Ac ces s will aut om atically ent
number in this field for eac
h new record . er asequ
+ Start typing to enter data
by selecting the empty fiel
d below the Click to Ad d
then press the Tab key to colum n. Type "Ra ma _
move to the next field. n Mal1f•
• The value '1' appears in the
ID field. The name of the
second col um n has be en ch
label has been moved to an ged to Fieldl and Cl' k
the third column. IC lo~
-+ You can change the name
of Fieldl by double-clicking
on it and typing the field nam
change the name of the res e in its place. Likewise
t of the fields. yo, I
An asterisk(*) sign in the
Record Selector (locate - - -- - -
d on the left side of the
a new record. Once you first row) indicates that the
enter a record, the ast row is ready to rec~...
erisk(*) sign cha nges to a pencil sig n and
on it to save the record indicates to save the reco
before moving on to the
next. Clicking on rd Oici
value in a new table. the pen cil sign is nec ess ary onl
y when you enter thefirit
♦ Enter the other information in the table in the similar manner.
Th us, the table gets created as you entertheda
u
Iii .,.
0 X • Studct! .C~ t~t: ..!!'
tn :'•1 4a-
~
s--
fk'l
l!UltlO
,_
JM, f
'*-
"!JI
M ltl• f ti f ~u tdl
II t Ofl
0 --
Fig. 11.7 Entering -
Data In Datasheet Vie
w Fig . 11 .3 Ent erin g Dat
a afte r Changing the
Field Narne
is add ed to the tabl e in th -n -.. ___ -,e d
e w colu mn e ~ View Access automat1ca11y sets each ftllltrs .,_ . type
ri a ri custom h ' D -.,.
Whe d ta that you ente r. If you wan t to •set eda taty peo t a field, then you need to open the table the 81
he a Sta
on t clicking on the Design View button on the tus bar. Make chan1es In the Da ta~ column arid save the table
tJiefl bY

. al data bas e stor es the data in a


tabl E ry field has Its own set of
. e. ach tabl e cons ists of fields and eve
r( relat ion b h . Is its dat a /
f~ They desc ribe the char acte risti cs and e av,o ur of data . The mos t imp orta nt prop erty of a field . !i
pertieS, . 15
I .
• 1

rmi nes wha t type f d a field whose data typ e .t


pro d' data type dete
.
0
ata can be ente red into it. For exam ple, r
k.ne. A fiel s II ises the
1,"- , can only stor e num. eric data and doe s not a ow you to ente r text into it. The following tabl e sum mar

,,,.
•Number
ly used data type s in MS Acc ess:
c0rrirT10'1

of text and num bers Up to 255 characters


It is used to stor e text or a combination
(alphanumeric).

as decimal values. This type of 1669 t'es


It is used to stor e integer values as well
data can be useo fbr calculations.
that can be text or numbers.
It is used to stor e a arge quantity of data
calculations relate to date or 8 bytes
OlfllTlme It is used to stor e date or time data. The
time can be don e in this field type.
lations can be performed 15 digits to the left of the deci mal
Currency It is used to stor e currency values. The calcu point and up to 4 digits to the
on this data type . right of the decimal poin t

only one possible value - 1 bit


Yes/No It is used at places where the field can have
Yes/No or True/False.
plication, such as 2GB
OLE
Word docu men t, Excel sprea s ee
the Access table.
1GB
, or files.
Hyperhnk You can stor e links to web pages, websites
Dep ende nt on the data type of
es are chosen from the values
Lookup It helps you to crea te a field whose valu the lookup field
Wizard stor ed in anot her table, query, or list.
Upt o2G B
files, documents, charts, and
Attachment It helps in attaching images, spre adsh eet
in your database, much like
othe r types of supp ort files to the records
you attac h files with e-mails.
value that is calculated from Dep ends on the expression that
Calculated It is used to crea te a field that displays a uses data from one or more flelds
the othe r data of the same table.

I ll SETTING PRIMARY KEY . . .


stra int in the tabl e to che ck tha t
Prirnary k .1s a stan dard feat ure of ever y data base man age men t syst em. It 1s a con
ey te
of a tabl e can neit her hav e dup lica
rd in the tabl e is uniq ue. The field that is desi gna ted as the prim ary key
:"ery reco
ata no r can .1t be left blan k whi le making a data entr y.
fi
y
, ,,, Ii' ,1,q,l1 1
y,111 h/1 111,fr, t I hit ti I,,, 1 It ti 111111 1 ol flt,
1 111d1 nt of ,1<11 Th, Roll No f 1, Id tn th,
l-'!b
r 111 I1r , I f, II I ii h I u,t, 111 (qu t ,ir,r ,,1 r,r • 1d, r th<' N ..
.. m, I
''''" •v 1,"
I II Ii• th 111 r,nt I 11<1, nt In 1 c l,1, m 11 h 11(• th •, 1rri n.in,

,,, I I I I I ,,, ' ~. V flt I I I lh

1, II o~ IMll VI, w, 11, ~ (, '"' II 1,1 ti II y1111 J tll\ 11) I I., ''" prirrl,11 /~'I ltH· wl, (;II d ,,,.Id 11111 b h1ehl1g

I I~ I 1I I I lm111v K~v I I 1H II 11111,, "' • IRII Ltl, I JI I IP.I 11 I 11, k f HI tt,, f I1 Id ,Hid ,,,•ll'r I thr Primary KPy option fr
111 I 1, I JI f, I

, I ti, (Hltn 11y ~• V, 111d11 1t, ,t l,1 ,t • 111,ill ~' y ·,11111,ol in 111, 111 Id (,1 lertor r..olumn

'"' r, 01111,, 1.1hl1 wl11d1,V✓

w111d11w fl 11t111d11w 11,11 ,,, •,.i ✓,- th1•, h,mw••, .

01 f Ulfllltloll

110 c.,ccl

rtq 11 .10 MS Accoas Confirming to Save Table


• , 11111u n l'rlrm"Y K1•y

~ ~ ASSESSMENT TIME

A orr t option.

WI , I f ti I ,, 11m,1nr I rt(Jl il d,JI ,ilJd',f ril,Jr•r I'

c. Reports

I' U' ( r1 Iv 1(1111 v, 11,, 1rt101111c1\1011 f1rnn d cli1l,1trnsP.


7

IJ, fll pol I C. QU<.'IY


1,1;1,

Ill ti I 11,h Ill lltl ... Vlf'W,


3 You , ,1111 , t c 11h r ij
C. [)('<:;ll]ll
I,, f1t1lt1IJ.i•,c
1 f J 11 iJ 11t l I

i you" ~ to ,101r tl11 1Jdt1 of 11d1111 c,1un


II . Wf1kl1 r f r:tli.l I YI'' WIi

Ii. lh1l1 / I 11111• c. text


,I. f J1111dJPf

. (f,1\iJ 1yp1• ltolc.h 111111tlH•1 w1tll c.l1•L1111c1l'i.

c. Memo
IJ. Nu111ti11r
"· OI I

FiiiirilriPS ~
UNIT - III: Database Management System

I CHAPTEfi l2
Performing Operations on Tables ~
Tables are the easiest way to store, organise, and present a large amount of information. They are the building blo{,·
of a database. All the data is stored in a database by using tables. A well-designed table helps the users to retrieved·
-.ia
from a database easily.

In the previous chapter, you learnt how to create tables using Table Design and Datasheet View. In this chapter, you wi
learn about the various operations that are performed on tables.

■ fl INSERTING DATA IN TABLE


To insert data in a table, follow the given steps:

◄ Open the database in which the table exists. For example, the Students database.

• Select the Student_info table in the Navigation pane. Double-click on it to open it. The pointer will appear in the
first cell of the table.

• Start typing in the cell and press the Tab key to go to the next field. Add as many records as you want. This is the
most common way to enter data in a table .

.::J ~tudonl_lnfo
S_ID •t NamE
_, Class . Stream . Crty • Mobile_Nur • Cf,ck t o Add •
1 Poonam X Arts Delhi 9876786545
2 Anu X Science Delhi 1!762287687
3 Neha X Science Pune 9985672343
4 Sabnam X Aru Delhi 8234763510
5 D,nest, X Arts Delhi 8776876614
6 Rahul X Science Pune 9215369856
7 Anam,ka X Aru Pune 6274439815
8 Tanu X Sc1enrei Nolda 8283856643
9 r.,saar X Scrence l\01da 3656284021
10 Arhan X Sc,ence No1da 6234119956
.. ~ ewJ

Fig. 12.1 · Entering Data in a Table

Use the navigation keys to move up, down, left or right in a table. To insert a new record, press the down arrow key
from your keyboard . This will move the cursor to the next record in the Datasheet View.

---------
II EDITING RECORDS IN TABLE
Sometimes, you need to modify the records. You can easily do so in MS Access. To edit a record in a table, follow th e
given steps:

i Open the table and click on the record you want to edit.

+ Use the Backspace or Delete key to remove the record.

-+ Make changes in the records and click on the Save button 8 to save the changes.
Learning K. 218
Computers with fPS

You might also like