76. Create a Calc Database
75 About Calc Databases 77 Import Data into a Calc Database You already know how to create a Calc database if you know how to create a Calc spreadsheet. A database consists of records and fields (see 75 About Calc Databases ), and a sheet inside a spreadsheet consists of rows and columns that perform the same purpose as records and fields when you type data into them.
[View full size image]

1. | Type the Field Names To create field names for your database, you only need to type a one-line label atop each column in your spreadsheet's database. First, label your spreadsheet with an appropriate title that describes the database you're creating. Use the standard character-formatting tools (see 12 Apply Character Formatting ) to make the title and field names stand out.61 Center a Heading over Multiple Columns shows you how to center your database title in a wide column across the top of the fields. |
2. | Enter the Data Type the data that falls beneath the field names. Reserve one row for each record in your database. Use the standard data-entry techniques you'd use for any spreadsheet (such as pressing Tab or Enter at the end of a value, and so on).You may enter formulas if you wish. In a database that represents a checkbook register, for example, the Balance field (column) should be calculated and consist of a running total from your very first deposit that you used to set up the account in the first record.140 Access an Existing Database for more information. |
3. | Request a Data Range Once you've entered some or all of your database records (you can always add more later), you must define a data range for the data so that Calc will know which rows and columns hold database data. Select your database rows and columns that will make up your database. If you include the column titles above each column, Calc makes those titles the field names that you can refer to later when accessing the database. A range you define that specifies exactly which rows and columns comprise the records and fields of your database. If you include column title cells, Calc makes those titles the field headings in your database.Select Data, Define Range from the menu to display the Define Database Range dialog box. |
4. | Define the Data Range Type a name for the data range in the Name text box. Choose a simple name that you associate with this collection of data (don't include any spaces). Click the Define Database Range dialog box's More button to display extra options you'll often need to define the data range. If you've included column titles and you want Calc to make them field names, make sure to select the Contains column labels option. Calc fills in your selected range for you (using absolute addressing with the sheet name preceding the range), but you can change the range if you wish to. The Shrink button collapses the Define Database Range dialog box in case you want to look at your sheet once again without closing the dialog box (click Shrink again to restore the dialog box to its original size).Click Add to add the data range to Calc's stored databases. You can define multiple data ranges per sheet, but generally you'll be able to track your data better if you keep each sheet a separate database range. If you ever want to remove a defined data range, display the Define Database Range dialog box once again but click the Delete button instead of the Add or OK button to remove the data range from Calc's database collection. |