Access to create index _ MySQL

Source: Internet
Author: User
Access to create an index to quickly search for and sort records, you need to index a single field or a combination of fields. For a table, the index creation operation is to specify one or more fields to facilitate data retrieval or sorting based on the values of these fields. The indexes that can be created in Access 2000 are described as follows.

1. create a single-field index


"Single-field index" means that there is only one field in a table for indexing. you can follow these steps to create it:

Step 1. open the table in the design view.

Step 2. in the field list in the design view, click the field to create the index and select it.

Step 3. on the "General" tab, click the inside of the "index" attribute box, and select "Yes (there are duplicates)" or "Yes (no duplicates)" from the drop-down list, see 3.

In the "index" drop-down list shown in 3, click "yes (no duplicates)" to ensure that there are no duplicate values in the field. This is a common option.

After closing the view, the index is created. After that, you can sort the values in this field in ascending or descending order, and re-arrange the values of each row for display. That is, the result of this sort of sorting is that the records of each row are re-arranged in the table according to the index definition, which is conducive to browsing data records.

Note: fields used for indexing are usually used to sort data records, such as numbers and English words. They can also be used in Chinese, but are not commonly used.







3. click the drop-down button.



2. create a multi-field index

To create a multi-field index, follow these steps:

Step 1. open the table in the design view.

Step 2. click the "index" button in the toolbar of the "design" view. for details, see 4.





4. click this button.

Step 3. if the table does not have an index or a primary key, click the first blank row in the index name column in the "index" dialog box shown in figure 5 and enter the index name. Otherwise, you can enter it in the second row of the column to create the second index.



5. enter a name here.

The "index name" is only the index identifier. you can use the name of the index field or use a string with a certain meaning. For example, the "contract amount" index will be created in this example, so that you can sort the data records by contract amount in the future, so the index name shown in 5 is given.

Step 4. in the field name column, click the drop-down button and select the fields used for the index from the drop-down list. for details, see section 6.





6. select this field from the drop-down list.





7. click the drop-down button.

Step 5: Move the cursor to the "sorting order" column on the right, click the drop-down button, and select a sorting method from the drop-down list, see 7.

Step 6. to use multiple indexes and redefine the "primary key", click the "primary index" drop-down button in the lower left of the "index" dialog box, select "primary index" from the drop-down list shown in figure 8 ".



8. click the drop-down button.

Step 7: Move the cursor to the next row in the field name column, click the cell where the row is located, and select the second index field, such as the "unit address", from the drop-down list shown in 8 ".

In this step, the second index is specified, and the "Index Name" column of the row is still blank. You can repeat this operation until you select all the fields that should be included in the index. up to 10 fields can be selected. After the "index" dialog box is closed, the index used for this table is created. Then, you can go to the index dialog box to view and edit the index at any time according to the above operations. To delete an index, you only need to delete it from the list in this dialog box. such deletion will not display the structure and data records in the table.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.