Lessons 20–21 · 2 lessons · N. I. Taylaqov (general editor), A. B. Akhmedov, M. D. Pardayeva, A. A. Abdug‘aniyev, U. M. Mirsanov. Informatics and Information Technologies, Grade 10, 1st edition. “Extremum-Press”, Tashkent, 2017
20
The concept of a database
Textbook: pp. 44–45
GoalExplains the concepts of a database and a data model; tells the hierarchical, network and relational models and structured data apart.
New words
database: an organised collection of related data stored in a computer · ma’lumotlar omboridata model: the rules for how data are structured and which operations can be done on them · ma’lumotlar modelirelational model: data are kept in tables (rows and columns) linked by key values · relyatsion modelstructured data: data written in an agreed layout, such as columns of a table · tuzilmalashtirilgan ma’lumot
Explanation
A database (DB) is a set of data stored in a computer’s memory, with a definite structure and linked together. It is needed in places such as a library, a school register, an online shop or airport flights, for quick searching, less repetition and many users working at the same time. A data model says how data are structured and which operations can be done on them. In the hierarchical model the data form a tree: each record has one “parent” record (school – classes – students). The network model also has links, but a record may be linked with several records. In the relational model data are kept in tables and the tables are linked by key values; most of today’s databases are based on this model. Data written in an agreed layout (by columns) are structured, while free text is called unstructured: the latter cannot be sorted by name or by year of birth.
💡 Where will I use this?
In real life
On a bus station board each trip has its destination, departure time and platform in separate columns. So a request like “all trips after 10 o’clock” is answered at once. If the same information were written as one long sentence, searching would be very hard.
Who uses it
Librarians, people who keep transport timetables and bank staff store data in a structured way and find it quickly.
Try it today
On paper draw a table with columns “title / author / year” for 5 books or songs you like and sort it by year.
Worked examples
Students (ID, Name, ClassID)ClassID→Classes (ClassID, ClassName)
A school: the tree “school → classes → students” is a hierarchical model. The link “student ↔ club” is a network model: one student attends several clubs and a club has many students – this is not a tree. In the relational model the tables Students(ID, Name, ClassID) and Classes(ClassID, ClassName) are linked through ClassID.
Surname
Name
Year of birth
City
Karimov
Bobur
2009
Samarkand
An unstructured entry: “Bobur Karimov, 2009, Samarkand”. The structured form: Surname = Karimov; Name = Bobur; Year of birth = 2009; City = Samarkand. In the second one “those born in 2009” can be found at once. The names in the examples are invented; do not put real personal data into an open database.
Class activity
“Which model?”: situations are written on cards (an organisation chart, a folder tree, a student ↔ subject table); groups mark each as hierarchical, network or relational and justify the choice.
Practice
1
What is a database?
A set of linked data with a definite structure stored in a computer’s memory.
2
A company hierarchy: director – heads of departments – employees. Which model fits?
hierarchical
3
A table has 5 columns and 30 rows. How many cells does it contain?
150
4
Why are searching and sorting hard with entries written as free text?
The name, year and city are not in separate fields, so the program cannot separate them.