Download as doc, pdf, or txt
Download as doc, pdf, or txt
You are on page 1of 6

ASSIGNMENT

SEPT 2010 SEMESTER

CBDB3203
DATABASE IMPLEMENTATION
INSTRUCTIONS:
 Answer the question below
 Marks will be deducted (or even can be given 0) if your assignment
answer contains any plagiarism or copied directly from your coursemate
 This assignment should be completed individually and must be
submitted online through myVLE
 Deadline for the submision is stated in myVLE

QUESTION /SOALAN

Microsoft Access is one of a DBMS which is suitable for mid-size database


application. The strength lies on the simple SQL queries and attractive interface.
This assignment will test you on your skills in developing a small database
using Ms-Access and the knowledge that you learn on manipulating queries.

The schema of the database is provided below (keys are underlined, field types
are omitted):

Student(StudentNum, Name, Major, Year, Age)


Class(ClassName, TimePeriod, Room, LecturerID)
Enrolled(StudentNum, ClassName)
Lecturer(LecturerID, Name, Dept)

Using Microsoft Access, create the tables, and enter sample data (2-3 records
per table is enough). Make sure you create the relationship between table. Then,
write SQL queries that answer the questions below (one query per question) and
run them on the Microsoft Access using its SQL interpreter.

1. Find the names of all Computer Science Majors who are enrolled in the
course "CBCP2203".
2. Find the names of all classes that either meet in room R128 or are taught
by "Maher Zain".
3. Find the names of all students who are enrolled in two classes that meet
at the same time.
4. Find the names of lecturer such that the combined enrollment of the
courses that they teach is less than 5.
5. Find the name of the student who is enrolled in the most classes.
6. Print the Year and the average age of students for that Year, for each
Year.

You should hand in a printout of:


1. Each table which shows table name, the fields and the sample records.
2. The relationships between table.
3. Each query in “SQL View”, so that the tutor can see your SQL code.
4. The result of each query.

Criteria / 1 2 3 Weightage
Qualities

Creation of The tables The total of 7 The total of 7 1


tables using created are tables are tables are
Ms-Access less than 7. created, but created, with
the names of the names
the table and the table and
its fields its field
does not follow the
follow schema..
schema.
Insertion of At most 1 2 or more 2 or more 1
data (record) data (record) records are records are
in tables is inserted inserted for inserted for
per table. some tables ALL tables
Relationships At most 2 of Only 3 of the ALL 4 tables 1
the tables are tables are are linked in
linked in a linked in a a
relationships. relationships. relationships.
Query 1 The query The query The query 1
aligned with aligned with aligned with
the question. the question. the question.
It retrieves It retrieves It retrieves
60%. of the 80% of the the desired
desired desired output 100%.
output output
Query 2 The query The query The query 1
aligned with aligned with aligned with
the question. the question. the question.
It retrieves It retrieves It retrieves
60% of the 80% of the the desired
desired desired output 100%.
output output
Query 3 The query The query The query 1
aligned with aligned with aligned with
the question. the question. the question.
It retrieves It retrieves It retrieves
60% of the 80% of the the desired
desired desired output 100%.
output output
Query 4 The query The query The query 1
aligned with aligned with aligned with
the question. the question. the question.
It retrieves It retrieves It retrieves
60% of the 80% of the the desired
desired desired output 100%.
output output
Query 5 The query The query The query 1
aligned with aligned with aligned with
the question. the question. the question.
It retrieves It retrieves It retrieves
60% of the 80% of the the desired
desired desired output 100%.
output output
Query 6 The query The query The query 1
aligned with aligned with aligned with
the question. the question. the question.
It retrieves It retrieves It retrieves
60% of the 80% of the the desired
desired desired output 100%.
output output
Printout of Only the Only the All the 7 1
queries and results are queries in queries in
results. shown. ‘SQL View’ ‘SQL View’
are shown AND all the
results are
shown.

[Total marks: 30 Marks]

Microsoft Access merupakan salah satu SPPD yang sesuai untuk pangkalan data berskala kecil
dan sederhana. Kekuatannya ialah pada kueri SQL yang ringkas dan antara muka yang
menarik. Tugasan ini akan menguji kemahiran anda dalam membangunkan pangkalan data
ringkas menggunakan MS-Access, serta pengetahuan anda dalam memanipulasi kueri.

Skema pangkalan data diberi seperti berikut (kunci digaris, jenis medan tidak dinyatakan):
Pelajar(NoPelajar, Nama, Major, Tahun, Umur)
Kelas(NamaKelas, JangkaWaktu, Bilik, IDPensyarah)
Kemasukan(NoPelajar, NamaKelas)
Pensyarah(IDPensyarah, Nama, Jabatan)

Menggunakan Microsoft Access, bina jadual-jadual tersebut, dan masukkan data sampel (2-3
rekod untuk setiap jadual adalah memadai). Kemudian, tulis kueri SQL yang menjawab
persoalan-persoalan di bawah (satu kueri untuk setiap soalan), dan laksanakan mereka dalam
Microsoft Access menggunakan penterjemah SQL.

1. Paparkan nama pelajar yang Major dalam Computer Science dan mendaftar kursus
"CBCP2203".
2. Paparkan nama semua kelas yang sama ada diadakan di bilik R128 atau yang diajar
oleh "Maher Zain".
3. Paparkan nama semua pelajar yang mendaftar di dua kelas yang waktu kelasnya
adalah sama.
4. Paparkan nama pensyarah yang mana gabungan pelajar mendaftar bagi kursus-kursus
diajarnya adalah kurang dari 5 orang.
5. Paparkan Tahun dan purata umur pelajar pada Tahun itu, untuk setiap Tahun.

Anda perlu menghantar cetakan:


1. Setiap jadual, yang menunjukkan nama jadual, medan-medannya dan juga contoh
rekod.
2. Perhubungan antara jadual.
3. Setiap kueri dalam bentuk “SQL View”, supaya tutor anda boleh melihat kod SQL
anda.
4. Hasil dari setiap kueri.

Kriteria/Kualiti 1 2 3 Pemberat

Pembinaan jadual Kurang dari 7 7 jadual dibina, 7 jadual dibina, 1


menggunakan MS- jadual dibina. tetapi nama dan nama jadual
Access jadual dan berserta medan-
medan-medannya medannya
tidak mengikut mengikut
skema. skema.
Kemasukan data Paling banyak 2 atau lebih rekod 2 atau lebih 1
(rekod) di dalam hanya 1 data dimasukkan, rekod
jadual (rekod) sahaja tetapi dimasukkan
dimasukkan di disebahagian untuk semua
dalam setiap jadual sahaja. jadual.
jadual.
Perhubungan Hanya 2 jadual Hanya 3 jadual Semua 4 jadual 1
jadual sahaja sahaja dihubungkan
dihubungkan. dihubungkan. dalam
perhubungan.
Kueri 1 Kueri selari Kueri selari Kueri selari 1
dengan dengan dengan
pertanyaan, pertanyaan, pertanyaan. Ia
namun hanya namun hanya memperolehi
memperolehi memperolehi 80% 100% output
60% dari output dari output yang yang
yang dikehendaki. dikehendaki.
dikehendaki.
Kueri 2 Kueri selari Kueri selari Kueri selari 1
dengan dengan dengan
pertanyaan, pertanyaan, pertanyaan. Ia
namun hanya namun hanya memperolehi
memperolehi memperolehi 80% 100% output
60% dari output dari output yang yang
yang dikehendaki. dikehendaki.
dikehendaki.
Kueri 3 Kueri selari Kueri selari Kueri selari 1
dengan dengan dengan
pertanyaan, pertanyaan, pertanyaan. Ia
namun hanya namun hanya memperolehi
memperolehi memperolehi 80% 100% output
60% dari output dari output yang yang
yang dikehendaki. dikehendaki.
dikehendaki.
Kueri 4 Kueri selari Kueri selari Kueri selari 1
dengan dengan dengan
pertanyaan, pertanyaan, pertanyaan. Ia
namun hanya namun hanya memperolehi
memperolehi memperolehi 80% 100% output
60% dari output dari output yang yang
yang dikehendaki. dikehendaki.
dikehendaki.
Kueri 5 Kueri selari Kueri selari Kueri selari 1
dengan dengan dengan
pertanyaan, pertanyaan, pertanyaan. Ia
namun hanya namun hanya memperolehi
memperolehi memperolehi 80% 100% output
60% dari output dari output yang yang
yang dikehendaki. dikehendaki.
dikehendaki.
Kueri 6 Kueri selari Kueri selari Kueri selari 1
dengan dengan dengan
pertanyaan, pertanyaan, pertanyaan. Ia
namun hanya namun hanya memperolehi
memperolehi memperolehi 80% 100% output
60% dari output dari output yang yang
yang dikehendaki. dikehendaki.
dikehendaki.
Cetakan kueri dan Hanya hasil Hanya kueri Kesemua 7 kueri 1
hasilnya. kueri sahaja dalam ‘SQL ditunjukkan
ditunjukkan. View’ sahaja dalam ‘SQL
ditunjukkan. View’, berserta
hasilnya.

Overall total marks= 30 ---> 30%

-- ASSIGNMENT QUESTION ENDS HERE --

You might also like