1. Database – is a collection of related files (Tables)
2. File (Table) – is a collection of records (Rows)
3. Record (Rows) – is a collection of fields (Columns)
4. Field (Columns) – is a collection of characters (Bytes)
5. Character (Bytes) – is a collection of 8 bits
6. Bits – the smallest representation of data, it is either 1 (on voltage) or 0 (off voltage)
Database
File Table
Record Rows
Field Columns
Character Bytes
Bits
Advantages of database over the file system:
Good for User:
1. Sharing the data
2. No duplication of data (most important)
3. Data integrity
4. Security
5. Flexibility
6. Obtain more information from the same amount of data
Good for Programmer:
7. Data independence of program
8. Program maintenance easier
9. Increase programmer productivity
10. Economy of scale
Disadvantages of a database system over the file system:
1. Size (Need more memory)
2. Complexity for programmer (developer needs to know database & programming)
3. Cost factor (only during the design phase)
4. Additional hardware (build network)
5. Higher impact of failure
Functions of database:
1. Data storage
2. Updating data (Ex: Add, Modify, Delete data)
3. Retrieve data (Processing information)
4. Backup and recover
5. Exporting and importing data
6. Keeping integrity of data
------------------------------------------------------------------------------------------------------------
Types of database systems:
1. Relational database
- Data and structure are independent in program
- Use tables (rows and columns)
- Use query
- Powerful management system
- Use the following types of relationships between tables:
A. One-to-one relationship (1:1)
- A particular driver drives a particular car
B. One-to-many (1:M)
- 1 employee helps many customers
C. Many-to-many (M:N)
- Many students take many classes
2. Tree