9.2.1 Database Structure
9.2.1 Database Structure In a database, an entity is a real-world thing that an organization uses. For example, a business considers each customer an entity. Similarly, a product that a business sells is another entity. An attribute provides a detail or characteristic of an entity. For instance, the customer's name and phone number are attributes of the customer. The name and price of a product are attributes of that product. A relationship connects two entities. When a business sells a product to a specific customer, that sale represents a relationship between two entities.A database stores a collection of organized information on a computer. Organizations choose different kinds of databases based on the type of information they need to store. Structured Data Structured data divides information into clear, separate categories. For example, consider books in a library catalog. Each book is different, but they all share the same categories: title, author, publication date, and call number. This kind of information is easy to store in a structured table, where every book has a value for each category. This setup is ideal for a relational database. All data in a structured database follows a strict plan or outline and connects between tables. Non-structured Data Non-structured data is information that doesn't have a clear order or pattern. Think about having a bunch of different things about the US Civil War, like journals, newspapers, photographs, telegrams, and pamphlets. To keep all these different items organized, people often use something called eXtensible Markup Language (XML). XML is similar to HyperText Markup Language (HTML), which is used to create websites, but instead of showing how things should look, XML uses special tags and codes to give structure to the documents or items. This makes it easier to manage and find different types of data in a database. Semi-structured Data Semi-structureddata falls between organized and unorganized. This type of data doesn't fit neatly into rows and columnslike a table, but it still shares some common features. For example, when you classify different types of animals, every species has a scientificname, an average size, and a known life expectancy. However, you don't need to store information about a dog's wingspan, and you don't need to include a space for a frog's beak size.A key pair database works best with semi-structured data. A key, also called a field, is a category of information. Some keys are the same for all items, but other keys can be different. This type of database doesn't have a search option, so you need to know the key to find the information you need.