Mahesh Parahar

Mahesh Parahar

147 Articles Published

Articles by Mahesh Parahar

Page 2 of 15

Difference between SQL and PL/SQL

Mahesh Parahar
Mahesh Parahar
Updated on 14-Mar-2026 16K+ Views

SQL (Structured Query Language) is a standard database language used to create, maintain, and retrieve data from relational databases. PL/SQL (Procedural Language extension to SQL) extends SQL by adding procedural capabilities like variables, loops, conditions, and error handling. SQL Example SQL executes a single declarative statement at a time ? -- SQL: single operation, declarative SELECT name, salary FROM employees WHERE department = 'Engineering'; PL/SQL Example PL/SQL can execute multiple operations with procedural logic ? -- PL/SQL: procedural block with variables, loops, conditions DECLARE v_name employees.name%TYPE; ...

Read More

Difference between MySQL and MongoDB

Mahesh Parahar
Mahesh Parahar
Updated on 14-Mar-2026 901 Views

MySQL is a relational database management system (RDBMS) that stores data in structured tables with rows and columns. MongoDB is a NoSQL document database that stores data as flexible JSON-like documents. Both are widely used but serve different use cases. MySQL MySQL is an open-source relational database owned by Oracle. It uses SQL (Structured Query Language) to query and manage data stored in predefined tables with fixed schemas. MySQL enforces data integrity through relationships, constraints, and joins. MongoDB MongoDB is an open-source NoSQL database developed by MongoDB Inc. It stores data as BSON (Binary JSON) documents ...

Read More

Theory of Inference for the Statement Calculus

Mahesh Parahar
Mahesh Parahar
Updated on 14-Mar-2026 5K+ Views

To deduce new statements from the statements whose truth we already know, Rules of Inference are used. What are Rules of Inference for? Mathematical logic is often used for logical proofs. Proofs are valid arguments that determine the truth values of mathematical statements. An argument is a sequence of statements. The last statement is the conclusion and all its preceding statements are called premises (or hypotheses). The symbol "∴" (read "therefore") is placed before the conclusion. A valid argument is one where the conclusion follows from the truth values of the premises. Rules of Inference provide ...

Read More

Line/Edge Covering

Mahesh Parahar
Mahesh Parahar
Updated on 14-Mar-2026 415 Views

A covering graph is a subgraph which contains either all the vertices or all the edges corresponding to some other graph. A subgraph which contains all the vertices is called a line/edge covering. A subgraph which contains all the edges is called a vertex covering. Line Covering Let G = (V, E) be a graph. A subset C(E) is called a line covering of G if every vertex of G is incident with at least one edge in C, i.e., deg(V) ≥ 1 ∀ V ∈ G Because each vertex is connected with another vertex by ...

Read More

Tree or Connected acyclic graph

Mahesh Parahar
Mahesh Parahar
Updated on 14-Mar-2026 3K+ Views

Trees are graphs that do not contain even a single cycle. They represent hierarchical structure in a graphical form. Trees belong to the simplest class of graphs. Despite their simplicity, they have a rich structure. Trees provide a range of useful applications as simple as a family tree to as complex as trees in data structures of computer science. Tree A connected acyclic graph is called a tree. In other words, a connected graph with no cycles is called a tree. The edges of a tree are known as branches. Elements of trees are called their ...

Read More

How do you create a list in Java?

Mahesh Parahar
Mahesh Parahar
Updated on 14-Mar-2026 8K+ Views

A Java List can be created in multiple ways depending on whether you need a modifiable list, a fixed-size list, or want to initialize it with values in a single statement. Way 1: Raw Type (Not Recommended) Create a List without specifying the type of elements. The compiler will show an unchecked warning − List list = new ArrayList(); Way 2: Generic Type (Recommended) Create a List with a specified element type for type safety − List list = new ArrayList(); Way 3: Initialize in One Line Create ...

Read More

How do you add two lists in Java?

Mahesh Parahar
Mahesh Parahar
Updated on 14-Mar-2026 1K+ Views

The addAll() method of the List interface can be used to combine two lists in Java. It comes in two variants − one appends elements at the end, and another inserts elements at a specific index. addAll() Without Index Appends all elements from the specified collection to the end of the list − boolean addAll(Collection

Read More

How do I search a list in Java?

Mahesh Parahar
Mahesh Parahar
Updated on 14-Mar-2026 372 Views

Java Streams (Java 8+) can be used to search for an item within a list by filtering elements based on a condition. The filter() method applies the search criteria, and findAny() returns the first matching element or null if no match is found. Syntax Student result = list.stream() .filter(s -> s.getRollNo() == rollNo) .findAny() .orElse(null); This filters the list for a student with the matching roll number. findAny() returns an Optional, and orElse(null) returns null if no match is found. Example ...

Read More

How can we convert list to Set in Java?

Mahesh Parahar
Mahesh Parahar
Updated on 14-Mar-2026 30K+ Views

A Java List can be converted to a Set to eliminate duplicate entries. The resulting Set will contain only unique values. There are three common ways to perform this conversion − Method 1: Using Set Constructor Pass the list directly to the HashSet constructor − Set set = new HashSet(list); Method 2: Using addAll() Create an empty set and use addAll() to add all elements from the list − Set set = new HashSet(); set.addAll(list); Method 3: Using Streams (Java 8+) Use the Stream API to collect list ...

Read More

How to copy a list to another list in Java?

Mahesh Parahar
Mahesh Parahar
Updated on 14-Mar-2026 28K+ Views

A List of elements can be copied to another List in Java using multiple approaches. All methods create a shallow copy − the new list contains references to the same objects as the original. Way 1: Constructor Pass the source list to the ArrayList constructor − List copy = new ArrayList(list); Way 2: addAll() Create an empty list and use addAll() to add all elements from the source − List copy = new ArrayList(); copy.addAll(list); Way 3: Collections.copy() Use Collections.copy() to copy elements into an existing destination list. ...

Read More
Showing 11–20 of 147 articles
« Prev 1 2 3 4 5 15 Next »
Advertisements