Page 21 - Database-En-V3
P. 21

3. Divide the data and distribute it into tables according to their description of the
elements

   To divide the data into tables, the relevant data elements are grouped together to
   express a table or its main headings, as shown in the following figure. The main
   tables are the students, the results of the semester grades, the courses, and the
   course professors for example, as shown in the following figure No.2.

        student degrees               courses              students

•student code            •course name          •name
•seat number             •code                 •address
•foregin language 1      •mahor                •SSN
•foreign language 2      •class                •guardin phone
                                               •student code

                          Figure 2. Organized and divided data into tables for a school database

   When designing a database, each data (fact) is recorded only once. If you find
   yourself repeating the same data in more than one place, such as course names,
   place this data in a separate table with a suitable title/name represented a table.
   Columns should contain only data that is relevant to its title.

   For example, a course table should only store data about courses. Due to the course
   code and its major are facts about the course, and are not facts about the student
   result.

4. Convert the data elements in each table into columns

   Each item becomes a field and is displayed as a column in the table. To identify
   columns in a table, select the data you need to track in the table. For example, for
   the Students table, the following data is a good starting list of columns: Name,
   Address, City, and Parent Phone.

   After you select the first set of columns for each table, you can refine the columns.
   For example, it's best to store a student's name in two separate columns: First
   Name and Last Name, so you can sort, search, and index only those columns.
   Similarly, address. It actually consists of four separate components: Address, City,
   Postal Code, and Country/Region. If you want to search, sort, or filter by city, it is
   useful for storing in separate columns.

14 Training unit in the field of technological information - at the Supreme Council of Universities © Intellectual property rights 2024
   16   17   18   19   20   21   22   23   24   25   26