

If you’re following the examples, you’d use EmployeeID as the key, since you can reliably assume that every user will have a different one. Remember that for it to work as the primary key, each field in that column must be unique to that table. As mentioned above, it’s generally a good idea to have one column in your table set as the primary key. On the next page, you’ll be asked to set a primary key. This can make sure that all new entries, regardless of who did it, must follow the rules of your database. If it’s essential that a record contain a certain field (in our example, and employee MUST have an ID number) make sure to set Entry Required to True for that field, as in the screenshot above. If you chose the fields from the dropdown menus in the wizard, these types should be automatically applied to the right fields. A number like EmployeeID makes sense as an integer, and text fields like first and last name should be text (CHAR or VARCHAR). On the second page of the Table Design wizard, you specify what type of data will go into that field. There’s (probably) no chance of two employees having the same ID number, so it makes a perfect primary key. That may sound confusing, but it typically just means that you need a column like EmployeeID, and each entry has a different, unique number. In short, this means that tables should generally have a column where each row in that column is unique on that table.

Secondly, it’s important for tables to have a primary key. If you find yourself putting anything into a table that does not match with the title of that table (like Employee or Billing), it probably belongs in a different table. For starters, each table should represent only one idea – ie the Employee table should not contain shipping information. Here we’ve chosen a small subset of the possible employee-related fields offered by Base.ĭatabase design is far too large a subject to cover here in detail, so we’ll just mention a few basics and leave some links at the bottom of this page for more detail. The radio buttons and dropdown menus on the wizard screen will allow you to choose from some pre-existing example fields. If you checked the box for the Table wizard, you should now be brought to a screen where you can begin laying out the information that your database will contain.Īs stated earlier, we’re creating a sample database containing employee information for a fictional company. The previous step should have finished by saving your new database to a file.

This is not a requirement, it’s only relevant if you plan to integrate this database with other OO products.īefore proceeding, it’s recommended that you check the box for “ Create Tables Using the Table Wizard“, especially if you’re new to database design. On the next step, you may be asked to register your database with OpenOffice. While many such wizards often get in the way, the wizard for Base is well constructed and can make the initial steps much simpler than going alone, especially if you don’t have much familiarity with database software.įor the purposes of this guide, we’ll be using the wizard to create a database containing sample employee information, then building a form to manipulate that database. When you launch Base, you’ll be taken to a “wizard” which can guide you through the first few steps.
#Open office mac access database install
Sudo apt-get install -base Creating Your Database
