Operation Manual
Note
A primary key uniquely identifies an item (or record) in the table. For example, you
might know two people called “Randy Herring” or three people living at the same
address and the database needs to distinguish between them.
The simplest method is to assign a unique number to each one: number the first
person 1, the second 2, and so on. Each entry has one number and every number is
different, so it is easy to say “record ID 172”. This is the option chosen here:
CollectionID is just a number assigned automatically by Base to each record of this
table.
Step 4: Create the table
1) If desired, rename the table at this point. If you rename it, make the name meaningful to
you. For this example, make no changes.
2) Leave the option Insert data immediately checked.
3) Click Finish to complete the table wizard. Close the window created by the table wizard.
You are now back to the main window of the database with the listing of the tables, queries,
forms, and reports. Notice that a table named “CD-Collection” is now listed in the Tables
portion of the window.
4) Click the Save button at the top of the main window.
Creating a table by copying an existing table
If you have a large collection of music, you might want to create a table for each type of music you
have. Rather than creating each table from the wizard, you can make copies of the original table,
naming each according to the type of music contained in it.
1) Click on the Tables icon in the Database pane to see the existing tables.
2) Right-click on the CD-Collection table icon. Choose Copy from the pop-up menu.
3) Move the mouse pointer below this table, right-click, and select Paste. The Copy table
dialog opens.
4) Change the table name to CD-Jazz and click Next.
5) Click the >> button to move all the fields from the left box to the right box and click Next.
6) Since all the fields already have the proper Field type, no changes should be needed.
However, this is the time and place to make any changes if they are needed. (See Caution
below for the reason why.) Click Create. The new table is created.
7) Click the Save button at the top of the main database window.
Caution
Once tables have been created using the wizard, and data has been entered, editing a
table should be very limited. You can add or delete fields, but adding a field requires you
to enter the data for that one field for every existing record with an entry for that field.
Deleting a field deletes all the data once contained in that field. Changing the field type
of a field can lead to data being lost either partially or completely. When creating a new
table, it pays to create the fields with the correct names, length, and format before you
add any data.
Deleting a table removes all of the data contained in every field of the table. Unless you
are sure, do not delete a table.
226 | Getting Started with LibreOffice 5.0