objectives(s) that this lesson is contributing to
10.3.2.1 define data
types in the database (SQL)
●Define database field data types
●Able to create single-table databases using
All learners will be able to know:
define data types of
create one-table database
create a multi-table
Subject vocabulary and terminology:
A series of useful phrases for dialogue / writing:
primary key is ...
Group work , co-operation,
time management, academic integrity
Cross curricular links
Course of the lesson
Planned stages of the lesson
Planned activities at the lesson
Definition of the topic.
Setting lesson objectives and success criteria
Students write goals and success criteria.
Learners remember and conceptualize the whole
process of creating a project.
Explaining a new topic
The teacher introduces the types of database
Students learn SQL
SQL is a simple programming language that has few commands that anyone
can learn. It stands for Structured Query Language - a structured
query language that was designed to work with the database, namely, to
receive / add / change data, to be able to process large arrays of
information and quickly obtain structured and grouped information. There are
many variations of the SQL language, but they all have almost the same
basic commands. There are also many DBMSs, but the main ones are: Microsoft
Access, Microsoft SQL Server, MySQL, Oracle SQL, IBM DB2 SQL, PostgreSQL and
Sybase Adaptive Server SQL. To work with SQL code, we need one of the
above DBMS. For training, we will use the Microsoft Access database.
SQL, like other programming languages, has its own commands (operators),
with the help of which instructions are given for retrieving data.
• INT [(len)] is an integer with a length of 4 bytes, which is
represented at the output as much as len
• SMALLINT [(len)] is an integer 2 bytes long, which is represented
at the output
maximum len digits;
• FLOAT [(len, dec)] - the real number that is displayed when
len dec characters after decimal point;
• CHAR (size) - a string of fixed-length characters of the size of
• VARCHAR (size) - a string of characters of variable length with a
maximum size of up to size of characters;
• BLOB (Binary Large OBject) - an array of arbitrary (binary) bytes
(the maximum size depends on the implementation, usually it is 65535 bytes);
this type of data can be used, for example, to store images;
• DATE - astronomical date;
• TIME - astronomical time.
Character constants (type CHAR and VARCHAR) are written as sequences
Characters enclosed in single apostrophes, such as "brass".
Decimal constants (such as FLOAT) can be written in “scientific”
The sequence of the following components:
• number sign;
• decimal number with a dot;
• the symbol "e";
• sign (“+” or “-”) of the exponent;
• an integer playing the role of the exponent of 10.
For example, the decimal number -0.123 can be written as -12.3e-2.
The difference between the CHAR and VARCHAR data types is that for
storage in a table
character strings of type CHAR use exactly size bytes (although the
contents of the stored strings
may be significantly shorter), while for VARCHAR strings, unallocated
string characters (“empty”) bytes are not stored in the table.
We emphasize that the len and dec values (unlike size)
do not affect the storage size.
data in the table, and only format the output of data from the table.
Pupils studying a single-table database
The task "Computer courses"
1) It is necessary to create an sql database for computer courses.
2) The database includes three main tables:
• the main table of the Group: a list of
numbers of study groups;
• Table List: list of students and
information on them;
• table Personal data: information on
students and marks on subjects.
3) Set the primary key
exercise can be done both verbally and in writing, depending on the time
available. For written execution, it is proposed to fill in a table of three
“P” - “plus” -
everything that was liked in the lesson is recorded, information and forms of
work that caused positive emotions, or, according to the student, may be
useful for him to achieve some goals.
“M” column - “minus” -
everything that was not pleasant in the lesson is recorded, it seemed boring,
disliked, remained incomprehensible, or information that, according to the
student, was not necessary for him, was useless.
column "I" -
"interesting" - students enter all the curious facts that they
learned in class, what else they would like to know about this problem,
questions to the teacher.
Plus + Minus
Differentiation – how do you plan to give
more support? How do you plan to challenge the more able learners?
Assessment – how are you planning to
check students’ learning?
Health and safety regulations
Work in pairs / groups - support for
Help the teacher, if required.
More capable learners can demonstrate
aspects of their decisions that seem interesting / more complex to the other
Answers questions and a
session of answers.
Use questions when completing
Use survey questions to
understand the results / success of learners at each stage of the lesson.
Remind of some safety rules when working
with computer equipment, for example, that you must be careful when
installing the screen, keyboard and mouse; beware of wires, as they pose a
threat to movement.
Lesson plan Long-term plan unit: 10
Explaining a new topic The teacher introduces the types of database
CHAR use exactly size bytes (although the contents of the stored strings may be significantly shorter), while for