Você está na página 1de 19

Database Management System

The Royal Island Hotel


Database Project One
Direction 1) Import the following Excel data from attached Guest.xls
Direction 2) Import the following Excel data from attached Rooms.xls
Direction 3) Import the following Excel data from attached Reservation.xls
1. pen a data!ase" or switch to the Data!ase window for the open data!ase.
o #o import a spreadsheet" on the $ile menu" point to Get External Data" and then
clic% Import.
o #o lin% a spreadsheet" on the $ile menu" point to Get External Data" and then
clic% &in% #a!les.
2. In the Import 'or &in%) dialog !ox" in the $iles of t(pe !ox" select )icrosoft Excel
'Guest.xls" Rooms.xls" and Reservation.xls) '*.xls).
3. +lic% the arrow to the right of the &oo% in !ox" select the drive and folder where the
spreadsheet file is located" and then dou!le,clic% its icon.
-. $ollow the directions in the Import .preadsheet /i0ard dialog !oxes.
Import from external data as per the !elow mentioned icons spreadsheet and following
instructions in the wi0ard1
Direction -) #he hotel data!ase will include these three ta!les. Each of the ta!le names and
fields are shown !elow. +reate each ta!le" and set the appropriate data t(pes for each field.
Zubaidah Abdul Rehman, 20042080, BIS
Database Management System
The Royal Island Hotel
Database Project One
Guest #a!le
2rimar( 3e( is +ustomerID
Rooms #a!le
2rimar( 3e( is Room
4um!er
Reservations #a!le
2rimar( 3e( is reservation
4um
Direction 5) .et the 6#(pe of 7eds6 field as a data t(pe of &oo%up /i0ard. #he values for the
loo%up are1 Dou!le" 8ueen " 3ing.
#he loo%up wi0ard should now appear. Initiall( we need to specif( if we wish to get the values
from an existing ta!le9:uer( or to t(pe in the values ourselves. /e wish to loo% up the values in
a ta!le so ensure that option is selected and clic% on 4ext.
#hen we list the items to !e listed for #(pe of 7eds to !e selected during the process of
data!ase.
Zubaidah Abdul Rehman, 20042080, BIS
Database Management System
The Royal Island Hotel
Database Project One

Direction ;) .et the appropriate data validations. 'nl( on selected fields).
Direction <) Define the relationships !etween the ta!les. =ou should !e a!le to figure out the
relationships from the primar( %e(s that I have provided to (ou. .et each relationship to
enforce referential integrit( and cascade update and deletes.
1. +lic% Relationships on the tool!ar.
2. If (ou haven>t (et defined an( relationships in (our data!ase" the Show Table dialog
!ox is automaticall( displa(ed.
If (ou need to add the ta!les (ou want to relate and the Show Table dialog !ox isn>t
displa(ed" clic% Show Table on the tool!ar.
3. Dou!le,clic% the names of the ta!les (ou want to relate" and then close the Show Table
dialog !ox. #o create a relationship !etween a ta!le and itself" add that ta!le twice.
-. Drag the field that (ou want to relate from one ta!le to the related field in the other
ta!le.
#o drag multiple fields" press the +#R& %e(" clic% each field" and then drag them.
In most cases" (ou drag the primar( %e( field 'which is displa(ed in !old text) from one
ta!le to a similar field 'often with the same name) called the foreign %e( in the other
ta!le.
5. #he Edit Relationships dialog !ox is displa(ed. +hec% the field names displa(ed in the
two columns to ensure the( are correct. =ou can change them if necessar(. .et the
relationship options if necessar(.
;. +lic% the Create !utton to create the relationship.
<. Repeat steps 5 through ? for each pair of ta!les (ou want to relate.
Zubaidah Abdul Rehman, 20042080, BIS
Database Management System
The Royal Island Hotel
Database Project One
/hen (ou close the Relationships window" )icrosoft @ccess as%s if (ou want to save the
la(out. /hether (ou save the la(out or not" the relationships (ou create are saved in the
data!ase.
#he relationship in the hotel data!ase is mainl( affecting Reservations #a!le. )a%ing the
relationship according to +ustomerID and Room4um!er lin%ing to the other ta!les Rooms and
Guest as shown in the !elow window1
Relationship defining as Guest Reservations and Rooms Reservations as shown !elow1
Zubaidah Abdul Rehman, 20042080, BIS
Database Management System
The Royal Island Hotel
Database Project One
Direction ?) @dd five more records into the Guest ta!le. #hese five names should !e (our
name" and the names of four of (our classmates.
Direction A) @dd two more room records.
Direction 1B) @dd five more records to the reservations ta!le. =ou can ma%e them up" !ut !e
sure that the( reference legitimate room num!ers and guest num!ers.
$ive more records in the Guest #a!le and the( are displa(ed !elow1
Guest
Custo
merID
ContactFir
stName
ContactLa
stName
Addre
ss1
BillingA
ddress
Cit
y
State!r
o"ince
!ostal
Code
!honeN
um#er
$mailAddress
Disa
#led
Not
es
6Hessa Al Malik 501
Old
RAK
City
RA
K
AE 501 7233230
2
love_4ever2geter
!ot"ail#$o"
%o %il
7&'(aida Al )i* 374+
,eedr
o
-# O#
.o/0
374+1
RAK1
2AE
RA
K
AE 374+ 505+302
5+
s*o4ite13!ot"ai
l#$o"
%o %il
+5eda 6ase" 1345
,il7a
"
-# O#
.o/0
100551
RAK1
2AE
RA
K
AE 10055 50+3++0
33
8#9ase"!rak8t:1$o
"
%o %il
3Ki"(erly ;'eri* 445+
,#
&ayed
Road
-# O#
.o/0
100551
RAK1
2AE
)'
(ai
AE 10055 50+++24
+7
k#g'eri*!rak8t:#$o
"
%o %il
10Alya A"(er 1345
*ear
<a*d
)e7art
"e*t
-# O#
.o/0
100551
RAK1
2AE
RA
K
AE 10055 503745+
21
a#a"(er!rak8t:#$o
"
%o %il
#wo more room records and the( are displa(ed as shown !elow1
Rooms
RoomNum#er RoomTy%e StandardRate Smo&ing Num#ero'Beds Ty%eo'Beds disa#led(access
600)el'/e ,ta*dard =31000#00>es 3 Ki*g >es
700)o'(le ,ta*dard =150#00>es 2 6'ee* >es
Zubaidah Abdul Rehman, 20042080, BIS
Database Management System
The Royal Island Hotel
Database Project One
$ive more records are added in the reservation and the( are displa(ed !elow1
Reser"ations
Reser"ationNum Arri"alDate De%artureDate CustomerID RoomNum#er
6 31?A'g?03 05?,e7?03 6 500
7 10?O$t?03 15?O$t?03 7 300
+ 10?O$t?03 15?O$t?03 3 200
3 0+?A7r?07 11?A7r?07 + 600
10 12?A7r?07 14?A7r?07 10 600
Referential Integration for room num!ers and guest num!ers1
Rooms #a!le1
Guest #a!le1
Cpdating records1
Zubaidah Abdul Rehman, 20042080, BIS
Database Management System
The Royal Island Hotel
Database Project One
Direction 11) Run a :uer( that shows each of these fields1 Guest last name" reservation
num!er" arrival and departure dates" the room num!er and the room t(pe.
Direction 12) @dd a calculated field that determines the num!er of da(s the guest is sta(ing for
each reservation.
Direction 13) @dd a calculated field that determines the total room charges for each reservation
'!ased on the standard rate).
Direction 1-) .ave this :uer( as 1 63 ta!le :uer(6
Direction 15) 2rint a !efore image of the rooms records.
8uer( Design Diew1
(Guest last name, reservation number, arrival and departure dates, the room number and the
room type)
8uer( #a!le +ontents1
Zubaidah Abdul Rehman, 20042080, BIS
Database Management System
The Royal Island Hotel
Database Project One
) ta#le *uery
ContactLastName Reser"ationNumArri"alDate De%artureDate RoomNum#er RoomTy%e length charge
Ei$ers 1 01?O$t?03 10?O$t?03 100,ta*dard 3 300
Ei$ers 2 31?O$t?03 01?%ov?03 200,'ite 1 200
<'ld8ord 3 10?)e$?03 15?)e$?03 200,'ite 5 1000
<'ld8ord 4 01?@a*?04 05?@a*?04 100,ta*dard 4 400
Marley 5 31?A'g?03 05?,e7?03 400,'7erior 5 1250
Marley 6 31?A'g?03 05?,e7?03 500,'ite 5 10000
Mi*eart 7 10?O$t?03 15?O$t?03 300,i*gle 5 375
Mi*eart + 10?O$t?03 15?O$t?03 200,'ite 5 1000
Al Malik 3 0+?A7r?07 11?A7r?07 600)el'/e
,ta*dard
3 3000
Marley 10 12?A7r?07 14?A7r?07 600)el'/e
,ta*dard
2 6000
Direction 1;) .et up a :uer( to update the disa!led accessa!le to (es for all suites. .creen
print the :uer( design. .ave the :uer( as 6Cpdate 8uer(6.
Direction 1<) 2rint an after image of the rooms records.
Direction 1?) 2rint a !efore image of the reservation records.
7efore Image of records1
.teps1
1. +lic% esi!n to return the :uer( to Design view again.
2. n the "uer# menu" clic% $pdate "uer#.
@ccess converts (our select :uer( to an update :uer(" and adds the $pdate To field to the
8uer( Designer.
3. In the $pdate To field under is%ontinued" enter &es.
-. #o run the :uer( and update the
records" clic% Run .
/hen (ou run the :uer(" an alert message sa(s
that @ccess will update all five rows" even
though one of those rows alread( contains a
&es value.
Zubaidah Abdul Rehman, 20042080, BIS
Database Management System
The Royal Island Hotel
Database Project One
5. In this case" the update operation won>t change the existing value" so clic% &es to run
the :uer(.
If (ou did not want to overwrite the existing value" (ou could enter 'o in the Criteria field
!elow the $pdate To field" as shown in the following illustration.
#hat additional constraint forces the update :uer( to change onl( those records that contain a
'o value. @ccess runs the :uer( and updates the records" !ut (ou won>t see the datasheet with
the updated data (et.
Direction 1A) .et up a :uer( to delete the reservation on 19192BB-. .creen print the :uer(
design. .ave the :uer( as 6Delete 8uer(6.
Direction 2B) 2rint an after image of the reservation records.
7( using the criteria EFGldest Date to 3eep1HI we can delete group of rows depending upon
record availa!ilit( of parameter value1
Zubaidah Abdul Rehman, 20042080, BIS
Database Management System
The Royal Island Hotel
Database Project One
Zubaidah Abdul Rehman, 20042080, BIS
Database Management System
The Royal Island Hotel
Database Project One
#he records that will !e affected as per the date entered are as show in the right1
#his is not the steps for deleting records !ut it is to have an idea of how man( records that are
availa!le we can delete from particlaur ta!le.
.teps1
(pen "uer# desing select "uer# from menu !ar and delete )uer#" here again will re:uest
for EEnter 2arameter DalueI1
Zubaidah Abdul Rehman, 20042080, BIS
Database Management System
The Royal Island Hotel
Database Project One
@fter entering the parameter value for delete :uer( the !elow command will !e displa(ed1
Reservation ta!le displa( after delete :uer( command1
Direction 21) +reate a form using all of the fields from the guest ta!le.
Direction 22) @dd a su!,form that displa(s the reservations for each guest.
Direction 23) $ormat the form to loo% professional.
Zubaidah Abdul Rehman, 20042080, BIS
Database Management System
The Royal Island Hotel
Database Project One
Direction 2-) .ave the form as 6Guest,Reservation $orm6.
1. In the Data!ase window 'Data!ase window1 #he window that appears when (ou open an
@ccess data!ase or an @ccess proJect. It
displa(s shortcuts for creating new
data!ase o!Jects and opening existing
o!Jects.)" clic% *orms under
(b+e%ts.
2. +lic% the 'ew !utton on the Data!ase
window tool!ar.
3. In the 'ew *orm dialog !ox" dou!le,
clic% *orm ,i-ard.
-. In the first wi0ard dialog !ox" select a
ta!le or :uer( ':uer(1 @ :uestion a!out
the data stored in (our ta!les" or a
re:uest to perform an action on the
data. @ :uer( can !ring together data
from multiple ta!les to serve as the
source of data for a form" report" or data
access page.) from the list. $or example"
to create a +ategories form that displa(s
products for each categor( in a su!form"
select the +ategories ta!le 'the 6one6
side of the one,to,man(
relationship 'one,to,man( relationship1 @n association !etween two ta!les in which the
primar( %e( value of each record in the primar( ta!le corresponds to the value in the
matching field or fields of man( records in the related ta!le.)). 'ote It doesn>t matter
which ta!le or :uer( (ou choose first.
5. Dou!le,clic% the fields (ou want to include from this ta!le or :uer(.
;. In the same wi0ard dialog !ox" select another ta!le or :uer( from the list. Csing the same
example" select the 2roducts ta!le 'the 6man(6 side of the one,to,man( relationship).
<. Dou!le,clic% the fields (ou want to include from this ta!le or :uer(.
?. /hen (ou clic% 'e.t" if (ou set up the relationships 'relationship1 @n association that is
esta!lished !etween common fields 'columns) in two ta!les. @ relationship can !e one,to,
one" one,to,man(" or man(,to,man(.) correctl( !efore starting the wi0ard" the wi0ard as%s
which ta!le or :uer( (ou want to view !(. Csing the same example" to create the +ategories
form" clic% B# Cate!ories.
A. In the same wi0ard dialog !ox" select the *orm ,ith sub/orm0s1 option.
1B. $ollow the directions in the remaining wi0ard dialog !oxes. /hen (ou clic% *inish" )icrosoft
@ccess creates two forms" one for the main form 'main form1 @ form that contains one or
more su!forms.) and su!form control 'su!form9su!report control1 @ control that displa(s a
su!form in a form or a su!form or a su!report in a report.)" and one for the su!form.
Guest form and Reservation su!form1
Zubaidah Abdul Rehman, 20042080, BIS
Database Management System
The Royal Island Hotel
Database Project One
Direction 25) +reate a report using all of the fields from the Rooms ta!le and all of the fields
from the reservations ta!le.
Direction 2;) Group the report !( room num!er.
Direction 2<) .ort the report !( room num!er and arrival date.
Direction 2?) @dd a report header and footer with appropriate information.
Direction 2A) $ormat the report to loo% professional.
Zubaidah Abdul Rehman, 20042080, BIS
Database Management System
The Royal Island Hotel
Database Project One
Direction 3B) .ave the report as 6Rooms,Reservation Report6.

Based on a sin!le table or )uer# b# usin! AutoReport. @utoReport creates a report that
displa(s all fields and records in the underl(ing ta!le or :uer( ':uer(1 @ :uestion a!out the
data stored in (our ta!les" or a re:uest to perform an action on the data. @ :uer( can !ring
together data from multiple ta!les to serve as the source of data for a form" report" or data
access page.).
1. In the Data!ase window 'Data!ase window1 #he window that appears when (ou open an
@ccess data!ase or an @ccess proJect. It displa(s shortcuts for creating new data!ase
o!Jects and opening existing o!Jects.)" clic% Reports under (b+e%ts.
2. +lic% the 'ew !utton on the Data!ase window tool!ar.
3. In the 'ew Report dialog !ox" clic% one of the following wi0ards1
AutoReport2 Columnar Each field appears on a separate line with a la!el to its left.
AutoReport2 Tabular #he fields in each record appear on one line" and the la!els
print once at the top of each page.
-. +lic% the ta!le or :uer( that contains the data (ou want to !ase (our report on.
5. +lic% (3.
)icrosoft @ccess applies the last autoformat (ou used to the report. If (ou haven>t
created a report with a wi0ard !efore or haven>t used the Auto*ormat command on the
*ormat menu" it uses the .tandard autoformat.
=ou can also create a single,column report !ased on the open ta!le or :uer( or on the ta!le or
:uer( selected in the Data!ase window. +lic% AutoReport on the Insert menu" or clic% the
arrow next to the 'ew (b+e%t !utton on the tool!ar" and then clic% AutoReport. Reports
created with this method don>t have a report header 'report header1 @ report section that is
used to place information 'such as a title" date" or report introduction) at the !eginning of a
report.) and footer 'report footer1 @ report section that is used to place information that
normall( appears at the !ottom of the page" such as page num!ers" dates" and sums.) or a
page header 'page header1 Csed to displa( a title" column headings" dates" or page num!ers at
the top of ever( page in a form or report. In a form" the page header appears onl( when (ou
print the form.) and footer 'page footer1 Csed to displa( page summaries" dates" or page
num!ers at the !ottom of ever( page in a form or report. In a form" the page footer appears
onl( when (ou print the form.).
Based on one or more tables or )ueries with a wi-ard. #he wi0ard as%s (ou detailed
:uestions a!out the record sources" fields" la(out" and format (ou want and creates a report
!ased on (our answers.
Zubaidah Abdul Rehman, 20042080, BIS
Database Management System
The Royal Island Hotel
Database Project One
1. In the Data!ase window 'Data!ase window1 #he window that appears when (ou open an
@ccess data!ase or an @ccess proJect. It displa(s shortcuts for creating new data!ase
o!Jects and opening existing o!Jects.)" clic% Reports under (b+e%ts.
2. +lic% the 'ew !utton on the Data!ase window tool!ar.
3. In the 'ew Report dialog !ox" clic% the wi0ard that (ou want to use. @ description of
the wi0ard appears in the left side of the dialog !ox.
-. +lic% the ta!le or :uer( ':uer(1 @ :uestion a!out the data stored in (our ta!les" or a
re:uest to perform an action on the data. @ :uer( can !ring together data from multiple
ta!les to serve as the source of data for a form" report" or data access page.) that
contains the data (ou want to !ase (our report on.
'ote =ou don>t need to do this step if (ou clic%ed Report ,i-ard in step 3K (ou can
specif( the record source for the report in the wi0ard.
5. +lic% (3.
;. $ollow the instructions in the wi0ard.
If the resulting report doesn>t loo% the wa( (ou want" (ou can change it in Design
view 'Design view1 @ window that shows the design of these data!ase o!Jects1 ta!les"
:ueries" forms" reports" macros" and data access pages. In Design view" (ou can create
new data!ase o!Jects and modif( the design of existing ones.).
'otes2 If (ou want to include fields from multiple ta!les and :ueries in (our report" don>t clic%
'e.t or *inish after selecting the fields from the first ta!le or :uer( in the Report /i0ard.
Repeat the steps to select a ta!le or :uer(" and pic% fields that (ou want to include in the
report" until (ou have selected all the re:uired fields.
If (ou clic% one of the AutoReport options" )icrosoft @ccess uses the
autoformat 'autoformat1 @ collection of formats that determines the appearance of the
controls and sections in a form or report.) (ou last specified" either in the Report /i0ard
or using the Auto*ormat command on the *ormat menu in Design view.
(n #our own in esi!n 4iew. =ou create a !asic report and customi0e it in Design view to
suit (our re:uirements.
1. In the Data!ase window 'Data!ase window1 #he window that appears when (ou open an
@ccess data!ase or an @ccess proJect. It displa(s shortcuts for creating new data!ase
o!Jects and opening existing o!Jects.)" clic% Reports under (b+e%ts.
2. +lic% the 'ew !utton on the Data!ase window tool!ar.
3. In the 'ew Report dialog !ox" clic% esi!n 5iew.
-. +lic% the ta!le or :uer( ':uer(1 @ :uestion a!out the data stored in (our ta!les" or a
re:uest to perform an action on the data. @ :uer( can !ring together data from multiple
ta!les to serve as the source of data for a form" report" or data access page.) that
contains the data (ou want to !ase (our report on. 'If (ou want an un!ound
report 'un!ound form or report1 @ form or report that isn>t connected to a record source
Zubaidah Abdul Rehman, 20042080, BIS
Database Management System
The Royal Island Hotel
Database Project One
such as a ta!le" :uer(" or .8& statement. '#he form>s or report>s Re%ordSour%e
propert( is !lan%.))" don>t select an(thing from this list.)
5. +lic% (3.
)icrosoft @ccess displa(s the report in Design view 'Design view1 @ window that shows
the design of these data!ase o!Jects1 ta!les" :ueries" forms" reports" macros" and data
access pages. In Design view" (ou can create new data!ase o!Jects and modif( the
design of existing ones.).
Desing Diew1
Report Diew1
Direction 31) .witch 7oard1
Zubaidah Abdul Rehman, 20042080, BIS
Database Management System
The Royal Island Hotel
Database Project One
Direction 32) .witch 7oard1
Re/eren%es2
4otes1
)icrosoft @ccess #utorial
@ccessLla!Lmanual
Zubaidah Abdul Rehman, 20042080, BIS
Database Management System
The Royal Island Hotel
Database Project One
D7).1 Data!ase .(stems1 Design" Implementation" M )anagement"
2eter +o! M +arlos '+oronel" 2BB1" +ourse #echnolog()
e7oo%s1
)icrosoft ffice @ccess 2BB3 .tep 7( .tep '2BB-)
)icrosoft ffice @ccess 2BB3 Inside ut '2BB-)
thers 'internet lin%s)1
/e!#hang #utorials1Now #o +reate a &oo%up +olumn within @ccess 2BB2
http199www.we!thang.co.u%9tuts9tutsLd!ase9%at19%at1.asp
Zubaidah Abdul Rehman, 20042080, BIS

Você também pode gostar