Professional Documents
Culture Documents
Database Model
Shares
If you nd this article useful,
join our weekly newsletter to be
noti ed about the latest posts.
https://www.vertabelo.com/blog/technical-articles/a-language-school-database-model 1/13
2/24/2019
Knowing a foreign language is an important skill, especiallyAin
Language School Database Model
a global economy. In this article,
we look at a data model that can help run a language school.
Learning a language can be challenging, but enrolling in a language school should be easy. You can enroll at
the school itself, or you can use an online form. In this article, we’ll examine a data model that allows for
Shares
online registration as well as other functions common to language schools. Six Things You Need to Know
About Securing Your Database
People can enroll in a course online or in person at the school. The school staff should be able to enter Five reasons why we built
student information, con rm their course reservation, and assign students to a speci c class. Students can Vertabelo
pay for their courses online or at the school.
Vertabelo API
Additionally, staff should be able to create new classes and assign students to them. The model should be
jOOQ – A really nice alternative
able to store details about students, teachers, languages, levels, and courses. There should also be a way to
to Hibernate
check if payments have been made.
VIEW COURSE
https://www.vertabelo.com/blog/technical-articles/a-language-school-database-model 2/13
2/24/2019 A Language School Database Model
Introduction to Python for
class_student
id
class
int PK
class_id
class_weekday
int PK FK
Data Science
id int PK name varchar(100)
class_id int FK weekday_id int PK FK
start_date date
Classes
id int PK level
description varchar(300) teacher_id int FK id int PK
photo image N is_active bit course sign char(2)
first_name varchar(50) login varchar(100)
id int PK name varchar(100)
last_name varchar(50) password varchar(100)
email varchar(50) lessons int
phone varchar(15) description varchar(300)
term varchar(100)
language
language_id int FK
level_id int FK id int PK
Teachers category_id int FK name varchar(100)
The diagram above shows the data model I’ve designed for a language school. It consists of six subject
areas:
Courses
Students
Teachers
Staff
Classes
Payments
Courses
This area stores information about languages, levels, age categories (to ensure the course is age-
appropriate) and course details. There are four tables: language , level , category , and
course .
https://www.vertabelo.com/blog/technical-articles/a-language-school-database-model 3/13
2/24/2019 A Language School Database Model
Shares
The language table stores the names of languages we teach, such as English, German, French, Spanish,
etc. It contains these elds:
The level table stores information about the pro ciency level associated with a course. This can be
expressed in a name (“novice”) or a symbol (“A1”, “C2”, etc.) This code is different in different parts of the
world, but we will limit it to two characters. This table contains:
name – A name representing the level of pro ciency, e.g. Novice, High, Expert, Conversational, etc.
https://www.vertabelo.com/blog/technical-articles/a-language-school-database-model 4/13
2/24/2019 code – A two-character symbol for the course’s language A Language
level, School
like A1, C2,Database Model
NL, D, 2+, etc. Note
that this is a CHAR(2) datatype.
Language students are often of different ages, which means the lesson content will be different. The
Shares category table is important, as it enables us to categorize courses by age group. It contains the
following elds:
name – A category name like “children”, “youth”, “adult”, etc. Courses in each category will have
specially prepared material for that age group.
Last in this area is the very important course table. It contains all course details and has these columns:
Students
This subject area stores students’ details like address, date of birth, name, email, and phone number. It also
stores their application account information. All data is held in two tables, student and
student_account .
https://www.vertabelo.com/blog/technical-articles/a-language-school-database-model 5/13
2/24/2019 A Language School Database Model
Shares
The student table stores each student’s name, contact information, date of birth, email, and phone
number. The date of birth is important because courses are personalized by age groups.
first_name – Self-explanatory.
last_name – Self-explanatory.
email – Self-explanatory.
phone_number – Self-explanatory.
The second and last table in this subject area is student_account . Its columns are:
is_active – Denotes if an account is active using a bit value: “0” for inactive, “1” for active. This
allows the admin to block or unblock accounts.
Shares
All columns in this table are mandatory.
Why separate the data in student_account from what’s in student ? Some people will enroll in the
of ce, without using the web application. They won’t have a web app account, so it makes sense to keep
these two sets of information separate.
Teachers
This subject area stores teachers’ names, optional contact data, their quali cations or credentials, and
optional teacher photos. It contains two tables: teacher and teacher_account . Notice that a
teacher can have an online account with the web app, but it is not required.
first_name – Self-explanatory.
last_name – Self-explanatory.
https://www.vertabelo.com/blog/technical-articles/a-language-school-database-model 7/13
2/24/2019 email – Self-explanatory. A Language School Database Model
phone – Self-explanatory.
The second table in this area is the teacher_account table. These are its columns:
Shares
is_active – Denotes if an account is active using a bit value: “0” for inactive, “1” for active. This
allows the admin to block or unblock accounts.
The reason for having separate teacher and teacher_account tables is the same as for the
students: some people will not have an app account.
Staff
This subject area contains information about language school employees, such as managers and
secretaries. There are two tables, staff and staff_account .
https://www.vertabelo.com/blog/technical-articles/a-language-school-database-model 8/13
2/24/2019 id – The primary key of the table. A Language School Database Model
first_name – Self-explanatory.
last_name – Self-explanatory.
phone – Self-explanatory.
The second and last table in this area is the staff_account table. These are its columns:
is_active – Denotes if an account is active using a bit value: “0” for inactive, “1” for active. This
allows the admin to block or unblock accounts.
Classes
This subject area contains data about course classes. A course can be made up of one or many classes.
Each class is made up of a number of lessons (or sessions) that take place on certain days. We also need a
reference table between the weekday and class tables called class_weekday . We’ll also have a
table called class_student that lets us associate classes and the students enrolled in them.
https://www.vertabelo.com/blog/technical-articles/a-language-school-database-model 9/13
2/24/2019 A Language School Database Model
Shares
The weekday table stores the weekdays our school is open. The columns in this table are:
The class_weekday table contains the following columns. Notice that the rst two are foreign keys,
relating this table to other tables in the subject area:
hours – Indicates the time when each class is held, e.g. ‘9.30 – 10.30’.
This table relates to data in the class and weekday tables. It is needed because we will have more
than one class during each weekday, and each class might be held on more than one weekday.
The class table is essential to this subject area. It stores the following columns:
name – The name of a course class. Note that this is one instance of a course, such as
“Intermediate German Spring 2018”.
teacher_id – References the teacher table and associates a teacher with this speci c class.
course_id – References the course table. Remember that one course can be implemented as
several different classes.
Shares
All columns in this table are mandatory.
Finally, we come to the class_student table. We can expect that the same student will enroll in more
than one class. And one class most likely will have several students. This table is needed for these
relationships. These are its columns:
Payment
Our last subject area records payment information related to students and classes. It stores details about
the total amount per course, the payment method used, and the status of a payment. We use two tables to
do this, payment_method and payment .
https://www.vertabelo.com/blog/technical-articles/a-language-school-database-model 11/13
2/24/2019 The payment_method table has only two columns: A Language School Database Model
name – The payment method name (i.e. “cash”, “credit card”, “debit card”, etc). If a student doesn’t
have an online account, they may pay in cash.
Shares
Both columns are required.
student_id – References the student table and relates a student with a payment.
class_id – References the class table and relates a payment with a speci c class.
Of course, there are areas where this model can be extended. What would you add? What would you
change? Tell us in the comments section below.
Follow @vertabelo
Like 0 Tweet
https://www.vertabelo.com/blog/technical-articles/a-language-school-database-model 12/13
2/24/2019 A Language School Database Model
Shares
https://www.vertabelo.com/blog/technical-articles/a-language-school-database-model 13/13