Database Management System Assignment

Verified

Added on  2020/02/24

|11
|1016
|204
AI Summary
This assignment focuses on demonstrating practical skills in Database Management Systems. It involves writing SQL queries to retrieve specific student information based on various criteria, such as telephone number prefixes, unit codes, and teacher names. Additionally, the task requires creating a form for adding new units to the student database, incorporating fields like unit code, name, credit points, fee, and teacher ID.
tabler-icon-diamond-filled.svg

Contribute Materials

Your contribution can guide someone’s learning journey. Share your documents today.
Document Page
ACCOUNTING AND INFORMATION SYSTEMS
tabler-icon-diamond-filled.svg

Secure Best Marks with AI Grader

Need help grading? Try our AI Grader for instant feedback on your assignments.
Document Page
Table of Contents
1. Tables............................................................................................................................................2
2. ER Diagram.................................................................................................................................3
3. Queries..........................................................................................................................................4
3.1 Query – Postcode Lookup...................................................................................................4
3.2 Query – SuburbB.................................................................................................................4
3.3 Query – Telephone lookup..................................................................................................5
3.4 Query – D or HD..................................................................................................................6
3.5 Query – Spring.....................................................................................................................6
3.6 Query - Tech classes............................................................................................................7
3.7 Query - Smith.......................................................................................................................8
4. Form.............................................................................................................................................9
References..........................................................................................................................................10
1
Document Page
1. Tables
Student Database contains the four table such as student, enrolment, teacher and units
table (Bhatia and Bansal, 2015).
Table Enrolment
The enrolment table contains the enrolment ID, student ID, unit code, unit name, year,
semester and grade. The Enrolment ID is the primary key and Student ID is the foreign key.
Table Student
The Student table contains the student ID, first name, last name, address, suburb area, post
code, telephone number, enrolment ID and teacher ID. The Student ID is the primary key and
Enrolment ID and teacher ID is the foreign key.
Table Teacher
The Teacher table contains the teacher ID, teacher name and Student ID. The teacher ID is
the primary key and Student ID is the foreign key.
2
Document Page
Table Units
The unit table contains the unit code, unit name and Student ID. The Unit code is the primary
key and student ID is the foreign key.
2. ER Diagram
The Student Database Entity relationship diagram is shown below.
3
tabler-icon-diamond-filled.svg

Secure Best Marks with AI Grader

Need help grading? Try our AI Grader for instant feedback on your assignments.
Document Page
The above entity relationship diagram display the Student database relationship. The ER
diagram connecting the four table like Student, units, teacher and enrolment table. The
Student table is base table for the student database. The student table connecting the other
table. The Student table contains the student ID, first name, last name, address, suburb area,
post code, telephone number, enrolment ID and teacher ID. The Student ID is the primary
key and Enrolment ID and teacher ID is the foreign key. The student table connected to
Teacher table, enrolment table and unit tables.
3. Queries
3.1 Query – Postcode Lookup
This query display the student first name and last name. The student names are sorted
based on post code and also names are sorted in ascending order (Silberschatz, Korth and
Sudarshan, 2011).
Output
SQL code
SELECT tblStudent.FirstName, tblStudent.LastName, tblStudent.PostCode
FROM tblStudent
WHERE (((tblStudent.PostCode)="2112"))
ORDER BY tblStudent.FirstName, tblStudent.LastName;
4
Document Page
3.2 Query – SuburbB
This query display the student first name and last name. The student names are sorted
in descending order. The student name also sorted based on student that live in suburb that
begins with the letter B. It is shown below.
Output
SQL code
SELECT tblStudent.FirstName, tblStudent.LastName, tblStudent.SubrubArea
FROM tblStudent
WHERE (((tblStudent.SubrubArea) Like "b*"))
ORDER BY tblStudent.FirstName DESC , tblStudent.LastName DESC;
3.3 Query – Telephone lookup
This query is used to display the student first name and last name or family name. It sorted in
ascending order. It also sorted based on student telephone number begins with "(02) 5 or (02)
2". It is shown below.
5
Document Page
Output
SQL code
SELECT tblStudent.FirstName, tblStudent.LastName, tblStudent.TelephoneNumber
FROM tblStudent
WHERE (((tblStudent.TelephoneNumber) Like "(02) 5*")) OR
(((tblStudent.TelephoneNumber) Like "(02) 2*"));
3.4 Query – D or HD
This query is used to display the student first name, last name, unit code and unit name. It
student name are sorted in got a D or HD. It is shown below.
Output
SQL code
SELECT tblStudent.FirstName, tblStudent.LastName, tblEntrolment.UnitCode,
tblEntrolment.UnitName
6
tabler-icon-diamond-filled.svg

Paraphrase This Document

Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser
Document Page
FROM tblEntrolment INNER JOIN tblStudent ON tblEntrolment.EntrolmentID =
tblStudent.EntrolmentID
WHERE (((tblStudent.FirstName) Like "H*")) OR (((tblStudent.FirstName) Like "D*"));
3.5 Query – Spring
This query is used to display the unit code and unit name running in semester from
2010. It is shown below.
Output
SQL code
SELECT tblStudent.StudentID, tblEntrolment.UnitCode, tblEntrolment.UnitName,
tblEntrolment.Year
FROM tblEntrolment INNER JOIN tblStudent ON tblEntrolment.EntrolmentID =
tblStudent.EntrolmentID
WHERE (((tblEntrolment.Year) Like "2010*"));
3.6 Query - Tech classes
This query is used to display the all COMP and ISYS units and unit name. The Units
codes are sorted by ascending order. It is shown below.
7
Document Page
Output
SQL code
SELECT tblStudent.StudentID, tblStudent.FirstName, tblStudent.LastName,
tblTeacher.TeacherName
FROM tblTeacher INNER JOIN (tblEntrolment INNER JOIN tblStudent ON
tblEntrolment.EntrolmentID = tblStudent.EntrolmentID) ON tblTeacher.TeacherID =
tblStudent.TeacherID;
3.7 Query - Smith
This query is used to show all the student name and family name enrolled in classes
taught by the Dr.Smith. It is shown below.
Output
8
Document Page
SQL Code
SELECT tblStudent.StudentID, tblStudent.FirstName, tblStudent.LastName,
tblTeacher.TeacherName
FROM tblTeacher INNER JOIN (tblEntrolment INNER JOIN tblStudent ON
tblEntrolment.EntrolmentID = tblStudent.EntrolmentID) ON tblTeacher.TeacherID =
tblStudent.TeacherID
WHERE (((tblTeacher.TeacherName)="Smith"));
4. Form
This task is creating form for student Database. The form creation is used to adding the
new entry in the data base. Here adding the new unit in the student database. The new units
contains the following information like Unit codes, unit name, credit points, Credit points fee
and teacher ID. It is shown below.
9
tabler-icon-diamond-filled.svg

Secure Best Marks with AI Grader

Need help grading? Try our AI Grader for instant feedback on your assignments.
Document Page
Database file is attached here.
References
Bhatia, A. and Bansal, V. (2015). Database Management System. Oxford: Alpha Science
Internat.
Silberschatz, A., Korth, H. and Sudarshan, S. (2011). Database system concepts. New York,
NY: McGraw-Hill.
10
chevron_up_icon
1 out of 11
circle_padding
hide_on_mobile
zoom_out_icon
[object Object]

Your All-in-One AI-Powered Toolkit for Academic Success.

Available 24*7 on WhatsApp / Email

[object Object]