Introduction to database management system Part 1 - 2

There are several ways to start Microsoft Access depending on the operating system on your computer.

Method 1: Select Start, Program, Microsoft Access Method 2: Run from the icon on the Desktop or TaskBar

Method 3: In case you cannot find the program shortcut on the Desktop or in the start menu, you can run the Msaccess file directly in the Office installation folder, usually "C:Program FilesMicrosoft OfficeOffice".

For ease of presentation, Access 2013 is used below for all interfaces and practical instructions.

Figure 1.1 is the Access interface, including:

Maybe you are interested!

- Title bar

- Command toolbars

- Objects in the current database

- Status bar



Figure 1.1: Microsoft Access window

2.2 Create a new database

In Access 2013, all objects are integrated into a file with the extension .accdb.

To create a new database, do the following:

From the Microsoft Access window: select menu File/ New/ Blank desktop database.


Figure 1.2: Create new database

Click the Browse button to select the folder that will contain the database file to be created, in the File Name box, name the database. Then click the Create button. Now, a new database has been created, we can work with Access objects.


Figure 1.3: Database main window

The window in Figure 1.3 is called the Database window. This is one of the most important windows of Access. The window includes:

Ribbon command block system with bars: Home, Insert,… Database title: QLHangHoa is the name of the database

The objects of a database in Access include (items):

+ Table : These are the tables of the database.

+ Query : is the database query

+ Form : forms used to design program interface

+ Report : Statistical reports

+ Macro : Macros are used to execute actions in the database.

+ Module : contains procedures written in Access Basic.

2.3 Working with existing databases

To work (view, add, execute programs) with the above database, we can do it in the following ways:

Method 1 : Open File Explorer, select the folder containing the database, double-click the database name to open.


Figure 1.4: File Explorer window

Method 2 : From the Access startup window, in the Recent section, click to select the database, otherwise, click Open Other Files at the bottom.



Figure 1.5: Access startup window

After clicking Open Other File, the window below appears.


Figure 1.6: Open available database window

Click Computer, click the Browse button, the image below will appear, find the path containing the database to open.


Figure 1.7: Open window to open database

Method 3: From the Microsoft Access window, select the File menu, Open, and it will appear as shown in Figure 1.7 above.

When you open a database, if you want to select an object, click on that item. As shown above, we are selecting the Tables table object, this item contains a list of tables in the QLhanghoa database .


Figure 1.8

CHAPTER 2: TABLES AND RELATIONSHIPS

1. Structure of a table

- Tables are the most basic building blocks of a database. A table in a database must contain information appropriate to a particular type of entity, i.e. a table is a repository of information about a particular subject, such as a mailing list. We can have one or more tables in a database.

- Tables in a database are structured like spreadsheets. A table consists of fields and records.

- The rows (records) in the table represent a form of description of the typical entities stored in the table. The order of the rows in the table is not important, we can arrange them in any order without changing the meaning of the information in the table.

- A field is a specific piece of information. Fields can have different data types such as: Text, Number, Date/Time, ….

- Tables in a database are often related to each other.

2. Board design

2.1 Create table

Suppose we need to create a table for the Quanlybanhang database. When creating a blank database, the Access window for a new database is as follows:


Figure 2.1: Create new database

The sequence to create a table is as follows:

Click on the Create bar, choose one of the two following forms:

- Select Table: Create table and enter data

- Select Table Design to set up the table structure first, then enter data.

a) Select Table, then you will get the design window in Figure 2.2 as follows:

Figure 2.2: Create table

Click on Click to Add, a menu appears to enter the data field name, after completing the data field, enter the data.

When finished, click the Save button to save the table name. If not saved, Access will set the default table name as Table1.

b) If you click the Table Design button, the table structure setup window will be as follows:



Figure 2.3: Setting up fields for the table

+ The above part includes 3 columns: Field Name, Data Type, Description used to declare the fields of the table, each field declared on a line

+ The bottom part is used to specify the table properties.

To move between the two sections we can use the mouse or press the F6 key. The three columns of the upper section have the following meanings:

- Field Name: is a string of no more than 64 characters, including letters, numbers, and spaces. In general, object names in Access such as table names, field names, form names, etc. allow the use of spaces. However, a field name is not allowed to start with a space.

- Data Type: In the Data Type column, we can select a data type for the field. There are 10 following data types:

Comment


Agree Privacy Policy *