What is database object? Discuss the database objects used to store and retrieve data?

A component of a database system is known as database objects. MS Access provides various objects that are used to store and retrieve data from database.

The major database objects in MS Access are as follows:

  • Tables
  • Queries
  • Forms
  • Reports

What is Database Objects

The database object table is used to store data in database. The database object query is used to retrieve data from database.

Tables

Table is the most important object of a database. It is the central concept in relational databases. All data in a relational database is stored in tables. Table is known as relation. Following is an example of a table:

RegNo Name Class
10 Nadeem Khalil MSc
20 Muhammad Usman BSc
30 Noman Qadir FSc

Figure 5.1: An example of Table

               A table is a collection of related data organized in rows and column. Rows are also called records. In the above figure, information of each student is stored in a separate row. Each row is subdivided into fields.

A database normally consists of many tables. Each table is identified by separate name. An important task in designing a database is the decision that which tables should be included in the database and which fields should be included in each table.

Queries

A query is a statement that extracts specific information from database. Queries are used to retrieve the required data from database. Data is retrieved according to the criteria given by the user. It is a more flexible way of selecting, filtering and sorting records.

The query is written in database access language. The most commonly used query language is SQL. A query retrieves data from the database and displays it in the form of table. The user can also change data in the database by using queries. Queries can also be used to perform calculations on different fields. The output of a query can be used as source of records for forms and reports.

A query is used to view and analyze data in many ways. It is actually a stored question or request. The queries are designed in Design view of MS Access.

Example

Suppose a table Students contains the following rows:

Roll No Name Marks Grade
1 Usman 730 A
2 Nadeem 662 B
3 Abdullah 685 B
4 Adnan 531 C

Figure 5.2: Students Relation

                The user executes a query to retrieve the records of the students who got more than 600 marks. The query will display the following table as result:

Roll No Name Marks Grade
1 Usman 730 A
2 Nadeem 662 B
3 Abdullah 685 B

Figure 5.3: Result of the query

               The information retrieved by the query appears like datasheet view of a table. The difference is that a query’s datasheet may consist of information from multiple tables.