Assignment 2 - SQL & OOPS - Student Information System
Assignment 2 - SQL & OOPS - Student Information System
Instructions:
• Submitting assignments should be a single file or through git hub link shared with trainer and
hexavarsity.
• Each assignment builds upon the previous one, and by the end, you will have a comprehensive
application implemented in Java/C#/Python with a strong focus on SQL schema design, control
flow statements, loops, arrays, collections, and database interaction.
• Follow object-oriented principles throughout the Java programming assignments. Use classes
and objects to model real-world entities, encapsulate data and behavior, and ensure code
reusability.
• Throw user defined exception from method and handle in the main method.
• The following Directory structure is to be followed in the application.
o entity/model
▪ Create entity classes in this package. All entity class should not have any
business logic.
o dao
▪ Create Service Provider interface/abstract class to showcase functionalities.
▪ Create the implementation class for the above interface/abstract class with db
interaction.
o exception
▪ Create user defined exceptions in this package and handle exceptions whenever
needed.
o util
▪ Create a DBPropertyUtil class with a static function which takes property file
name as parameter and returns connection string.
▪ Create a DBConnUtil class which holds static method which takes connection
string as parameter file and returns connection object.
o main
▪ Create a class MainModule and demonstrate the functionalities in a menu
driven application.
In this assignment, you will work with a simplified Student Information System (SIS) database. The SIS
database contains information about students, courses, and enrollments. Your task is to perform various
SQL operations on this database to retrieve and manipulate data.
Database Tables:
The SIS database consists of the following tables:
1. Students
• student_id (Primary Key)
• first_name
• last_name
• date_of_birth
• email
• phone_number
2. Courses
Implement OOPs
A Student Information System (SIS) manages information about students, courses, student enrollments,
teachers, and payments. Each student can enroll in multiple courses, each course can have multiple
students, each course is taught by a teacher, and students make payments for their courses. Students
have attributes such as name, date of birth, email, and phone number. Courses have attributes such as
course name, course code, and instructor name. Enrollments track which students are enrolled in which
courses. Teachers have attributes such as names and email. Payments track the amount and date of
payments made by students.
Task 1: Define Classes
Define the following classes based on the domain description:
Student class with the following attributes:
• Student ID
• First Name
• Last Name
• Date of Birth
• Email
• Phone Number
Course class with the following attributes:
• Course ID
• Course Name
• Course Code
• Instructor Name
Enrollment class to represent the relationship between students and courses. It should have attributes:
• Enrollment ID
• Student ID (reference to a Student)
• Course ID (reference to a Course)
• Enrollment Date
Teacher class with the following attributes:
• Teacher ID
• First Name
• Last Name
• Email
Payment class with the following attributes:
• Payment ID
• Student ID (reference to a Student)
• Amount
• Payment Date
Task 2: Implement Constructors