0% found this document useful (0 votes)
85 views4 pages

Google Interview Question Preparation

The relational model represents data as a collection of tables, with each row representing a related set of data values describing a real-world entity. Data is stored and logically organized in tables, while physical storage can be independent. Popular relational database systems include DB2, Oracle, SQL Server and Access. Tables have rows and columns, tuples are rows, and relations define the structure with attributes, keys, and referential integrity constraints to link related data.

Uploaded by

Coder Coder
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
85 views4 pages

Google Interview Question Preparation

The relational model represents data as a collection of tables, with each row representing a related set of data values describing a real-world entity. Data is stored and logically organized in tables, while physical storage can be independent. Popular relational database systems include DB2, Oracle, SQL Server and Access. Tables have rows and columns, tuples are rows, and relations define the structure with attributes, keys, and referential integrity constraints to link related data.

Uploaded by

Coder Coder
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

Relational Data Model in DBMS

The relational model represents the database as a collection of relations. A relation is nothing
but a table of values. Every row in the table represents a collection of related data values.
These rows in the table denote a real-world entity or relationship.

The table name and column names are helpful to interpret the meaning of values in each row.
The data are represented as a set of relations. In the relational model, data are stored as
tables. However, the physical storage of the data is independent of the way the data are
logically organized.

Some popular Relational Database management systems are:

 DB2 and Informix Dynamic Server - IBM


 Oracle and RDB – Oracle
 SQL Server and Access - Microsoft

Relational Model Concepts

 Attribute: Each column in a Table. Attributes are the properties which define a relation.
e.g., Student_Rollno, NAME,etc.
 Tables – In the Relational model the, relations are saved in the table format. It is stored
along with its entities. A table has two properties rows and columns. Rows represent
records and columns represent attributes.
 Tuple – It is nothing but a single row of a table, which contains a single record.
 Relation Schema: A relation schema represents the name of the relation with its
attributes.
 Degree: The total number of attributes which in the relation is called the degree of the
relation.
 Cardinality: Total number of rows present in the Table.
 Column: The column represents the set of values for a specific attribute.
 Relation instance – Relation instance is a finite set of tuples in the RDBMS system.
Relation instances never have duplicate tuples.
 Relation key - Every row has one, two or multiple attributes, which is called relation key.
 Attribute domain – Every attribute has some pre-defined value and scope which is known
as attribute domain.
Relational Integrity constraints
Relational Integrity constraints is referred to conditions which must be present for a valid
relation. These integrity constraints are derived from the rules in the mini-world that the
database represents.

There are many types of integrity constraints. Constraints on the Relational database
management system is mostly divided into three main categories are:

 Domain constraints
 Key constraints
 Referential integrity constraints
Domain Constraints
Domain constraints can be violated if an attribute value is not appearing in the
corresponding domain or it is not of the appropriate data type.

Domain constraints specify that within each tuple, and the value of each attribute must be
unique. This is specified as data types which include standard data types integers, real
numbers, characters, Booleans, variable length strings, etc.

Example:

Create DOMAIN CustomerName


CHECK (value not NULL)
The example shown demonstrates creating a domain constraint such that CustomerName
is not NULL

Key constraints
An attribute that can uniquely identify a tuple in a relation is called the key of the table.
The value of the attribute for different tuples in the relation has to be unique.

Example:
In the given table, CustomerID is a key attribute of Customer Table. It is most likely to
have a single key for one customer, CustomerID =1 is only for the CustomerName ="
Google".

CustomerID CustomerName Status


1 Google Active
2 Amazon Active
3 Apple Inactive
Referential integrity constraints:
Referential integrity constraints is base on the concept of Foreign Keys. A foreign key is
an important attribute of a relation which should be referred to in other relationships.
Referential integrity constraint state happens where relation refers to a key attribute of a
different or same relation. However, that key element must exist in the table.

Example:

In the above example, we have 2 relations, Customer and Billing.

Tuple for CustomerID =1 is referenced twice in the relation Billing. So we know


CustomerName=Google has billing amount $300.

Operations in Relational Model


Four basic update operations performed on relational database model are

Insert, update, delete and select.


 Insert is used to insert data into the relation
 Delete is used to delete tuples from the table.
 Modify allows you to change the values of some attributes in existing tuples.
 Select allows you to choose a specific range of data.

Advantages of using Relational model

 Simplicity: A relational data model is simpler than the hierarchical and network model.
 Structural Independence: The relational database is only concerned with data and not
with a structure. This can improve the performance of the model.
 Easy to use: The relational model is easy as tables consisting of rows and columns is
quite natural and simple to understand
 Query capability: It makes possible for a high-level query language like SQL to avoid
complex database navigation.
 Data independence: The structure of a database can be changed without having to change
any application.
 Scalable: Regarding a number of records, or rows, and the number of fields, a database
should be enlarged to enhance its usability.

Disadvantages of using Relational model

 Few relational databases have limits on field lengths which can't be exceeded.
 Relational databases can sometimes become complex as the amount of data grows, and
the relations between pieces of data become more complicated.
 Complex relational database systems may lead to isolated databases where the
information cannot be shared from one system to another.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy