You are on page 1of 19

Revision class Unit - 1

What is data ?
• Data is an individual unit that contains raw materials which do not carry any specific meaning. Data
basically contains raw facts and figures.
• In a nutshell, data can be a number, symbol, character, word, codes, graphs, etc.

• Example :

1. Employee’s id number.
2. His/her location (where the employee sits in the organization)
3. Contact number.
4. Number of people working under him/her
5. The reporting person of the employee
6. The tasks which are currently being handled by the employee
7. All constitute data only (raw facts and figures)
Data and information
• Organized data is called information.
• Example: Like we know the location of all the employees , if we take a look at all the data together
we will know where this particular team sits in the org. Who is the reporting manager that handles
the entire team (basically the goto guy) and the amount of work that is handled by the team. If the
team is overloaded and we need to hire a few more people to manage the work better in the team
and increase the budget of the team.

• When data is processed, organized. Structured or presented in a given


context so as to make useful, it is called information.
What is database?
• A database is an organized collection of data, so that it can be easily accessed and managed.
• You can organize data into tables, rows, columns, and index it to make it easier to find relevant
information.

• Types of database models:


1. File-based model
The file system is basically a way of arranging the files in a storage medium like a hard disk. The file system
organizes the files and helps in the retrieval of files when they are required. File systems consist of different
files which are grouped into directories. The directories further contain other folders and files.
Types of database models
2. Hierarchical Data Model
The data is organized into a tree-like structure where each record consists of one parent record and many
children
Example:
• Like suppose person A is the CEO if a company .
• And person B, C , D reports to A.
• Now E, F , G, H reports to B
So, in this manner we can see a hierarchy is getting formed. So, this is small example if how data can
be organized in a tree like structure.
Types of database models
3. Network data model

• This model is the generalization of the hierarchical model. This model can consist of multiple parent
segments and these segments are grouped as levels but there exists a logical association between the
segments belonging to any level. Mostly, there exists a many-to-many logical association between any of
the two segments. We called graphs the logical associations between the segments
• Example:
• SALES-MAN, CUSTOMER, PRODUCT, INVOICE, PAYMENT, INVOICE-LINE are the types of records
for the sales of a company. Now, as you can see in the given figure, INVOICE-LINE is owned by
PRODUCT & INVOICE. INVOICE has also two owners SALES-MAN & CUSTOMER. 
Types of database models
4. Relational Database
• The relational model represents how data is stored in Relational Databases.  A relational database
stores data in the form of relations (tables).
• Relational database model has two main terminologies called instance and schema. The instance is a
table with rows or columns. Schema specifies the structure like name of the relation, type of each
column and name.
• Example: table: Student.
Roll_NO  NAME ADDRESS PHONE AGE

1 RAM DELHI 9455123451 18

2 RAMESH GURGAON 9652431543 18

3 SUJIT ROHTAK 9156253131 20

4 SURESH DELHI   18
Types of database models
5. Cloud database:
• Cloud database facilitates you to store, manage, and retrieve their structured, unstructured data via
a cloud platform. This data is accessible over the Internet.

• Lower costs

• Automated

• Cloud databases are enriched with a variety of automated processes such as recovery, failover, and
auto-scaling.

• Increased accessibility

• You can access your cloud-based database from any location, anytime. All you need is just an
internet connection
Types of database models
6. Object – Oriented Database
The object-oriented databases contain data in the form of object and classes. Objects are the real-world entity, and
types are the collection of objects. An object-oriented database is a combination of relational model features with
objects oriented principles. It is an alternative implementation to that of the relational model.
Examples of database / Application of database
• How Netflix database might be stored? In which of the above structures. – cloud database. (AWS for storing the tv series and
shows).
• Basic Design of Netflix:
• Components:
1. User Interface- manages the user interface of the website/Application
2. Network – server unit – gets the data needed for streaming from the server.
3. Backend – database – storing of the data ( video files, text files , user data)
• Basic structure of Netflix should look like:
• UI -> Server -> database
• The User will give command at the UI layer that I want to watch this particular video, the UI layer will fetch this
particular video file for streaming from server. Server will get the file from streaming from database where it is stored.
Usually for storing the files needed Netflix type streaming service uses cloud (AWS) for storing the video/ audio/text files.
What is database management system?
• A database management system (DBMS) is a computer program designed to manage a
large amount of structured data, and run operations on the desired data requested by the
users.
• Database Management System is a software or technology used to manage data from a database.
• Examples include: banking system which maintains , manages the data.
• DBMS allows users the following tasks: 
1. Data definition: creation and modification or removal of structure of data base.
2. Data Updation : insertion, modification or deletion of the actual data of the database.
3. Data retrieval: able to retrieve the data which is stored in the database. Like we have a
database which is organised in the form of tables. If we want to retrieve only one row from
the table we can do that with the help of SQL (structured query language)
4. User administration: management of users those who have the access to database.
( multiple type of access like : read only access or read – write access etc. management of
these accesses can be provided with the help of database. )
Data Base 3-tier architecture
• DBMS 3-tier architecture divides the complete system into three inter-related but independent modules as
shown below
• Physical level: physical level of a database describes how the data is being stored in secondary storage
devices
• Conceptual Level: At conceptual level, data is represented in the form of various database tables
• External Level:  An external level specifies a view of the data in terms of conceptual level tables.  Each
external level view is used to cater to the needs of a particular category of users
Data independence
• Data independence refers characteristic of being able to modify the schema at one level of the
database system without altering the schema at the next higher level.

• Types of data independence:


o Physical Data Independence: Any change in the physical location of tables and indexes should not affect
the conceptual level or external view of data. This data independence is easy to achieve and implemented
by most of the DBMS.

o Conceptual Data Independence: The data at conceptual level schema and external level schema must be
independent. This means a change in conceptual schema should not affect external schema. e.g.; Adding or
deleting attributes of a table should not affect the user’s view of the table.
File – based systems versus database management systems
• File System manages data using files on a hard disk. Users are allowed to create, delete, and update the files
according to their requirements.
• Let us consider the example of file-based University Management System. Data of students is available to
their respective Departments, Academics Section, Result Section, Accounts Section, Hostel Office, etc.
Some of the data is common for all sections like Roll No, Name, Father Name, Address, and Phone number
of students but some data is available to a particular section only like Hostel allotment number which is a
part of the hostel office
• Issues with this system:
• Redundancy of data
• Inconsistency of Data
• Difficult Data Access
• Unauthorized Access
• No Concurrent Access
• No Backup and Recovery
Database view
• A database view is a subset of a database and is based on a query that runs on one or more database tables.
Database views are saved in the database as named queries and can be used to save frequently used, complex
queries
• Views have filters to determine which records they show. Views can be sorted to control the record
order and grouped to display records in related sets.
• we can say that Views are useful for Hiding unwanted information

• Example for database view :

• Like suppose there is a relational database of a company consisting of 4 columns:

Employee id , employee name, org they are working , reporting manager. If we want to get the data of a
particular department we can get that with the help of a query. And the resultant will be a view.
Database users and administrators
1. Database administrators(DBA): Database Administrators (DBA) are the most important type of
database users in DBMS. Database Administrator is an individual or a team of users who define
the database schema and takes charge of controlling various levels of the database within the organization.
Database Administrators (DBAs) can grant or revoke authorization permission to all other users at any
point of time.
2. Naïve users: End Users are the unsophisticated who don’t have any DBMS knowledge but they frequently
use the database applications in their daily life to get the desired results. For examples, Railway’s ticket
booking users are naive users. 
3. Application programmers: Application Programmers also known as Back-End Developers, are
computer professional users who are responsible for developing the application programs (C, C++, Java,
PHP, Python, etc.) or the user interface so that other users can use these applications to interact with the
database.
4. Sophisticated users Sophisticated users can develop or access their database applications according to the
requirements, without actually writing the program code for it. These users are also known as SQL
programmers as they can interact with the database directly using SQL queries using query processors
5. Database designers: As the name suggests, Database Designers are the users in DBMS who design and
create the structure of the database including triggers, indexes, schemas, entity relationships, tables,
constraints, etc. which complete the database.
Database system structure
ER Diagrams
• Entity relationship diagrams:
Entity Relationship Diagram explains the relationship among the
entities present in the database
Components of ER Diagram:
Additional features of ER diagram
• Generalization:
Generalization is a abstracting process of viewing sets of objects as a single
general class by concentrating on the general characteristics of the
constituent sets while suppressing or ignoring their differences
• Specialization :
Specialization is the abstracting process of introducing new characteristics to
an existing class of objects to create one or more new classes of objects.
• Aggregation:
Aggregation is the process of compiling information on an object, thereby
abstracting a higher level 
Relational Model
• The relational model represents how data is stored in Relational Databases. A
relational database consists of a collection of tables, each of which is assigned
a unique name.
• IMPORTANT TERMINOLOGIES
• Attribute
• Relation Schema
• Tuple
• Relation Instance
• Degree
• Cardinality
• NULL Values

You might also like