Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
80 views37 pages

Ism Project

Ipu ism file for semester 5 bba

Uploaded by

John Joseph
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)
80 views37 pages

Ism Project

Ipu ism file for semester 5 bba

Uploaded by

John Joseph
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/ 37

PRACTICAL FILE

ON
INFORMATION SYSTEM MANAGEMENT-LAB

GURU GOBIND SINGH INDRAPRASTHA UNIVERSITY


In partial fulfillment of the requirement for the award of the degree of

BACHELOR OF BUSINESS ADMINISTRATION


Batch 2021 - 24

SUBMITTED BY: SUBMITTED TO:


ISHIKA Dr. Aarti Budhiraja
EN. NO – 02215501721 ASSISTANT PROFFESOR

NEW DELHI INSTITUTE OF MANAGEMENT


61A, TUGHLAKABAD, NEW DELHI-62
CERTIFICATE

This is to certify that the practical titled “Information System Management-Lab” submitted by
Ishika to New Delhi Institute of Management, Guru Gobind Singh Indraprastha University in partial
fulfillment of requirement for the award of the Bachelor of Business Administration degree is an
original piece of work carried out under my guidance and may be submitted for evaluation. The
assistance rendered during the study has been duly acknowledged. No part of this work has been
submitted for any other degree.

Dr. Aarti Budhiraja


ACKNOWLEDGEMENT

Any accomplishment requires the effort of many people and this work is not
different. Regardless of the source, I wish to express my gratitude to those who
may have contributed to this work, even though anonymously.

I would like to pay my sincere thanks to my Information System


Management-Lab” faculty Dr. Aarti Budhiraja under whose guidance I was
able to complete my Practical successfully. I have been fortunate enough to get
all the support, encouragement and guidance from him needed to explore, think
new and initiate.

My final thank goes out to my parents, family members, teachers and friends who
encouraged me countless times to persevere through this entire process.

Ishika
INDEX

S.NO. TOPIC

1 Explain Information System Management.

2 Introduction of Database Management System.

Introduction to the following Concepts.

a. DDL
3
b. DML

c. Aggregate Function

4 Explain ERD with an Example.

Create Employee Table with EMP_ID, EMP_NAME, EMP_DEPT,


5 EMP_ADDRESS, MOBILE_NUMBER, EMP_SALARY and then
Use Aggregate function by Queries

Write the query for these command

ALTER

6 INSERT

UPDATE

LIKE
Q1. Explain Information System Management?
MIS is the use of information technology, people, and business processes to
record, store and process data to produce information that decision makers can
use to make day to day decisions. The full form of MIS is Management
Information Systems. The purpose of MIS is to extract data from varied sources
and derive insights that drive business growth.
The three components of MIS provide a more complete and focused definition,
where System suggests integration and holistic view, Information stands for
processed data, and Management is the ultimate user, the decision makers.

DEFINITION

Management Information System or 'MIS' is a planned system of collecting,


storing, and disseminating data in the form of information needed to carry out the
functions of management.
Management information system can thus be analyzed as follows −

Management
Management covers the planning, control, and administration of the operations
of a concern. The top management handles planning; the middle management
concentrates on controlling; and the lower management is concerned with actual
administration.
Information
Information, in MIS, means the processed data that helps the management in
planning, controlling and operations. Data means all the facts arising out of the
operations of the concern. Data is processed i.e. recorded, summarized,
compared and finally presented to the management in the form of MIS report.
System
Data is processed into information with the help of a system. A system is made
up of inputs, processing, output and feedback or control.
Thus MIS means a system for processing data in order to give proper information
to the management for performing its function.

THE NEED OF MIS


1. Data Management: MIS helps in the efficient organization and
management of vast amounts of data generated within an organization.
2. Decision-Making Support: It provides timely and relevant information
to aid in decision-making processes at various levels of an organization.
3. Strategic Planning: MIS assists in strategic planning by offering insights
into market trends, competitor analysis, and other critical factors
influencing business strategies.
4. Resource Optimization: It helps in optimizing resources by providing
real-time information on inventory levels, production schedules, and
resource utilization.
5. Performance Monitoring: MIS allows for the continuous monitoring and
evaluation of organizational performance against set goals and
benchmarks.
6. Improved Communication: It enhances communication by providing a
centralized platform for sharing information across different departments
and levels of an organization.
7. Customer Relationship Management (CRM): MIS supports CRM
activities by organizing and analysing customer data to improve customer
satisfaction and loyalty.
8. Risk Management: It aids in identifying and managing risks by providing
comprehensive data on various aspects of the business environment.
9. Cost Control: MIS facilitates cost control through the analysis of financial
data, budget monitoring, and identification of areas where cost savings can
be achieved.
10.Adaptability to Change: In a dynamic business environment, MIS helps
organizations adapt to changes by providing the necessary information for
quick and informed decision-making.

OBJECTIVES OF MIS
The objectives of Management Information Systems (MIS) are as follows:
1. Data Management: To efficiently collect, store, and manage data
generated within an organization.
2. Timely and Accurate Information: To provide timely and accurate
information to support decision-making processes at various levels of the
organization.
3. Decision Support: To assist managers and executives in making informed
and effective decisions by providing relevant data and analysis.
4. Strategic Planning: To support strategic planning by offering insights
into market trends, competitor analysis, and other factors influencing long-
term organizational goals.
5. Resource Optimization: To help optimize the use of organizational
resources, including human resources, finances, and technology.
6. Performance Monitoring: To monitor and evaluate organizational
performance against set objectives and key performance indicators.
7. Enhanced Communication: To improve communication and information
sharing across different departments and levels of the organization.
8. Customer Relationship Management (CRM): To organize and analyze
customer data, enhancing the management of customer relationships and
improving customer satisfaction.
9. Risk Management: To identify and manage risks by providing relevant
information on the business environment and potential threats.
10.Cost Control: To facilitate cost control through the analysis of financial
data, budget monitoring, and identification of areas for cost reduction.
11.Adaptability to Change: To enable organizations to adapt to changes in
the internal and external environment by providing the necessary
information for agile decision-making.
12.Security and Privacy: To ensure the security and privacy of sensitive
organizational information through the implementation of appropriate
measures and protocols.
13.Capturing Data − Capturing contextual data, or operational information
that will contribute in decision making from various internal and external
sources of organization.
14.Processing Data − The captured data is processed into information needed
for planning, organizing, coordinating, directing and controlling
functionalities at strategic, tactical and operational level. Processing data
means −
1. making calculations with the data
2. sorting data
3. classifying data and
4. summarizing data
15.Information Storage − Information or processed data need to be stored
for future use.
16.Information Retrieval − The system should be able to retrieve this
information from the storage as and when required by various users.
17.Information Propagation − Information or the finished product of the
MIS should be circulated to its users periodically using the organizational
network.

CHARACTERISTICS OF MIS
The characteristics of Management Information Systems (MIS) are as follows:

1. Data Integration: MIS integrates data from various sources within an


organization to provide a unified view and facilitate comprehensive
analysis.
2. Decision-Support: It is designed to support decision-making processes
by providing relevant and timely information to managers at different
levels.
3. Structured and Unstructured Data: MIS can handle both structured
data (e.g., databases) and unstructured data (e.g., reports, documents) to
provide a holistic view of information.
4. Goal-Oriented: MIS is aligned with the organizational goals and
objectives, providing information that helps in achieving strategic targets.
5. Modularity: It is often modular in design, allowing for flexibility and
scalability to accommodate the changing needs of an organization.
6. User-Friendly Interface: MIS typically has a user-friendly interface,
making it accessible to users with varying levels of technical expertise
within the organization.
7. Real-Time Processing: In many cases, MIS provides real-time or near-
real-time processing of information, ensuring that decision-makers have
the most current data available.
8. Security Measures: MIS incorporates security measures to safeguard
sensitive organizational data and ensure confidentiality, integrity, and
availability.
9. Customization: It can be customized to meet the specific requirements of
different departments or functional areas within an organization.
10.Feedback Mechanism: MIS often includes feedback mechanisms that
allow users to provide input and improve the system over time.
11.Interconnectedness: MIS facilitates communication and information
sharing across different departments, promoting a connected and
collaborative organizational environment.
12.Continuous Monitoring: MIS enables continuous monitoring of
organizational performance, helping in the identification of trends,
patterns, and areas for improvement.

NATURE AND SCOPE OF MIS


The following diagram shows the nature and scope of MIS −

COMPONENTS OF MIS

The key components of Management Information Systems (MIS) are as


follows:

1. People: People are a crucial component of MIS. This includes the


individuals who use the system, such as end-users, managers, IT
professionals, and system analysts. Training and support for these
individuals are essential for the effective implementation and utilization
of MIS.
2. Data: Data is the raw material of MIS. It includes all the facts and figures
that are collected, processed, and stored by the system. This can
encompass various types of data, including customer information, sales
figures, inventory levels, and more.
3. Business Procedures: Business procedures refer to the methods and
processes that an organization follows to achieve its goals. MIS integrates
and supports these procedures, streamlining workflows and ensuring that
information flows seamlessly through the organization.
4. Hardware: Hardware constitutes the physical components of the
information system, such as computers, servers, networking devices, and
storage devices. These components work together to process and store
data efficiently.
5. Software: Software is the set of programs and applications that enable
the hardware to perform specific tasks. In the context of MIS, software
includes database management systems, reporting tools, and other
applications tailored to the needs of the organization.
Q-2. Introduction of Database Management System.
Database: Database is a collection of inter-related data which helps in efficient
retrieval, insertion and deletion of data from database and organizes the data in
the form of tables, views, schemas, reports etc. For Example, university database
organizes the data about students, faculty, and admin staff etc. which helps in
efficient retrieval, insertion and deletion of data from it.

DATA

In simple words, data can be facts related to any object in consideration. For
example, your name, age, height, weight, etc. are some data related to you. A
picture, image, file, pdf, etc. can also be considered data.

DATABASE
A database is a systematic collection of data. They support electronic storage and
manipulation of data. Databases make data management easy.

Database example: An online telephone directory uses a database to store data of


people, phone numbers, and other contact details. Your electricity service
provider uses a database to manage billing, client-related issues, handle fault data,
etc.

Let us also consider Facebook. It needs to store, manipulate, and present data
related to members, their friends, member activities, messages, advertisements,
and a lot more. We can provide a countless number of examples for the usage of
databases.

NETWORK DBMS

This type of DBMS supports many-to-many relations. It usually results in


complex database structures. RDM Server is an example of database management
system that implements the network model.
Database Components

Database Components

There are five main components of a database:

1. Hardware: This includes the physical components of the computer


system that support the database, such as servers, storage devices, and
networking equipment. The hardware ensures that data is stored,
processed, and accessed efficiently.
2. Software: The software component of a database system includes the
database management system (DBMS), which is responsible for
managing and organizing the data. The DBMS provides an interface for
users and applications to interact with the database, and it includes
various tools for data manipulation, retrieval, and security.
3. Procedures: Procedures involve the rules and guidelines that govern the
design, implementation, and maintenance of the database. This includes
data entry procedures, backup and recovery procedures, and security
protocols. Well-defined procedures ensure the integrity and consistency
of the database.
4. Data: Data is the core component of a database. It represents the
information that is stored, organized, and managed within the system.
Data can include text, numbers, images, and other types of information
relevant to the organization.
5. Data Access Language: This component refers to the language or
interface through which users and applications interact with the database.
It includes query languages like SQL (Structured Query Language) that
allow users to retrieve, manipulate, and manage data within the database.
Database Management System

DBMS stands for Database Management System. It is software that enables users
and applications to interact with a database. Here are some key aspects of DBMS:

1. Data Definition: DBMS allows the definition of data structures and the
relationships between them. It provides a data definition language (DDL)
for creating, modifying, and deleting database structures.
2. Data Manipulation: DBMS provides a data manipulation language
(DML) that allows users to interact with the data stored in the database.
This includes querying, inserting, updating, and deleting data.
3. Data Retrieval: Users can retrieve data from the database using queries.
The most common query language used with DBMS is SQL (Structured
Query Language).
4. Data Security: DBMS includes mechanisms for controlling access to the
database. This ensures that only authorized users can view or modify
specific data.
5. Concurrency Control: DBMS manages concurrent access to the database
by multiple users or applications, ensuring that transactions are processed
in a controlled and consistent manner.
6. Data Integrity: DBMS enforces integrity constraints to maintain the
accuracy and consistency of the data. This includes rules for data validation
and relationships between tables.
7. Data Independence: DBMS provides a level of abstraction between the
physical storage of data and the way users perceive it. This allows for
changes in the database structure without affecting the applications using
the data.
8. Backup and Recovery: DBMS includes features for backing up the
database periodically and recovering it in case of system failures or errors.
Advantages of DBMS

The advantages of using Database Management Systems (DBMS) are as follows:

1. Data Centralization: DBMS centralizes data storage, providing a single,


consolidated repository for an organization's data. This eliminates data
redundancy and ensures data consistency across the organization.
2. Data Integrity: DBMS enforces integrity constraints, such as primary key
and foreign key relationships, ensuring that data remains accurate and
consistent throughout the database.
3. Data Security: DBMS provides security features to control access to the
database. User authentication, authorization, and encryption help protect
sensitive information from unauthorized access.
4. Concurrency Control: DBMS manages concurrent access to the database
by multiple users or applications, preventing conflicts and ensuring data
consistency during simultaneous transactions.
5. Data Independence: DBMS allows for data independence, separating the
physical storage of data from the way it is perceived by users and
applications. This enables easier modification and maintenance of the
database structure without affecting the applications.
6. Efficient Data Retrieval: DBMS provides powerful query languages
(such as SQL) that simplify the process of retrieving specific data from the
database. This enhances efficiency and reduces the complexity of data
retrieval operations.
7. Scalability: DBMS systems are designed to handle large amounts of data
and can scale to accommodate the growing needs of an organization. This
scalability is crucial as businesses expand and generate more data.
8. Data Backup and Recovery: DBMS offers features for regular data
backups and recovery mechanisms, safeguarding against data loss due to
system failures, errors, or other unforeseen circumstances.
9. Improved Data Sharing: DBMS facilitates data sharing among different
users and departments within an organization. This promotes collaboration
and ensures that relevant information is accessible to those who need it.
10.Cost Efficiency: While there are initial costs associated with
implementing a DBMS, the long-term benefits in terms of data
management, efficiency, and reduced redundancy often result in cost
savings for organizations.
Disadvantages of DBMS

While Database Management Systems (DBMS) offer various advantages, they


also come with certain disadvantages. Here are some potential drawbacks:

1. Complexity and Cost: Implementing and maintaining a DBMS can be


complex and costly. It involves expenses related to software, hardware,
training, and ongoing maintenance.
2. Overhead: DBMS introduces additional overhead in terms of processing
and storage requirements. The system needs resources to manage data
relationships, integrity constraints, and security measures, which can
impact performance.
3. Dependency on a Database Vendor: Organizations may become
dependent on a specific DBMS vendor, making it challenging to switch to
a different system later. This vendor lock-in can limit flexibility and
strategic choices.
4. Security Concerns: While DBMS provides security features, it also
introduces potential security vulnerabilities. If not properly configured or
maintained, databases can be susceptible to unauthorized access, data
breaches, and other security threats.
5. Potential for Data Inconsistency: Despite enforcing integrity constraints,
data inconsistencies can still occur, especially in complex systems with
frequent updates and changes.
6. Learning Curve: Users and administrators need to learn and adapt to the
specific DBMS software, which can have a learning curve. This may
require training and can impact productivity during the initial
implementation phase.
7. Performance Issues: In some cases, the performance of a DBMS may not
meet the speed and efficiency requirements of certain applications,
especially in real-time and high-transaction-volume scenarios.
8. Scalability Challenges: While DBMS systems are designed to scale, there
may be challenges in scaling to meet rapidly growing data and user
requirements, particularly if not initially planned for.
9. Complex Backup and Recovery: Although DBMS systems provide
backup and recovery mechanisms, managing and implementing these
processes can be complex. Inadequate backup strategies may lead to data
loss in case of system failures.
Q-3. Introduction to the following Concepts.
a. DDL
b. DML
c. Aggregate Function

DDL
DDL stands for Data Definition Language, and it is a subset of SQL (Structured
Query Language) used to define and manage the structure of a relational database.
DDL is responsible for specifying the database schema, including tables,
relationships, constraints, and other structural elements. Here are some key
aspects of DDL:
1. Create Statement: DDL includes the CREATE statement, which is used
to create database objects such as tables, indexes, views, and procedures.
For example, CREATE TABLE, CREATE INDEX, and CREATE
VIEW are common DDL statements.
2. Alter Statement: The ALTER statement in DDL is used to modify the
structure of existing database objects. It can be used to add, modify, or drop
columns in a table, among other alterations.
3. Drop Statement: DDL includes the DROP statement, which is used to
remove database objects such as tables, indexes, or views. The DROP
statement irreversibly deletes the specified object from the database.
4. Truncate Statement: DDL includes the TRUNCATE statement, which is
used to remove all rows from a table but retains the table structure for
future use. Unlike the DROP statement, TRUNCATE allows the table to
be reused.
5. Constraints: DDL is used to define constraints that enforce rules on the
data in tables. Constraints include PRIMARY KEY, FOREIGN KEY,
UNIQUE, NOT NULL, and CHECK constraints.
6. Schema Definition: DDL is involved in defining database schemas, which
represent the logical structure of the database. It includes specifying tables,
their relationships, and the constraints that apply to them.
Sr. No. Key DDL

1 Stands for DDL stands for Data Definition Language.

Usage DDL statements are used to create database, schema, constraints,


2
users, tables etc.

3 Classification DDL has no further classification.

4 Commands CREATE, DROP, RENAME and ALTER.

DML

DML stands for Data Manipulation Language, and it is a subset of SQL


(Structured Query Language) used to manipulate and manage data stored in a
relational database. Unlike DDL (Data Definition Language), which focuses on
defining the structure of the database, DML is concerned with the manipulation
and retrieval of data within the existing database structure. Here are some key
aspects of DML:

1. INSERT Statement: DML includes the INSERT statement, which is


used to add new rows of data into a table. It allows users to specify values
for each column or insert data from another query.
2. UPDATE Statement: The UPDATE statement in DML is used to
modify existing data in a table. It allows users to change the values of
specific columns based on specified conditions.
3. DELETE Statement: DML includes the DELETE statement, which is
used to remove rows from a table based on specified conditions.
4. SELECT Statement: While SELECT is often associated with DQL
(Data Query Language), it is also part of DML. The SELECT statement is
used to retrieve data from one or more tables based on specified criteria.
5. Transaction Management: DML includes commands for managing
database transactions. The COMMIT statement is used to save changes
made during the current transaction, and the ROLLBACK statement is
used to undo changes and restore the database to a previous state.
Sr. Key DML
No.
1 Stands for DML stands for Data Manipulation Language.
Usage DML statement is used to insert, update or delete the
2
records.
Classification DML is further classified into procedural DML and
3
non-procedural DML.

Aggregate Functions

Aggregate Functions in DBMS: Aggregate functions are those functions in the


DBMS which takes the values of multiple rows of a single column and then
form a single value by using a query. These functions allow the user to
summarizing the data. These functions ignore the NULL values except the
count function.
In Database Management System, following are the five aggregate functions:
1. AVG
2. COUNT
3. SUM
4. MIN
5. MAX

AVG Function

This function takes the values from the given column and then returns the
average of the values. This function works only on the datatypes, which are
specified as numeric in the table.
example, Suppose we want to calculate the average salary from the Employee
Details table, then we have to type the following query:

Select AVG(Employee salary) from Employee Details;

COUNT Function

This aggregate function returns the total number of values in the specified
column. This function can work on any type of data, i.e., numeric as well as
non-numeric. This function does not count the NULL values. If we want to
count all the rows with NULL values, then we have to use the Count(*)
function.
example Suppose a user wants to count the number of employees in
the Employee Details table, then we have to type the following query:

Select Count(Employee ID) from Employee Details;

SUM Function

This aggregate function sums all the non-NULL values of the given column.
Like the AVG function, this function also works only on the numeric data.
example Suppose a user wants to find the sum of salary from the Employee
Details table, then we have to type the following query:

Select SUM(Employee_salary) from Employee Details;

MAX Function

This function returns the value, which is maximum from the specified column.
example Suppose a user wants to find the Maximum salary from the Employee
Details table, then we have to type the following query:

Select MAX(Employee_salary) from Employee Details;

MIN Function

This function returns the value, which is minimum from the specified column.
example, Suppose a user wants to find the Minimum salary from the Employee
Details table, then we have to type the following query:

Select MIN(Employee_salary) from Employee Details;


Q-4. What is ER diagram?
An Entity Relationship Diagram (ERD) is a visual representation of different
entities within a system and how they relate to each other. For example, the
elements writer, novel, and a consumer may be described using ER diagrams
the following way:

Entity Relationship Diagram, also known as ERD, ER Diagram or ER model, is


a type of structural diagram for use in database design. An ERD contains
different symbols and connectors that visualize two important information:
The major entities within the system scope, and the inter-relationships
among these entities.
And that's why it's called "Entity" "Relationship" diagram (ERD)!
When we talk about entities in ERD, very often we are referring to business
objects such as people/roles (e.g. Student), tangible business objects (e.g.
Product), intangible business objects (e.g. Log), etc. "Relationship" is about
how these entities relate to each other within the system.

In a typical ER design, you can find symbols such as rounded rectangles and
connectors (with different styles of their ends) that depict the entities, their
attributes, and inter-relationships.

ER Diagram

ER Diagram stands for Entity Relationship Diagram, also known as ERD is a


diagram that displays the relationship of entity sets stored in a database. In other
words, ER diagrams help to explain the logical structure of databases. ER
diagrams are created based on three basic concepts: entities, attributes and
relationships.

ER Diagrams contain different symbols that use rectangles to represent entities,


ovals to define attributes and diamond shapes to represent relationships.

At first look, an ER diagram looks very similar to the flowchart. However, ER


Diagram includes many specialized symbols, and its meanings make this model
unique. The purpose of ER Diagram is to represent the entity framework
infrastructure.
Entity Relationship Diagram Example

Reasons for using ER diagram:

Entity-Relationship (ER) diagrams are a visual representation of the data model


that captures the relationships between entities within a system. Here are several
reasons for using ER diagrams:
1. Conceptual Clarity:
 ER diagrams provide a clear and intuitive visualization of the
relationships between entities, helping stakeholders understand the
structure of the data model.
2. Communication:
 ER diagrams serve as a communication tool between different
stakeholders, including business analysts, developers, and database
administrators. They facilitate discussions and ensure a common
understanding of the data model.
3. Database Design:
 ER diagrams are an essential part of the database design process.
They help in defining the entities, attributes, and relationships,
providing a blueprint for constructing the actual database.
4. Requirements Analysis:
 ER diagrams aid in analysing and capturing the information
requirements of an organization. They help identify entities,
attributes, and the relationships between them, forming the basis for
database design.
5. Normalization:
 ER diagrams are instrumental in the normalization process, ensuring
that the database design follows normalization principles to
minimize redundancy and improve data integrity.
6. Database Maintenance:
 ER diagrams serve as a reference for database administrators when
performing tasks such as modifying the database structure, adding
new entities, or altering relationships.
7. Documentation:
 ER diagrams provide documentation for the database structure. They
offer a visual representation that can be referred to when
understanding or documenting the data model for future reference.
8. Identification of Key Entities:
 ER diagrams help in identifying key entities within a system and
their attributes, which is crucial for understanding the data that needs
to be stored and managed.
9. Constraint Identification:
 ER diagrams help in identifying and representing various
constraints, such as primary keys, foreign keys, and cardinality
constraints. This ensures the enforcement of data integrity in the
database.
10.Database Maintenance:
 ER diagrams are useful for database maintenance tasks, including
modifications to the database schema, debugging, and
troubleshooting.
11.Support for Software Development:
 ER diagrams are valuable during the software development process.
They guide developers in understanding the data structure, which is
essential for creating applications that interact with the database.

The main components and its symbols in ER Diagrams:

 Rectangles: This Entity Relationship Diagram symbol represents entity


types
 Ellipses : Symbol represent attributes
 Diamonds: This symbol represents relationship types
 Lines: It links attributes to entity types and entity types with other
relationship types
 Primary key: attributes are underlined
 Double Ellipses: Represent multi-valued attributes

ER Diagram Symbols

Components of the ER Diagram

This model is based on three basic concepts:

 Entities
 Attributes
 Relationships

ER Diagram Examples

For example, in a University database, we might have entities for Students,


Courses, and Lecturers. Students entity can have attributes like Rollno, Name,
and DeptID. They might have relationships with Courses and Lecturers.

Components of the ER Diagram


WHAT IS ENTITY?

A real-world thing either living or non-living that is easily recognizable and


nonrecognizable. It is anything in the enterprise that is to be represented in our
database. It may be a physical thing or simply a fact about the enterprise or an
event that happens in the real world.

An entity can be place, person, object, event or a concept, which stores data in
the database. The characteristics of entities are must have an attribute, and a
unique key. Every entity is made up of some 'attributes' which represent that
entity.

Examples of entities:

 Person: Employee, Student, Patient


 Place: Store, Building
 Object: Machine, product, and Car
 Event: Sale, Registration, Renewal
 Concept: Account, Course

How to Create an Entity Relationship Diagram (ERD)

Now in this ERD Diagram Tutorial, we will learn how to create an ER Diagram.
Following are the steps to create an ER Diagram:

Steps to Create an ER Diagram

Entity Relationship Diagram Example:

In a university, a Student enrolls in Courses. A student must be assigned to at


least one or more Courses. Each course is taught by a single Professor. To
maintain instruction quality, a Professor can deliver only one course.

Step 1) Entity Identification

We have three entities


 Student
 Course
 Professor

Step 2) Relationship Identification

We have the following two relationships

 The student is assigned a course


 Professor delivers a course

Step 3) Cardinality Identification

For them problem statement we know that,

 A student can be assigned multiple courses


 A Professor can deliver only one course

Step 4) Identify Attributes

You need to study the files, forms, reports, data currently maintained by the
organization to identify attributes. You can also conduct interviews with various
stakeholders to identify entities. Initially, it's important to identify the attributes
without mapping them to a particular entity.
Once, you have a list of Attributes, you need to map them to the identified
entities. Ensure an attribute is to be paired with exactly one entity. If you think
an attribute should belong to more than one entity, use a modifier to make it
unique.

Once the mapping is done, identify the primary Keys. If a unique key is not
readily available, create one.

Entity Primary Key Attribute


Student Student_ID StudentName
Professor Employee_ID ProfessorName
Course Course_ID CourseName

For Course Entity, attributes could be Duration, Credits, Assignments, etc. For
the sake of ease we have considered just one attribute.

Step 5) Create the ERD Diagram

A more modern representation of Entity Relationship Diagram Example


Q5. Create Employee Table and then Use Aggregate
function by Queries.

Syntax of Employee Table

INPUT of Value 1: -

INPUT of Value 10: -


OUTPUT OF EMPLOYEE TABLE

Aggregate Functions by Queries

1.COUNT Function
COUNT with DISTINCT

INPUT: -

OUTPUT: -
2.SUM Function
SUM()

INPUT: -

OUTPUT: -

3.AVG Function
AVG()

INPUT: -

OUTPUT: -

4.MAX Function
MAX()
INPUT: -

OUTPUT: -

5.MIN Function
MIN()

INPUT: -

OUTPUT: -
Q-6. Write the query for these commands:
• Alter • Insert• Update • Like

ALTER
Alter command is used for altering the table structure, such as,

 to add a column to existing table


 to rename any existing column
 to change datatype of any column or to modify its size.
 to drop a column from the table.

Using ALTER command we can add a column to any existing table. Following
is the syntax,

This query adds a new column called "BirthDate" to the "Employees" table.
Insert
The INSERT command in SQL is used to add new records (rows) into a table. It
allows you to specify the values for each column when inserting a new record.
The basic syntax of the INSERT command is as follows:

It is possible to write the INSERT INTO statement in two ways:

1. Specify both the column names and the values to be inserted:

INSERT INTO table_name (column1, column2, column3, ...)


VALUES (value1, value2, value3, ...);

2. If you are adding values for all the columns of the table, you do not need to
specify the column names in the SQL query. However, make sure the order of
the values is in the same order as the columns in the table. Here, the INSERT
INTO syntax would be as follows:

INSERT INTO table_name


VALUES (value1, value2, value3, ...);

EXAMPLE -

This query inserts a new employee with the specified first name, last name, and
department ID into the "Employees" table.
Update
The UPDATE command is used to modify existing records in a table. It allows
you to set new values for specific columns based on certain conditions.

The basic syntax of the Update query in MySQL is as shown below.

UPDATE `table_name` SET `column_name` = `new_value' [WHERE condition


];

HERE

 UPDATE `table_name` is the command that tells MySQL to update the


data in a table .
 SET `column_name` = `new_value' are the names and values of the fields
to be affected by the update query. Note, when setting the update values,
strings data types must be in single quotes. Numeric values do not need to
be in quotation marks. Date data type must be in single quotes and in the
format 'YYYY-MM-DD'.
 [WHERE condition] is optional and can be used to put a filter that
restricts the number of rows affected by the UPDATE MySQL query.
LIKE
The LIKE operator is used in a WHERE clause to search for a specified pattern
in a column.

There are two wildcards often used in conjunction with the LIKE operator:

 The percent sign (%) represents zero, one, or multiple characters


 The underscore sign (_) represents one, single character

The LIKE operator is used in conjunction with the SELECT statement to filter
results based on a specified pattern. It is often used for searching or filtering text
data.

The percent sign and the underscore can also be used in combinations!

LIKE Syntax
SELECT column1, column2, ...
FROM table_name
WHERE columnn LIKE pattern;

Tip: You can also combine any number of conditions using AND or OR
operators.

EXAMPLE-

This query selects all records from the "Employees" table where the last name
starts with "Sm".

You might also like