Copy of G10- File structure and terminology.pptx

Full Transcript

Background You all have collections of data: school folders, telephone contact lists, music playlists and so on. How you store and use data is important because you want to be able to add, delete and search data easily. You also expect the data to be in some sort of order. In this lesson , you will...

Background You all have collections of data: school folders, telephone contact lists, music playlists and so on. How you store and use data is important because you want to be able to add, delete and search data easily. You also expect the data to be in some sort of order. In this lesson , you will discover how data is stored, how it is structured and how you refer to parts of the data collection. Lesson objectives Identify different database structures and the use of primary keys ● ● and foreign keys. Describe the need database tables. and properties of relationships between Files, records and fields ● A file is a collection of related structured data. ● Related means that all the data is connected with the same purpose of the theme. ● Structure means that you are storing the same variety of detail about each item in the file. Lesson objectives Identify different database structures and the use of primary keys ● ● and foreign keys. Describe the need database tables. and properties of relationships between Files, records and fields For example, a library has a file containing all the data about every book it has. The details about each book form a record and within the record each piece of data about the book, such as title or author name, is called a field. Each record has the same set of fields, which provides structure - the record structure. Lesson objectives Identify different database structures and the use of primary keys ● ● and foreign keys. Describe the need database tables. and properties of relationships between Key fields a field in a record that holds the unique data which identifies that record from all the other records in the file or database. At some stage records in a file need to be sorted, searched or merged. When searching through the records there may be times when there is more than one possible 'answer'. For example, the file for the cars might have more than one Ford Fiesta. Lesson objectives Identify different database structures and the use of primary keys ● ● and foreign keys. Describe the need database tables. and properties of relationships between Key fields This is a vital, or key requirement. In fact, a car does have a unique identifier the registration (licence) plate. No two cars have the same registration plate. This needs to be included as a field within the records, and because of its special use it is called the key field. Lesson objectives Identify different database structures and the use of primary keys ● ● and foreign keys. Describe the need database tables. and properties of relationships between Flat file or relational database A flat file database: is a collection of data held in a single table, meaning data can only be viewed in a limited way. Relational database: data may be held in a number of tables where links (or relationships) are created to connect the data in different tables to each other. Lesson objectives Identify different database structures and the use of primary keys ● ● and foreign keys. Describe the need database tables. and properties of relationships between Primary and foreign keys Primary keys: Primary keys is the key that is unique from others. Foreign keys: Foreign keys is a field in one table that uniquely identifies a row of another table. Foreign key is defined in a second table but it refers to the primary key in the first table. Lesson objectives Identify different database structures and the use of primary keys ● ● and foreign keys. Describe the need database tables. and properties of relationships between Relationships When two tables are joined together a relationship is created between them, as between Cars and Customers. There are different types of relationship depending on the kind of connection made. Lesson objectives Identify different database structures and the use of primary keys ● ● and foreign keys. Describe the need database tables. and properties of relationships between Relationships one-to-one: where the foreign key in one record can only ever match one other primary key in another table. Lesson objectives Identify different database structures and the use of primary keys ● ● and foreign keys. Describe the need database tables. and properties of relationships between Relationships one-to-many: where for one primary key in a record there are many matches to other foreign keys in another table. Lesson objectives Identify different database structures and the use of primary keys ● ● and foreign keys. Describe the need database tables. and properties of relationships between