Examples of a Database

Here are some examples of relational database designs.

In the first example, we are making a database for tasks that need to be done. There is a table of task which will list in a company or the different task for the day or the week this will be done after a meeting and each task is given a priority so we have another table showing the priorities. This majors be high, medium or low priority but the problem is when we don’t use the table and make sure the priorities are listed then different people using the database could enter different things for example, one person might use high, medium low priority whereas another person entering might use priority 1,2 and 3 so the reason we use a priority table is to make sure that you can only enter one of the those priorities that are listed in that priority table. The assignee table is the person who is going to do the task so under assignees, first you would list all the different people involved and then as tasks are entered, the person can be selected and the assignee can be selected.

In the second example we can see typical order entry design; the customer table is connected to an order’s table which is connected to order items and order items are connected to the products. The first tables to be filled will be the customer and the products and once those field the order will be related to the customer, you cannot enter an order unless the customer is already there. And with an order item you can only enter order item once an order has been made and as long as there is a product to enter. You cannot enter a product that is already on the product’s table.

In the 3rd example which shows a student table connected to an enrollment table, a class table and subject table. This is design used for school or maybe online classes. The subject will probably be the first table to complete with all the different subjects being taught and if one subject is being taught more than once, then you need the subject and a class table because one subject will have many classes. On the other side, the student needs to join a class and a student can have many classes and a class can have many students so we put a table between them which is called enrollment. Information on student table will be name, address, telephone number, maybe age and maybe some background information like previous courses and the class table there might be information like the room where the classes being taught in or the purpose of the enrollment table is to join the students together with the class and there might be other fields in this table such as whether the fee is paid or not or how much money he needs to pay

  • Facebook
  • StumbleUpon
  • Twitter
  • Delicious
  • LinkedIn
  • MySpace
  • Squidoo
  • Share/Bookmark