Topic: Databases. Hierarchical databases

Computer science lesson in 8th grade (I.G. Semakin)

Place of work, position: Municipal educational institution "Secondary School No. 27", Syktyvkar, computer science teacher Vasily Yuryevich Petrov.

Region: Komi Republic

Level of education: basic general education

Grade(s): 8th grade

Subject(s): Computer Science

Objective of the lesson: To become familiar with the concept of a database, its types, and organization.

Lesson type: Lesson on learning new material.

Students per class: 10-20

Equipment used: computer, projector, slides.

Lesson summary.

Topic: The concept of an information system, database, DBMS.

Objective of the lesson: to become familiar with the types of databases and the organization of data in them.

Tasks:

1. Educational

Learn to distinguish databases by type;

Provide techniques for reading tables as relational databases.

2. Developmental

Develop interest in structuring information;

To develop children's analytical thinking, their creative abilities, and the ability to work with various types of information.

3. Educational

Cultivate hard work, perseverance, and patience.

4. Personality-oriented

Creating communication situations in the classroom that allow each student to show initiative and independence.

Equipment: computer, projector.

Program part: presentation Microsoft Office Power Point.

Plan:

Organizing time.

Analysis of the studied material.

State the topic and purpose of the lesson.

Conversation.

Bottom line.

During the classes

Organizing time.

We prepared notebooks, pens, and paid attention to the board.

Analysis of the studied material.

Before we get to the topic of the lesson, let's remember what we studied in the previous lessons. Answer: information models: tabular, graphic, etc. You and I analyzed them independently, without using computer equipment. Modern means allow you to process data on a computer in large volumes.

State the topic and purpose of the lesson.

Let's talk about databases. (Slide No. 1)

Main conversation

Let's talk about structuring information, its collection and storage (Slide No. 2).

Information processing using computer technology will be called an information system. (Slide No. 3).

We give the concept of a DATABASE taking into account the available information (Slide No. 4).

Let's classify databases by type. We involve students in work by direct communication(Slide No. 5). Discussion.

We study each type of database in detail (Slides No. 6,7,8).

Let's get acquainted with relational databases, recall tabular information models (slide No. 9).

We turn to the key of relational databases. We talk about the uniqueness of each entry (slide No. 10).

We recall the types of information according to the form of presentation and talk about what data we can store in databases (Slide No. 11).

7. Lesson summary. (slide 19,20)

Our lesson is coming to an end. You worked so well today! What do you remember? What have you learned?

List of sources used

Computer science: textbook for 8th grade / I.G. Semakin, L.A.


  1. Introduction to Databases
    PPTX / 2.43 MB

    Zalogova, S.V. Rusakova, L.V. Shestakova. - 2nd ed., rev. - M.: BINOM. Knowledge Laboratory, 2014. - 176 p. : ill.

    The concept of a DBMS -

Slide 1

Lesson 38 computer science in 11th grade

Databases © Vyazovchenko Nataliya, 2010

Slide 2

Slide 3

Tabular Databases

A tabular database contains a list of objects of the same type, that is, objects that have the same set of properties. It is convenient to represent such a database in the form of a two-dimensional table: in each of its rows the values ​​of the properties of one of the objects are sequentially placed; Each property value is in its own column, headed by the property name.

Slide 4

Database field

The columns of such a table are called fields; Each field is characterized by its name (the name of the corresponding property) and the data type representing the values ​​of this property. A database field is a table column that contains the values ​​of a specific property.

Slide 5

Table rows are records about an object; these records are divided into fields by table columns, so each record represents a set of values ​​contained in the fields. A database record is a table row containing a set of property values ​​located in database fields.

Database entry

Slide 6

Key field

Each table must contain at least one key field, the contents of which are unique to each record in that table. A key field allows you to uniquely identify each record in a table. A key field is a field whose value uniquely identifies a record in the table.

Slide 7

The key field most often used is a field containing the counter data type. However, sometimes it is more convenient to use other fields as the key field of the table: product code, inventory number, etc.

Slide 8

The type of a field is determined by the type of data it contains. Fields can contain the following main types of data:

counter - integers that are set automatically when entering records. These numbers cannot be changed by the user; text - texts containing up to 255 characters; numerical - numbers; date/time - date or time; monetary - numbers in monetary format; logical - values ​​True (Yes) or False (No); hyperlink - links to information resource on the Internet (for example, a website).

Slide 9

Field properties

Each field type has its own set of properties. The most important properties of fields are: field size - determines the maximum length of a text or numeric field; field format - sets the data format; required field - indicates that this field must be filled in.

Slide 10

Consider, for example, the Computer database, which contains a list of objects (computers), each of which has a name. As characteristics (properties), we can consider the type installed processor and the amount of RAM. The Name and Processor Type fields are text, RAM- numeric, and field No. - counter (Table 11.1). Moreover, each field has a specific set of properties. For example, for the RAM field the data format is set to integer.

Slide 11

Slide 12

Slide 13

Hierarchical databases

Hierarchical databases can be graphically represented as an inverted tree consisting of objects at different levels. The top level (the root of the tree) is occupied by one object, the second - by objects of the second level, and so on. An example of a hierarchical database is Windows registry and catalog Windows folders.

Slide 14

Relationships between objects

There are connections between objects; each object can include several objects more low level. Such objects are in a relationship between an ancestor (an object closer to the root) and a child (a lower-level object), where an ancestor object may have no or several children, while a child object necessarily has only one ancestor. Objects that have a common ancestor are called twins

Slide 15

The hierarchical database is the Windows Folder Directory, which you can work with by launching Explorer. The top level is occupied by the Desktop folder. At the second level there are the folders My Computer, My Documents, Network Neighborhood and Recycle Bin, which are descendants of the Desktop folder, and are twins among themselves. In turn, the My Computer folder is the ancestor of third-level folders - disk folders (Disk 3.5 (A:), (C:), (D:), (E:), (F:)) and system folders (Printers, Control Panel, etc.)

Slide 17

Slide 18

Another example of a hierarchical database is the Domain Name System database for Internet-connected computers. At the top level there is a tabular database containing a list of domains top level(264 domains in total), of which 7 are administrative, and the remaining 257 are geographical. The largest domain (data as of January 2002) is the net domain (about 48 million servers), and in some domains (for example, in the zr domain) there is still not a single server registered. At the second level there are tabular databases containing a list of second-level domains for each first-level domain. At the third level there may be tabular databases containing a list of third-level domains for each second-level domain, and tables containing the IP addresses of computers located in the second-level domain

Slide 19

Slide 20

Distributed Database

The Domain Name System database must contain records of all computers connected to the Internet, that is, more than 150 million records. Placing such a huge database on a single computer would make searching for information very slow and inefficient. A solution to this problem was found by hosting individual database components on different DNS servers. Thus, the hierarchical database Domain Name System is a distributed database.

Slide 21

Searching for information in a hierarchical distributed database

For example, we want to get acquainted with the contents of Microsoft's WWW server. First, our request containing the server domain name www.microsoft.com will be sent to our ISP's DNS server, which will forward it to the top-level DNS server in the database. The domain com of interest to us will be found in the first-level table and the request will be addressed to the second-level DNS server, which contains a list of second-level domains registered in the com domain.

Slide 22

The microsoft domain will be found in the second-level table and the request will be forwarded to the third-level DNS server. In the third level table, an entry corresponding to domain name contained in the request. Searching for information in the Domain Name System database will be completed and the search for a computer on the network will begin by its IP address.



Database

scheme

filling

  • Defines what parameters and relationships objects have
  • Values ​​of parameters of objects currently recorded in the database

Statements about the full name, date of birth, address, telephone number of students at secondary school No. 20

Student Ivanov P.K., October 12, 1998, lives at mn2, no. 7, apt. 11, telephone 2 – 45 - 65


Database

factual

Library database

documentary

Law database

Contemporary music database


  • Database management system (DBMS) - This control program, designed for creating, entering, storing and processing databases.

Applied

program

Human

DBMS examples:

  • Microsoft Office Access
  • Visual FoxPro
  • Borland dBase.

DBMS

Database


Main features of the DBMS

  • high reliability of information storage;
  • updating, replenishment and expansion of databases
  • output complete and reliable information to inquiries;
  • ensuring information security.

Applied

program

Human

DBMS

Database


Data integrity in the database

  • Data integrity in the database
  • Integrity Constraint


Roles of users who work with the database

  • Developer
  • User
  • Administrator
  • Developer(creates a database schema)
  • User(works with data)
  • Administrator(defines integrity constraints and sets access rights)

Base models

data

Hierarchical databases

Network Databases

Relational Databases

Totality

objects,

various levels,

and one of them

is

the main thing, the rest -

subordinates

Totality

objects, with

many

connections between

information,

organized

rectangular


  • Information in databases can be organized in different ways.
  • Most often used tabular method.
  • Databases with a tabular form of organization are called relational databases.

Concept of essence

Class

student

Textbook

computer science

Training score

achievements

teacher

Domain model Computer science at school


  • The essence of the subject area– this is a set of objects that have the same set of parameters.
  • Entity-relationship model intended for graphic image entities of a certain subject area, their parameters and connections between them.
  • Essence Teacher: passport, full name, gender, specialty. (attributes)

  • One to one 1 – 1
  • One to many 1 –
  • Many to many
  • The teacher is the class teacher
  • Students study in grade 11 - A
  • Teacher teaches 11th grade

  • The essence of the subject area
  • Communication type

leads

Class

teacher

studies

Class

student

teaches

Class

Teacher



Basic Database Concepts

  • records(table rows)
  • fields(table columns)
  • key field(a field or several fields that uniquely identify a record)

Sigov A.K.

Fuchika 1 0, apt. 3 0

Pershin I.A.

434 1234

Rudenko T.V.

Umanskaya 2, apt. 1 6

1234 375

Sevastopolskaya 1, apt. 8

24 1234 0

Database (DB) - Database (DB) is a collection, in a certain way
organized information for some
topic.
For example:
Library book collection database;
Database of the institution's personnel;
Database of legislative acts in the region
criminal law;
Database of modern pop songs.

Database classification.

Databases are classified according to different criteria:
by the nature of the stored database information
are divided into factual and
documentary;
According to the method of storing data, databases are divided into
centralized and distributed;
according to the structure of the database organization
classified into relational
network and hierarchical.

In factual databases

contained brief information about
described objects, presented with
strictly defined format.
Examples:
1. In the library database about each book
The following information is stored: year
edition, author, title, etc.
2. Questionnaires are stored in the HR department database
employee data: full name, year of birth and
etc.

Documentary DB

contains extensive information about
various types: text, graphic,
sound, multimedia.
Examples:
1. in the database of laws - the texts of the laws themselves,
2. in the pop song database – texts and notes
songs, biography of authors, information about
poets, composers and performers,
sound and video clips.

Information system

– this is the totality of the database and the entire complex
hardware and software for it
storage, modification and retrieval
information to interact with
user.
Examples:
1. ticket sales systems
passenger trains and planes.
2. WWW is a global information platform
system.

Database (DB)

is a structured collection
interconnected data within
some subject area,
designed for long term
storage in external memory
computer and permanent
applications.

Can be used to store the database
to one computer, such a database
called centralized.
If different parts of the same database
stored on multiple computers
interconnected by a network, then
such a database is called
distributed database.

A database is called hierarchical,

in which information is organized
as follows: one element
records are considered the main one, the rest
subordinates.
Examples: file system

Family tree

The network is called a database,

in which to the vertical connections
horizontal connections are added.

Relational databases

- databases with tabular form
organizing information.
A relational database consists of one or
several interrelated
two-dimensional tables.

Examples:

In relational (tabular) databases, a row is called a record, and a column is called a field.

Fields are different characteristics
(sometimes called attributes) of an object.
Field values ​​in one line
refer to the same object.
Different fields have different names.

Example 1. Organization of information in a single-table database “Cinema repertoire for the week.”

Cinema
movie
Russia
Adventures 11.00
Pinocchio
Titanic
13.00
3.00
Russia
Russia
Titanic
Star
landing
17.00
21.00
20.00
15.00
World
Wait for it!
11.00
3.00
World
Titanic
13.00
15.00
World
Thief
17.00
10.00
Russia
time
price
15.00

Primary (master) key of the database

is a field or group of fields, with
with which you can clearly
identify the entry. Meaning
there should be no primary key
repeat for different records. IN
in the example discussed above
as the primary key of the database you need
take field group
cinema + time.

Field type

defines a set of values,
which this can take
field in various records.
IN relational databases data
There are four main types used
fields: numeric, character,
date, logical

Numeric types have fields whose values
can only be numbers. Numbers can be
whole and real.
Character types have fields that will
character sequences are stored
(words, texts, codes, etc.).
The date type has fields containing
calendar dates in various forms.
The boolean type corresponds to the field that
can take only two values:
“yes” - “no” or “true” - “false”.

Example 2. Describe the structure of the database “Cinema repertoire for a week.”

To describe a structure means to indicate everything
table fields and their characteristics.
field name
type
width
cinema
symbolic
15
movie
symbolic
25
time
numerical
5
2
price
numerical
5
2
quantity
decimal
signs

Example 3. Given a fragment of a relational database: Specify the main key; describe the characteristics of the fields.

Number Date
departure flight
2156
Type
Price
plane ticket
10.23.08 TU-154
4564.50
Availability
tickets
Yes

Main key: flight number + departure date. Field descriptions:

field name
type
width
Flight number
numerical
4
departure date
date
Aircraft type
symbolic
10
Ticket price
numerical
5
Availability
tickets
logical
Qty
decimal
signs
2

Example 4. Convert to tabular form the hierarchical structure shown in Fig.

Example 4: Convert hierarchical to tabular form
structure shown in Fig.
department
faculty
University
general physics
Physical
PSU
theoretical physics
Physical
PSU
organic chemistry
Chemical
PSU
inorganic chemistry
Chemical
PSU
botanists
Biological
PSU
zoology
biological
PSU

Task No. 1

Convert
below
information to
tabular view,
defining the table name and
name of each field:
Olya, Petya, 13, singing, 14,
basketball, Vasya, Katya,
13, hockey, basketball,
football, 15.11, Kolya, 11,
dancing, Seryozha.
Table title: Employment in
mugs
Name
Age circle
Olya
13
Singing
Peter
14
Basketball
Vasya
13
Hockey
Kate
15
Basketball
Kolya
11
Football
Serezha 11
dancing

Do it yourself:

1.
The “Patient” database table contains
fields: last name, first name, patronymic, date
birth, plot number, address,
presence of chronic diseases, date
last doctor's visit.
Determine the type and width of each