[go: up one dir, main page]

0% found this document useful (0 votes)
18 views32 pages

Unit-I DBMS

Download as docx, pdf, or txt
Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1/ 32

Introduction to Database Management System

Database management system is software that is used to manage the database.

What is Database
The database is a collection of inter-related data which is used to retrieve, insert and delete the data
efficiently. It is also used to organize the data in the form of a table, schema, views, and reports, etc.

For example: The college Database organizes the data about the admin, staff, students and faculty etc.

Using the database, you can easily retrieve, insert, and delete the information.

Database Management System

o Database management system is a software which is used to manage the database. For
example: MySQL, Oracle, etc are a very popular commercial database which is used in different
applications.
o DBMS provides an interface to perform various operations like database creation, storing data
in it, updating data, creating a table in the database and a lot more.
o It provides protection and security to the database. In the case of multiple users, it also
maintains data consistency.

DBMS allows users the following tasks:

o Data Definition: It is used for creation, modification, and removal of definition that defines the
organization of data in the database.
o Data Updation: It is used for the insertion, modification, and deletion of the actual data in the
database.
o Data Retrieval: It is used to retrieve the data from the database which can be used by
applications for various purposes.
o User Administration: It is used for registering and monitoring users, maintain data integrity,
enforcing data security, dealing with concurrency control, monitoring performance and
recovering information corrupted by unexpected failure.
Characteristics of DBMS
o It uses a digital repository established on a server to store and manage the information.
o It can provide a clear and logical view of the process that manipulates data.
o DBMS contains automatic backup and recovery procedures.
o It contains ACID properties which maintain data in a healthy state in case of failure.
o It can reduce the complex relationship between data.
o It is used to support manipulation and processing of data.
o It is used to provide security of data.
o It can view the database from different viewpoints according to the requirements of the user.

Advantages of DBMS

o Controls database redundancy: It can control data redundancy because it stores all the data in
one single database file and that recorded data is placed in the database.
o Data sharing: In DBMS, the authorized users of an organization can share the data among
multiple users.
o Easily Maintenance: It can be easily maintainable due to the centralized nature of the database
system.
o Reduce time: It reduces development time and maintenance need.
o Backup: It provides backup and recovery subsystems which create automatic backup of data
from hardware and software failures and restores the data if required.
o multiple user interface: It provides different types of user interfaces like graphical user
interfaces, application program interfaces
Disadvantages of DBMS

o Cost of Hardware and Software: It requires a high speed of data processor and large memory
size to run DBMS software.
o Size: It occupies a large space of disks and large memory to run them efficiently.
o Complexity: Database system creates additional complexity and requirements.
o Higher impact of failure: Failure is highly impacted the database because in most of the
organization, all the data stored in a single database and if the database is damaged due to
electric failure or database corruption then the data may be lost forever.

There are majorly four types of database:

 Network Database: When the details of multiple members can be linked to the files of
multiple owners and vice versa, it is called a network database.
 Hierarchical Database: When the data stored in the form of records and is connected
to each other through links is called hierarchical database. Each record comprises fields
and each field comprises only one value.
 Relational Database: When the data is organized as a set of tables comprising rows
and columns with a pre-defined relationship with one another, it is called a relational
database.
 Object-oriented Database – the information is represented as objects, with different
types of relationships possible between two or more objects. Such databases use an
object-oriented programming language for development.

Components of Database Management Software


There four main components on which the working of a DBMS depends. This includes:

 Data: The main component is the data. The entire database is set based on the data and
the information processed based on it. This data acts as a bridge between the software
and hardware components of DBMS. This can further be divided into three varieties:

 User Data – The actual data based on which the work is done
 Metadata – This is the data of the data, i.e., managing the data required to enter
the information
 Application Meta Data – This is the structure and format of the queries
To simplify it, in a table, the information given in each table is the User Data, the number of
tables, rows and columns is the Meta Data the structure we choose is the Application Meta
Data.

 Hardware: These are the general hardware devices which help us save and enter the
data like hard disks, magnetic tapes, etc.
 Software: The software acts as a medium of communication between the user and the
database. Based on the user’s requirement, the database can be modified and updated.
To perform operations on the data, query languages like SQL are used.
Benefits of Using Database Management System
Major Organizations and Banking firms choose to work using the Database Management
System. It is because this system program helps the user and the administrator easily manages
the data and information on the database.

Given below are a few advantages of using a Database Management System:

 Securing the data is easy. The administrator can restrict the usage of the database to a
few people only. Thus, access to the database is restricted only to the administering
team of an Organization or Business which can keep the data safe
 A single file can manage the entire database which is why duplicity and redundancy
cannot happen. This makes the data more consistent and easy to update
 Since tables can be created in DBMS, interrelating the data and elements with each other
is convenient
 The backup and recovery of data is managed by the software, which ensures that the
database is secure at all times
 It allows multi-users to operate the database at a single time, making it more efficient

 Users: No function can be performed without the Users. Thus, they form the fourth
most important component of DBMS. The information entered into a database is used by
the User or the administrator to perform their business operations and responsibilities.

Important Terms related to Database Management System


A few other important terms related to DBMS have been discussed in brief below. To
understand this concept better, one must be aware of the following terms.

 Data Manipulation Languages (DML) – This is a programming language used to insert


or modify the data present in a database These are of two types: SQL and DDL.
 Structured Query Language (SQL) – A programming language generally used for the
relational database management system, which comprises tables.
 Data Definition Language (DDL) – It is a syntax which helps in modifying data present
in the form of tables or indexes
 Primary Key – Each file has a unique key. Using the Primary Key, a specific file can be
identified
 Foreign Key – The relation between a field in one table and component identified by a
primary key can be detected using a Foreign Key
Data Structure and Types
What are Data Structures?
Data structure is a storage that is used to store and organize data. It is a way of arranging
data on a computer so that it can be accessed and updated efficiently.

Depending on your requirement and project, it is important to choose the right data
structure for your project. For example, if you want to store data sequentially in the
memory, then you can go for the Array data structure.

Array data Structure Representation

Types of Data Structure


Basically, data structures are divided into two categories:

 Linear data structure

 Non-linear data structure

Let's learn about each type in detail.

Linear data structures


In linear data structures, the elements are arranged in sequence one after the other. Since
elements are arranged in particular order, they are easy to implement.
However, when the complexity of the program increases, the linear data structures might
not be the best choice because of operational complexities.
Popular linear data structures are:
1. Array Data Structure
In an array, elements in memory are arranged in continuous memory. All the elements of
an array are of the same type. And, the type of elements that can be stored in the form of
arrays is determined by the programming language.
To learn more, visit Java Array.

An array with each element represented by an index

2. Stack Data Structure


In stack data structure, elements are stored in the LIFO principle.
That is, the last element stored in a stack will be removed first.
It works just like a pile of plates where the last plate kept on the
pile will be removed first. To learn more, visit Stack Data
Structure.
In a stack,operations can be perform only from one end (top here).

3. Queue Data Structure


Unlike stack, the queue data structure works in the FIFO
principle where first element stored in the queue will be
removed first.
It works just like a queue of people in the ticket counter
where first person on the queue will get the ticket first. In a queue, addition and removal are
performed from separate ends.
4. Linked List Data Structure
In linked list data structure, data elements are connected through a series of nodes. And,
each node contains the data items and address to the next node.
.

A linked list

Non linear data structures


Unlike linear data structures, elements in non-linear data structures are not in any
sequence. Instead they are arranged in a hierarchical manner where one element will be
connected to one or more elements.

Non-linear data structures are further divided into graph and tree based data structures.

1. Graph Data Structure

In graph data structure, each node is called vertex and


each vertex is connected to other vertices through
edges.

Popular Graph Based Data Structures:


Spanning Tree and Minimum Spanning Tree
Strongly Connected Components
Adjacency Matrix
Adjacency List
2. Trees Data Structure

Similar to a graph, a tree is also a collection of


vertices and edges. However, in tree data structure,
there can only be one edge between two vertices.
Popular Tree based Data Structure
Binary Tree
Binary Search Tree
AVL Tree
B-Tree
B+ Tree
 Red-Black Tree
Tree data structure example

Linear Vs Non-linear Data Structures


Now that we know about linear and non-linear data structures, let's see the major
differences between them.
Linear Data Structures Non Linear Data Structures

The data items are arranged in sequential order, The data items are arranged in non-sequential
one after the other. order (hierarchical manner).

All the items are present on the single layer. The data items are present at different layers.

It can be traversed on a single run. That is, if we It requires multiple runs. That is, if we start
start from the first element, we can traverse all from the first element it might not be possible to
the elements sequentially in a single pass. traverse all the elements in a single pass.

Different structures utilize memory in different


The memory utilization is not efficient.
efficient ways depending on the need.

The time complexity increase with the data size. Time complexity remains the same.

Example: Arrays, Stack, Queue Example: Tree, Graph, Map

Why Data Structure?

Knowledge about data structures help you understand the working of each data structure.
And, based on that you can select the right data structures for your project.

This helps you write memory and time efficient code.

Databse Query Language


Query language definition

Query language, which includes database query language (DQL), is a specialized


computer language used to make queries and retrieve information from databases. It
serves as an interface between users and databases, enabling users to manage data from a
database management system (DBMS).
One of the most widely used modern query languages is Structured Query Language (SQL), a
domain-specific programming language used to interact with relational databases and perform
operations on structured data within. Structured query languages make use of commands like
"FIND," "INSERT," "DELETE," "ORDER BY," "SUM," and "SELECT," which can be formed into
syntactical statements for operations including defining and changing database schema,
searching, populating and updating the contents of a database, and defining everything from
triggers and integrity constraints to stored procedures and authorization rules .

Types of query languages

SQL is by far the most popular and commonly used query language for relational databases. It
is known as a declarative language, meaning it describes what needs to be accomplished
rather than how to accomplish it, but it also includes traditionally procedural elements.
Although there are many DQL and SQL variants, and the terms can overlap, SQL sub-languages
are commonly divided into five main categories:
 Data Query Language (DQL)
 Data Definition Language (DDL)
 Data Control Language (DCL)
 Data Manipulation Language (DML)
 Transaction Control Language (TCL)

Applications of query languages


As data proliferates in nearly every corner of business and daily life, query languages are being
deployed at an unprecedented scale. The depth and breadth of applications across domains and
enterprise is limited only by the scale of database adoption and capacity worldwide.

From database administration to narrower use cases like business intelligence and software
development, query languages are instrumental in enabling data-driven decisions. Through
data mining and analytics, query languages are used to identify patterns and trends that can
help everyone from customer service staff to CEOs gain valuable insights.
For large data-dependent companies all the way down to the smallest ecommerce merchants,
the ability to leverage user information and act upon it is now a core pillar of many business
models.
To name just a few practical applications across industries:
 In healthcare, DQLs can be used to analyze large data sets of information about patient
behavior and medical conditions.
 Financial institutions from banks to payment processors use data query languages to do
everything from detecting fraud to delivering personalized customer experiences.
 Social media platforms use DQLs to store, sort, and update information about user profiles,
views, purchase history, new posts, likes and shares, and so much more.
 Marketers use DQLs and SQLs to identify target audiences, track sales attribution and
campaign performance across channels, and analyze consumer behavior patterns.
 Database administrators use DQLs to update, maintain, and secure their environments,
keeping confidential information about users, employees, students, or patients safe.
 Data analysts and data scientists in business and research use DQL to streamline the
process of sorting through massive data sets to discover trends and insights.

SQL Commands

o SQL commands are instructions. It is used to communicate with the database. It is also used to
perform specific tasks, functions, and queries of data.
o SQL can perform various tasks like create a table, add data to tables, drop the table, modify the
table, set permission for users.

Types of SQL Commands


There are five types of SQL commands: DDL, DML, DCL, TCL, and DQL.

1. Data Definition Language (DDL)


o DDL changes the structure of the table like creating a table, deleting a table, altering a table, etc.
o All the command of DDL are auto-committed that means it permanently save all the changes in
the database.

Here are some commands that come under DDL:

CREATE ALTER DROP TRUNCATE


a. CREATE It is used to create a new table in the database.
Syntax:
1. CREATE TABLE TABLE_NAME (COLUMN_NAME DATATYPES[,....]);

Example:
1. CREATE TABLE EMPLOYEE(Name VARCHAR2(20), Email VARCHAR2(100), DOB DATE);

b. DROP: It is used to delete both the structure and record stored in the table.
Syntax
1. DROP TABLE table_name;
Example
1. DROP TABLE EMPLOYEE;
c. ALTER: It is used to alter the structure of the database. This change could be either to modify the
characteristics of an existing attribute or probably to add a new attribute.
Syntax:
To add a new column in the table
1. ALTER TABLE table_name ADD column_name COLUMN-definition;
To modify existing column in the table:

1. ALTER TABLE table_name MODIFY(column_definitions....);


EXAMPLE
1. ALTER TABLE STU_DETAILS ADD(ADDRESS VARCHAR2(20));
2. ALTER TABLE STU_DETAILS MODIFY (NAME VARCHAR2(20));
d. TRUNCATE: It is used to delete all the rows from the table and free the space containing the table.
Syntax:
1. TRUNCATE TABLE table_name;
Example:
1. TRUNCATE TABLE EMPLOYEE;

2. Data Manipulation Language


o DML commands are used to modify the database. It is responsible for all form of changes in the
database.
o The command of DML is not auto-committed that means it can't permanently save all the
changes in the database. They can be rollback.

Here are some commands that come under DML:


o INSERT UPDATE DELETE

a. INSERT: The INSERT statement is a SQL query. It is used to insert data into the row of a table.

Syntax:

1. INSERT INTO TABLE_NAME


2. (col1, col2, col3,.... col N)
3. VALUES (value1, value2, value3, .... valueN);
Or
1. INSERT INTO TABLE_NAME
2. VALUES (value1, value2, value3, .... valueN);

For example:

1. INSERT INTO javatpoint (Author, Subject) VALUES ("Sonoo", "DBMS");


b. UPDATE: This command is used to update or modify the value of a column in the table.

Syntax:
1. UPDATE table_name SET [column_name1= value1,...column_nameN = valueN] [WHERE CONDITION]

For example:

1. UPDATE students
2. SET User_Name = 'Sonoo'
3. WHERE Student_Id = '3'

c. DELETE: It is used to remove one or more row from a table.

Syntax:

1. DELETE FROM table_name [WHERE condition];

For example:

1. DELETE FROM javatpoint


2. WHERE Author="Sonoo";

3. Data Control Language


DCL commands are used to grant and take back authority from any database user.

Here are some commands that come under DCL:


o Grant Revoke

a. Grant: It is used to give user access privileges to a database.

Example

1. GRANT SELECT, UPDATE ON MY_TABLE TO SOME_USER, ANOTHER_USER;

b. Revoke: It is used to take back permissions from the user.

Example

1. REVOKE SELECT, UPDATE ON MY_TABLE FROM USER1, USER2;

4. Transaction Control Language


TCL commands can only use with DML commands like INSERT, DELETE and UPDATE only.

These operations are automatically committed in the database that's why they cannot be used while
creating tables or dropping them.

Here are some commands that come under TCL:

o COMMIT ROLLBACK SAVEPOINT


a. Commit: Commit command is used to save all the transactions to the database.

Syntax:
1. COMMIT;

Example:
1. DELETE FROM CUSTOMERS
2. WHERE AGE = 25;
3. COMMIT;

b. Rollback: Rollback command is used to undo transactions that have not already been saved to the
database.
Syntax:
1. ROLLBACK;

Example:
1. DELETE FROM CUSTOMERS
2. WHERE AGE = 25;
3. ROLLBACK;

c. SAVEPOINT: It is used to roll the transaction back to a certain point without rolling back the entire
transaction.

Syntax:
1. SAVEPOINT SAVEPOINT_NAME;

5. Data Query Language


DQL is used to fetch the data from the database.

It uses only one command:


o SELECT

a. SELECT: This is the same as the projection operation of relational algebra. It is used to select the
attribute based on the condition described by WHERE clause.

Syntax:
1. SELECT expressions
2. FROM TABLES
3. WHERE conditions;

For example:
1. SELECT emp_name
2. FROM employee
3. WHERE age > 20;

Views in DBMS

A view in SQL is a virtual table that is based upon the result-set of an SQL statement

 A view will also have rows and columns just like a real table in a database
 Simply a view is nothing but a stored SQL Query
 A view can contain all the rows of a table or specific rows based on some condition
 SQL functions conditions and join statements to a view and present the data just like the
data is produced from a single table

Creating a view

A view is created by selecting fields from one or more tables present in a database

Syntax

CREATE VIEW view_name AS


SELECT column1, column2, ...
FROM table_name
WHERE condition;

Note:

Whenever a user creates a view, database engine recreates the data using the views SQL
statement i.e. view always shows upto date data

Consider the tables StudentDetails and StudentMarks


StudentDetails

S_ID NAME ADDRESS

1 Harini Kolkata

2 Preity Hyderabad

3 Divya Chennai

4 Kushi Mumbai

5 Amitha Bangalore

StudentMarks

ID NAME MARKS AGE

1 Harini 96 20

2 Manisha 90 19

3 Divya 94 21

4 Kushi 92 19

5 Amitha 95 21

Simple Views in DBMS: Creating a view from a single table

In this example, we will create a view named as DetailsView from a single table
StudentDetails

CREATE VIEW DetailsView AS


SELECT NAME, ADDRESS
FROM StudentDetails
WHERE S_ID < 5;

The data present in a view can be seen just like a normal table select query

SELECT * FROM DetailsView;

Output:
NAME ADDRESS

Harini Kolkata

Preity Hyderabad

Divya Chennai

Kushi Mumbai

Complex view: Creating a view from multiple tables

 In this example will create a view named MarksView by taking data from both the
table’s student details and student marks
 To create a View from multiple tables just simply include multiple tables in the SELECT
statement.

CREATE VIEW MarksView AS


SELECT StudentDetails.NAME, StudentDetails.ADDRESS, StudentMarks.MARKS
FROM StudentDetails, StudentMarks
WHERE StudentDetails.NAME = StudentMarks.NAME;

To display data of View Marks:

SELECT * FROM MarksView;

Output:

NAME MARKS ADDRESS

Harini 96 Kolkata

Divya 94 Chennai

Kushi 92 Mumbai

Amitha 95 Bangalore

Deleting views in DBMS

 You can simply delete a view by using the Drop statement


 That view is not used anymore

Syntax:

DROP VIEW view_name;


Example

DROP VIEW MarksView;


Updating views

Views are updated only if certain conditions are met otherwise if any one of the conditions
are not met views will not be updated

Criteria for View Updating

 The select statement used in the create view statement should not include group by
clause or order by clause
 The select statement must not contain distinct keyword
 A view should not be created from nested or Complex queries
 A view should be created from a single table but if the view is created from more
than one table then it is not allowed for updating

CREATE OR REPLACE VIEW

Create or replace view statement is used to add or remove fields from existing views

Syntax:

CREATE OR REPLACE VIEW view_name AS


SELECT column1,coulmn2,..
FROM table_name
WHERE condition;

Update the view MarksView and add the field AGE to this View from StudentMarks Table,

CREATE OR REPLACE VIEW MarksView AS


SELECT StudentDetails.NAME, StudentDetails.ADDRESS, StudentMarks.MARKS, StudentMarks.
AGE
FROM StudentDetails, StudentMarks
WHERE StudentDetails.NAME = StudentMarks.NAME;

Fetch all the data from MarksView now as:

SELECT * FROM MarksView;

Output
NAME ADDRESS MARKS AGE

HARINI Kolkata 96 20

Divya Chennai 94 21

Kushi Mumbai 92 19

Amitha Bangalore 95 21

Inserting a row into a view

We can use insert into statement of SQL to insert a row in a view just like inserting a row in
an ordinary table

Syntax:

INSERT view_name(column1, column2 , column3,..)


VALUES(value1, value2, value3..);

Example

INSERT INTO DetailsView(NAME, ADDRESS)


VALUES("Preity","Hyderabad");

Fetch all the data from DetailsView now as,

SELECT * FROM DetailsView;

Output

NAME ADDRESS

Harini Kolkotta

Divya Chennai

Kushi Mumbai

Amitha Bangalore

Preity Hyderabad
Deleting a row from a view

 A row in a view can be deleted just like simply deleting rows from a Table using
delete statement
 But remember a row in a view can be deleted only if the row is actually deleted in the
original table from which it is created

Syntax:

DELETE FROM view_name


WHERE condition;

Example

DELETE FROM DetailsView


WHERE NAME="Preity";

Fetch all the data from DetailsView now as,

SELECT * FROM DetailsView;

Output:

NAME ADDRESS

Harini Kolkotta

Divya Chennai

Kushi Mumbai

Amitha Bangalore

Preity Hyderabad

Advantages and disadvantages of views

Advantages

 Enforce Business Rules: By placing complicated or misunderstood business logic into


the view, you can be sure to present a unified portrayal of the data which increases
use and quality.
 Consistency: Once defined their calculations are referenced from the view rather
than being restated in separate queries. This makes for less mistakes and easier
maintenance of code.
 Security: For example, you can restrict access to the employee table, that contains
social security numbers, but allow access to a view containing name and phone number.
 Simplicity: Databases with many tables possess complex relationships, which can be
difficult to navigate if you aren’t comfortable using Joins.
 Space: Views take up very little space, as the data is stored once in the source table.

Dis advantages or Limitations

 Modifications: Not all views support INSERT, UPDATE, or DELETE operations. Complex
multi-table views are generally read-only.
 Performance: Hugely complex job for the database engine. That is because each time a
view is referenced, the query used to define it, is rerun.

Concept and Objectives of DBMS


 Data is defined as the collection of information and a database is referred to as collection of
related data. Databases management systems are designed so that they contain related data,
which can be used whenever there is a requirement for such data.
 Database Management System can be defined as a software that is used to enter, store,
manipulate and retrieve data that is organised in the form of information in the databases.
 Database Management System, also known as DBMS, is a software that helps in creation and
maintenance of databases.
 The overall design of the database is known as the database schema. There are two types of
schema in a database namely, physical and logical. The physical schema is concerned with the
database design at the physical level and the logical schema is about the database design on a
logical level.

Objectives Of DBMS
DBMS has many objectives to increase the efficiency and organized handling of data
in an organization. The main objectives of DBMS are –

Data Availability:

DBMS ensures that the format of data should be meaningful and at a reasonable cost
so that a wide range of users can access it.

Data Organization and Structuring:

DBMS structures and efficiently organize the data to eliminate data complexity and
provide a framework for relationships between different data entities.

Data Integrity and Consistency:


DBMS uses integrity constraints like primary keys, and foreign keys to maintain the
integrity and accuracy of data.

Data Security and Authorization:

To maintain the authority of data and protect it from unauthorized access, DBMS
validates the user and gives permissions to only authorized users to view, modify,
and delete.

Data Independence:

DBMS allows easier modification of databases without affecting the applications.

Examples of DBMS Package

Using an Oracle database as a source for AWS DMS


You can migrate data from one or many Oracle databases using AWS DMS. With
an Oracle database as a source, you can migrate data to any of the targets
supported by AWS DMS.

AWS DMS supports the following Oracle database editions:

 Oracle Enterprise Edition


 Oracle Standard Edition
 Oracle Express Edition
 Oracle Personal Edition

My SQL : It is the world's most popular open source database. According to DB-Engines, MySQL
ranks as the second-most-popular database, behind Oracle Database. MySQL powers many of the
most accessed applications, including Facebook, Twitter, Netflix, Uber, Airbnb, Shopify, and
Booking.com.

Oracle Database: is designed as a multiuser database. The database must ensure that multiple
users can work concurrently without corrupting one another's data. A transaction is a logical, atomic
unit of work that contains one or more SQL statements.

IBM® Db2®: is a cloud-native database built on decades of expertise in bringing data governance
and security, low-latency transactions and continuous availability to your mission critical data,
analytics and AI-driven applications.

Microsoft SQL Server: is a relational database management system (RDBMS) that Supports a
wide variety of transaction processing, business intelligence (BI) and data analytics applications in
corporate IT environments.

Microsoft Access: is a popular information management tool that helps you store all kinds of
information for reporting, analysis and reference. With Microsoft Access, you can manage data more
efficiently and analyze large amounts of information.

UNIT-2
Introduction to AI Applications in Pharmacy
Introduction

Artificial Intelligence (AI) is a domain of computer science which deals with the development of
intelligent computer systems, which are capable to perceive, analyze, and react accordingly to the
inputs It is well-known fact that humans are considered as the most intelligent and smart species on
earth. The features which have helped them to bag this title include the ability to think, apply logic,
do reasoning, understand the complexity, and make decisions on their own

There are many areas which contribute to artificial intelligence which includes mathematics (used for
developing algorithms), biology, philosophy, psychology, neuroscience (for studying human mind
and its behavior), statistics (for handling huge data), and last but not the least, computer science (to
run the algorithm for implementing the concepts).

Types of AI (Based on Capabilities)

The various types of artificial intelligence based on the capabilities can be classified as

--Weak or narrow AI
– General AI

– Strong AI.

Weak or narrow AI: it is a type of AI which can perform a predefined narrow set of instructions
without exhibiting any thinking capability. It is the most widely used type of AI in this world. Some
famous examples are Apples’s Siri, Alexa, Alpha Go, IBM’s Watson supercomputer, Sophia (the
humanoid) all belong to the weak AI type.

General AI: it is the type of AI which can perform the tasks like what human can do. Till now it is
not achieved, there are no such machines which works like human or can think as perfectly as
human, but it may happen in near future.

Strong AI: it is the type of AI in which it is expected that the machine will surpass the capacity of
human. It will perform better than humans, though it is tough, but it is not impossible. It may be the
situation when it can be said that the machines will be the master and overtake humans.

Types of AI (Based on Functionality)

Based on the functionality, artificial intelligence can be classified as per the following types:

(i) Reactive machines


(ii) Limited memory

(iii) Theory of mind

(iv) Self-awareness

Reactive machines: These are the machines which works on the data available in the form of
predefined dataset. It does not have the facility of data storage for storing the past and future data. It
completely depends on the present data. IBM’s chess program which defeated famous champion
Garry Kasparov and the deep blue system, Google’s AlphaGo are some of the examples for reactive
machines.

Limited memory: these are the machines which can store the past experience or store the memory
for limited period of time. An example for limited memory AI is the self-driving cars (it can store the
information like speed, distance, speed limit required for the navigation of the car).

Theory of mind: these are types of machines, which are expected to understand the psychological
and emotional aspects of human mind and work accordingly. So far such machines are a dream but
scientists are working to develop such machines in near future.

Self-awareness: these machines belong to a hypothetical concept that will be considered as super-
intelligent machines, which can think, act, and will be self-aware as they will have consciousness and
sentiments like humans. Research is carried out to develop such machines and considered as future
AI.

Domains of AI
The major domains of AI (Fig. 1) are neural network, robotics, expert systems, fuzzy logic systems,
natural language processing (NLP).

Neural networks: these can be described as the representation of human neural system, i.e., neurons
and dendrites in the form of layers and nodes representing data. It comprises algorithms that
understand the relationships between the data while mimicking the human brain. These are widely
used in AI in the form of machine learning and deep learning. Some of the typical examples are
pattern recognition of face and image recognition in medical diagnosis.

Robotics: it is the domain of AI which is mostly associated with the development of intelligent
machines in the form of robot which obeys human instructions. The use of robots or humanoids is a
new trend and is being appreciated and adopted worldwide. Robots used in industry, medical
surgery, restaurants, etc., are classified under this category.

Expert system: these are systems which make decisions with the help of data present in the
knowledge base and getting guidance by an expert. These are basically computer applications
developed to solve complex problems with intelligence and expertise.

Fuzzy logic system: this domain is considered as resembling the human thinking method and
decision-making. It is quite similar to the way humans decide between 0 and 1, but it also deals with
all the possibilities between 0 and 1. Examples of fuzzy logic systems used are in consumer
electronics, automobiles, comparison of data, etc.

Subsets of Artificial Intelligence

Artificial intelligence has emerged as a boon for the society for the furtherance of advanced
techniques to deal with the real-life problems. The major two subsets of AI are Machine Learning
(ML) and Deep Learning (DL). ML is considered as the subset of AI and DL is considered as the
subset of ML.

Machine Learning:

As humans can think, improve by self-improvement cycle, and learn from the past
experiences, AI machines can also learn from the past experiences with the help of the concept
known as Machine Learning (ML). The machine learning deals with the development of algorithms
that enables the computer to learn from its data and past experiences on their own.

Classification of Machine Learning Based on the nature of the learning signal or response that the
machine gets; machine learning can be classified into following categories:

(i) Supervised learning

(ii) Unsupervised learning

(iii) Reinforcement learning

Supervised learning:

according to the literal meaning, this method correlates with the method of learning of student under
the supervision of a teacher. As a teacher illustrates the student with many good examples to help in
grasping the concept perfectly, the machine is provided with many labeled data to help in obtaining
the perfect output from the given input.

Unsupervised learning:

in this method the machine has to train itself without any supervisor, i.e., the data provided at the
input are not labeled or classified. The algorithm has to train itself by searching the degree of
similarities among the given data and figure out the appropriate output for the given problem.
Reinforcement learning: this method is typically a feedback-based learning method. In this method
the machine is given a reward for every right action taken by it and a penalty for any wrong action,
so it is a self-learning method done by analyzing its past performances.

Challenges and limitation of ML:

1.The basic challenge and limitation for ML are that it requires huge amount of data. Without quality
data, ML algorithm cannot provide accurate results for further analysis. The prediction can be
considered best if the analysis is done over a large amount of data.

2.Another point is that the data need to be heterogeneous as well. With wide range of inputs or
datasets, the efficiency of the algorithm will be enhanced with appropriate output.

Deep Learning

Deep Learning (DL) is considered as the sub domain of ML and thereby the subset of AI. Deep
learning can be denoted as the next level of machine learning where the system is similar to human
nervous system and mimic the working of the neurons. As the number of layers increases, it is called
as deep learning or Deep Neural Network (DNN) . The initial layer is denoted as the input layer, the
last layer is called the output layer and the intermediate layers are termed as the hidden layer, where
all the layers are inter connected .

It helps in enhanced feature extraction, pattern recognition of complex dataset and high-level
data extraction. The main advantage is that it can learn without any predefined data and does not
require explicit programming by the programmers.
Problem Solving Techniques in AI
The process of problem-solving is frequently used to achieve objectives or resolve particular
situations. In computer science, the term "problem-solving" refers to artificial intelligence methods,
which may include formulating ensuring appropriate, using algorithms, and conducting root-cause
analyses that identify reasonable solutions. Artificial intelligence (AI) problem-solving often involves
investigating potential solutions to problems through reasoning techniques, making use of
polynomial and differential equations, and carrying them out and use modelling frameworks. A
same issue has a number of solutions, that are all accomplished using an unique algorithm.
Additionally, certain issues have original remedies. Everything depends on how the particular
situation is framed.

Cases involving Artificial Intelligence Issues


Artificial intelligence is being used by programmers all around the world to automate systems for
effective both resource and time management. Games and puzzles can pose some of the most
frequent issues in daily life. The use of ai algorithms may effectively tackle this. Various problem-
solving methods are implemented to create solutions for a variety complex puzzles, includes
mathematics challenges such crypto-arithmetic and magic squares, logical puzzles including
Boolean formulae as well as N-Queens, and quite well games like Sudoku and Chess. Therefore,
these below represent some of the most common issues that artificial intelligence has remedied:

o Chess
o N-Queen problem
o Tower of Hanoi Problem
o Travelling Salesman Problem
o Water-Jug Problem

A Reflex Agent: But What's It?


Depending on their ability for recognising intelligence, these five main artificial intelligence agents
were deployed today. The below would these be agencies:

o Simple Reflex Agents


o Model-Based Reflex Agents
o Goal-Based Agents
o Utility-Based Agents
o Learning Agents

This mapping of states and actions is made easier through these agencies. These agents frequently
make mistakes when moving onto the subsequent phase of a complicated issue; hence, problem-
solving standardized criteria such cases. Those agents employ artificial intelligence can tackle issues
utilising methods like B-tree and heuristic algorithms.

Approaches for Resolving Problems


The effective approaches of artificial intelligence make it useful for resolving complicated issues. All
fundamental problem-solving methods used throughout AI were listed below. In accordance with
the criteria set, students may learn information regarding different problem-solving methods.

Heuristics
The heuristic approach focuses solely upon experimentation as well as test procedures to
comprehend a problem and create a solution. These heuristics don't always offer better ideal answer
to something like a particular issue, though. Such, however, unquestionably provide effective means
of achieving short-term objectives. Consequently, if conventional techniques are unable to solve the
issue effectively, developers turn to them. Heuristics are employed in conjunction with optimization
algorithms to increase the efficiency because they merely offer moment alternatives while
compromising precision.

Searching Algorithms
Several of the fundamental ways that AI solves every challenge is through searching. These
searching algorithms are used by rational agents or problem-solving agents for select the most
appropriate answers. Intelligent entities use molecular representations and seem to be frequently
main objective when finding solutions. Depending upon that calibre of the solutions they produce,
most searching algorithms also have attributes of completeness, optimality, time complexity, and
high computational.

Computing Evolutionary
This approach to issue makes use of the well-established evolutionary idea. The idea of "survival of
the fittest underlies the evolutionary theory. According to this, when a creature successfully
reproduces in a tough or changing environment, these coping mechanisms are eventually passed
down to the later generations, leading to something like a variety of new young species. By
combining several traits that go along with that severe environment, these mutated animals aren't
just clones of something like the old ones. The much more notable example as to how development
is changed and expanded is humanity, which have done so as a consequence of the accumulation of
advantageous mutations over countless generations.

Genetic Algorithms
Genetic algorithms have been proposed upon that evolutionary theory. These programs employ a
technique called direct random search. In order to combine the two healthiest possibilities and
produce a desirable offspring, the developers calculate the fit factor. Overall health of each
individual is determined by first gathering demographic information and afterwards assessing each
individual. According on how well each member matches that intended need, a calculation is made.
Next, its creators employ a variety of methodologies to retain their finest participants.

1. Rank Selection
2. Tournament Selection
3. Steady Selection
4. Roulette Wheel Selection (Fitness Proportionate Selection)
5. Elitism

What is knowledge representation?


Humans are best at understanding, reasoning, and interpreting knowledge. Human knows things,
which is knowledge and as per their knowledge they perform various actions in the real world. But
how machines do all these things comes under knowledge representation and reasoning.
Hence we can describe Knowledge representation as following:

o Knowledge representation and reasoning (KR, KRR) is the part of Artificial intelligence which
concerned with AI agents thinking and how thinking contributes to intelligent behavior of
agents.
o It is responsible for representing information about the real world so that a computer can
understand and can utilize this knowledge to solve the complex real world problems such as
diagnosis a medical condition or communicating with humans in natural language.
o It is also a way which describes how we can represent knowledge in artificial intelligence.
Knowledge representation is not just storing data into some database, but it also enables an
intelligent machine to learn from that knowledge and experiences so that it can behave
intelligently like a human.

What to Represent:
Following are the kind of knowledge which needs to be represented in AI systems:

o Object: All the facts about objects in our world domain. E.g., Guitars contains strings,
trumpets are brass instruments.
o Events: Events are the actions which occur in our world.
o Performance: It describe behavior which involves knowledge about how to do things.
o Meta-knowledge: It is knowledge about what we know.
o Facts: Facts are the truths about the real world and what we represent.
o Knowledge-Base: The central component of the knowledge-based agents is the knowledge
base. It is represented as KB. The Knowledgebase is a group of the Sentences (Here,
sentences are used as a technical term and not identical with the English language).
Knowledge: Knowledge is awareness or familiarity gained by experiences of facts, data, and
situations. Following are the types of knowledge in artificial intelligence:

Types of knowledge
Following are the various types of knowledge:

1. Declarative Knowledge:

o Declarative knowledge is to know about something.


o It includes concepts, facts, and objects.
o It is also called descriptive knowledge and expressed in declarativesentences.
o It is simpler than procedural language.

2. Procedural Knowledge

o It is also known as imperative knowledge.


o Procedural knowledge is a type of knowledge which is responsible for knowing how to do
something.
o It can be directly applied to any task.
o It includes rules, strategies, procedures, agendas, etc.
o Procedural knowledge depends on the task on which it can be applied.

3. Meta-knowledge:
o Knowledge about the other types of knowledge is called Meta-knowledge.

4. Heuristic knowledge:

o Heuristic knowledge is representing knowledge of some experts in a filed or subject.


o Heuristic knowledge is rules of thumb based on previous experiences, awareness of
approaches, and which are good to work but not guaranteed.

5. Structural knowledge:

o Structural knowledge is basic knowledge to problem-solving.


o It describes relationships between various concepts such as kind of, part of, and grouping of
something.
o It describes the relationship that exists between concepts or objects.

AI knowledge cycle:

An Artificial intelligence system has the following components for displaying intelligent
behavior:

o Perception

o Learning

o Knowledge Representation and Reasoning

o Planning

o Execution

The above diagram is showing how an AI system can interact with the real world and what
components help it to show intelligence. AI system has Perception component by which it retrieves
information from its environment. It can be visual, audio or another form of sensory input. The
learning component is responsible for learning from data captured by Perception comportment. In the
complete cycle, the main components are knowledge representation and Reasoning. These two
components are involved in showing the intelligence in machine-like humans. These two
components are independent with each other but also coupled together. The planning and execution
depend on analysis of Knowledge representation and reasoning.

You might also like