Uploaded by ZION SALTIBUS

CSEC IT Practical Database Exercise: Student Registration & Design

advertisement
CSEC IT — Practical Database Exercise
Title: Student Registration Database — Field names, field types, field length, data types,
primary key,
Learning objectives
By the end of this exercise the student will be able to:
●
Define and choose appropriate field names, field types (data types), and field
lengths.
●
Set a primary key and understand why it is important.
●
Create and populate a table with valid sample records.
●
Build simple selection and parameter queries and a calculated field. disregard
●
Create a basic form for data entry and a simple report.
●
Understand the idea of relationships and a foreign key (one-to-many).
Scenario (brief)
You work for Seaside High School. The school needs a simple database to store basic
student registration information so the office can track students, contact details, and fees.
Your job is to design the Students table, populate it with sample data, create queries and a
form, then produce a short report.
Student Task Sheet (Step-by-step)
Follow these numbered steps. Write your answers where requested and perform the actions
in your DBMS.(Microsoft Access)
1) Create the database file
1. Create a new blank database and save it as SeasideStudents (or
SeasideStudents.accdb for Access).
2) Create a table called Students
Open Table Design (Design View) and add the following fields. For each field, choose the
appropriate Data Type and Field Size (when applicable). Set StudentID as the Primary
Key.
Fill in the table below (do this on paper or in your DBMS):
Field name
StudentID
FirstName
LastName
DOB
Gender
Parish
Phone
Email
Data
type
(choose
one)
Field
length /
size
Primary
key (Y/N)
Required
(Y/N)
Indexed
(Y/N unique?)
Description /
Validation
rule
EnrollmentDa
te
Grade
FeesPaid
TuitionBalanc
e
Hints (choose carefully): for datatypes
●
Typical Data Types: Short Text (Text), Long Text (Memo), Number (Integer/Decimal),
Date/Time, Currency, Yes/No (Boolean), AutoNumber/Serial.
●
Field length for names: 20–40 characters. Email: 50–100. Phone: 10–15 (depends on
format). Tuition balance: allow decimal places.
●
StudentID can be an AutoNumber (if using Access) or a Text code such as S001
(then set as Primary Key).
●
Gender may be a single character (M / F) or text (Male / Female).
3) Save the table and enter sample records
Create at least 10 sample student records. Enter real-looking data (no personal data of
real people). Use the sample dataset below or create your own.
Sample data (you may copy these rows into your table):
Stude
ntID
First
Nam
e
Last
Nam
e
D
O
B
Ge Pari P
nd sh ho
er
ne
Email
Enrollm
entDate
Gr
ad
e
Fee
sPa
id
Tuition
Balanc
e
S001
Mari
a
Jam
es
20
09
03
21
F
Cas 75
tries 855
501
23
maria.james
@example.co
m
202409-01
9
Yes
0.00
S002
Andr
e
Pierr
e
20
08
11
M
Vie
ux
Fort
andre.p@exa
mple.com
202309-01
10
No
120.50
75
855
5-
02
01
45
S003
Nao
mi
Char
les
20
10
06
10
F
Gro
s
Islet
75
855
501
66
naomi.c@exa
mple.com
202409-01
8
Yes
0.00
S004
Dani
el
Jose
ph
20
09
12
30
M
Sou
frier
e
75
855
501
88
daniel.j@exa
mple.com
202401-15
9
No
45.75
S005
Leah
Bapti 20
ste
07
08
05
F
Cas 75
tries 855
501
99
leah.b@exam
ple.com
202209-01
11
Yes
0.00
S006
Ryan
Vale
ntin
20
08
02
16
M
Ans
e La
Ray
e
75
855
502
01
ryan.v@exam
ple.com
202309-01
10
Yes
0.00
S007
Zoe
Antoi 20
ne
09
07
22
F
Lab
orie
75
855
502
12
zoe.a@exam
ple.com
202409-01
9
No
30.00
S008
Cale
b
Mitc
hell
M
Cho
iseu
l
75
855
502
23
caleb.m@exa
mple.com
202409-01
8
Yes
0.00
20
10
01
05
S009
Asha
Rich
ards
20
07
10
18
F
Mic
oud
75
855
502
34
asha.r@exam
ple.com
202209-01
11
Yes
0.00
S010
Kade Loui
em
s
20
08
05
27
M
Den 75
nery 855
502
45
kadeem.l@ex
ample.com
202309-01
10
No
95.25
9) Short written quiz (answer on paper)
1. What is a primary key and why is it important?
2. Give two examples of data types and say when to use each.
3. What does Field Length control for a text field?
4. What happens if you try to enter the same value into a field marked as Indexed
(Unique)?
5. Why would you use a foreign key?
Download