GST Billing Software

header image

Database Basics

Erachana Line

2. Database Basics

Database is a systematic collection of data. Databases support storage, creation, access, manipulation and deletion of data. Databases make data management easy.

2.1 Database Architecture

The architecture of a database system is very much influenced by the primary computer system on which the database system runs. Database architecture can be seen as either single tier or multi-tier. An architecture having n-tier splits the entire system into related but independent n modules that can be independently customized, changed, altered, or replaced. A DBMS architecture is depending on its design and can be of the following types:

  • Centralized
  • Decentralized
  • Hierarchical

2.1.1 Three-Tier Architecture

A 3-tier architecture separates its tiers from each other based on the complexity of the users and how they use the data present in the database. It is the most widely used architecture to design a DBMS. A 3-tier application is an application program that is structured into three major parts; each of them is distributed to a different place or places in a network. These 3 divisions are as follows:

• Database (Data) Tier

• Application (Middle) Tier

• User (Presentation) Tier


  • Database (Data) Tier − At this tier, the database resides along with its query processing languages. We also have the relations that define the data and their constraints at this level.
  • Application (Middle) Tier − At this tier reside the application server and the programs that access the database. For a user, this application tier presents an abstracted view of the database. End-users are unaware of any existence of the database beyond the application. At the other end, the database tier is not aware of any other user beyond the application tier. Hence, the application layer sits in the middle and acts as a mediator between the end-user and the database.
  • User (Presentation) Tier − End-users operate on this tier and they know nothing about any existence of the database beyond this layer. At this layer, multiple views of the database can be provided by the application. All views are generated by applications that reside in the application tier.

2.2 Database Concepts

The intention of a database is to have a collection of data stored together to serve multiple applications as possible. Hence a database is often conceived of as a repository of information needed for running certain functions in a corporation or organization. Such a database would permit not only the retrieval of data but also the continuous modification of data needed for control of operations. It may be possible to search the database to obtain answers to queries or information for planning purpose. The main concepts that exists in the database are listed below:

  • Tables − In relational data model, relations are saved in the format of Tables. This format stores the relation among entities. A table has rows and columns, where rows represents records and columns represent the attributes.
  • Tuple − A single row of a table, which contains a single record for that relation is called a tuple.
  • Relation instance − A finite set of tuples in the relational database system represents relation instance. Relation instances do not have duplicate tuples.
  • Relation schema − A relation schema describes the relation name (table name), attributes, and their names.
  • Relation key − Each row has one or more attributes, known as relation key, which can identify the row in the relation (table) uniquely.
  • Attribute domain − Every attribute has some pre-defined value scope, known as attribute domain.

2.3 Database Schema

A database schema is the skeleton structure that represents the logical view of the entire database. It defines how the data is organized and how the relations among them are associated. It formulates all the constraints that are to be applied on the data.

A database schema defines its entities and the relationship among them. It contains a descriptive detail of the database, which can be depicted by means of schema diagrams. It's the database designers who design the schema to help programmers understand the database and make it useful.

A database schema can be divided broadly into two categories −

  • Physical Database Schema − This schema pertains to the actual storage of data and its form of storage like files, indices, etc. It defines how the data will be stored in a secondary storage.
  • Logical Database Schema − This schema defines all the logical constraints that need to be applied on the data stored. It defines tables, views, and integrity constraints.