Q2. What points do you need to remember while designing a database?
Ans. The points that you should keep in mind while designing the database are:
- Determining the purpose of your database: You have to decide why you need to create a database and how you intend to use it. You also need to know what type of information you want from your database.
- Determining the tables you require: Tables are one of the most important elements of a database. To create a well-organized database, you have to define the tables for it. Keep in mind the following points while determining your tables:
- Each table provides information about a single entity.
- A table does not contain duplicate values.
- Determining the fields you require: You need to decide the type and number of fields required for the tables in your database. Each table in a database contains data or information about a single entity. This information is inserted in the fields of the table. For example, the entity of the Emplouyee_Details table is the employee. This table has four fields, which contain information about the employees in an organization, such as employee code, name, address and salary. Keep the following points in the mind while determining the fields for the table:
- Each field is directly related to the entity of the table.
- Insert all the information you require in the respective fields of the table.
- Store the information in small logical parts, such as first name and last name rather than just name.
- Determining the primary key in a table: You need to identify a primary key for each table in your database. The primary key enables you to uniquely identify the data of a cell or field in a table. The primary key helps you to reduce data redundancy (duplication) in a table.
- Determining the relationship between tables: You need to determine relationship between two or more tables in your database. You can set a relationship between tables on the basis of common fields between them.
- Finalizing the database design: Refers to the process of checking your database design and identifying problems and loopholes in it, if any. If you are satisfied with the robustness of your database design, then you can go ahead to add data in the table.
- Adding data in a table and creating other database elements: Refers to the actual insertion of data in the table in your database. You can also create other database elements, such as queries, forms, and reports.