Home » Core Java » sql

sql

SQL GROUP BY Statement

1. Introduction In this article, we will look at the Group by Clause. We can use the Group By clause with all the databases that support SQL. We will see how we use Group BY in the MySQL database. 2. SQL Group By Clause The Group By is a clause that clumps data into groups based on a shared value. ...

Read More »

SQL Join Tutorial

In this article, we will discuss JOINs in SQL (Structured Query Language), various types of JOINs, and their syntax. We will also run SELECT queries using different types of JOINs on data in sample tables and view the result sets. 1. Introduction In real-world applications, data are stored in RDBMS (Relational Database Management Systems) by removing redundancy and assigning primary ...

Read More »

SQL Injection

This article will look at what SQL injection means and a few ways to prevent it. 1. What is SQL injection? SQL injection is a security problem in SQL. It is one of the most common hacking techniques for any database. An SQL injection happens when we try to receive user input from the user interface, such as a username. Instead ...

Read More »

PostgreSQL with Node.js and Express.js

Hello in this tutorial, we will understand how to create a RESTful API in a Node.js environment running on an Express.js server and using a PostgreSQL database. The tutorial will cover the CRUD operations on the API which will execute the corresponding database commands. 1. Introduction RESTful API stands for the standard web service interface used by the applications to ...

Read More »

MySQL with Node.js and Express.js

Hello in this tutorial, we will understand how to create a RESTful API in a Node.js environment running on an Express.js server and using a MySQL database. The tutorial will cover the CRUD operations on the API which will execute the corresponding database commands. 1. Introduction RESTful API stands for the standard web service interface used by the applications to ...

Read More »

SQL Alias Example

This article illustrates the use of SQL Alias through examples. The code was prepared with MySql 5.7 syntax, most notable for its use of backticks (`) for identifier quoting, but should be easily adaptable to other SQL dialects as well. 1. What is an alias? An alias is a programmer-assigned name for a column, table, or view in an SQL ...

Read More »

SQL Between, MySQL Between Dates, Not Between

In this example, we will see how to use the BETWEEN operator included in the SQL. 1. Introduction The BETWEEN is a logical operator, often used in the WHERE clause of the SELECT, UPDATE, and DELETE statements, and gives us the ability to specify whether a value is in a given range or not. Syntax SELECT column_name(s) FROM table_name WHERE column_name ...

Read More »

SQL Subquery – Nested Query in SQL

1. Introduction In this article, we will look at many examples of how to use SQL subquery using MySQL RDBMS. 2. What is the SQL Subquery? A subquery is also called a Nested Query. A Subquery is a Select Query inside another query. Subqueries can be used inside other select, insert, update and delete commands. It can also be used ...

Read More »

SQL Commit and Rollback Example

1. Introduction In this article, we will look at the Commit and Rollback commands. SQL transactions use Commit and Rollback commands. We will see how to use the Commit and Rollback commands in MySQL RDBMS. 2. What is a Transaction in SQL? A Transaction in SQL is a single logical unit of work.Transactions can make multiple changes to the database ...

Read More »

SQL Intersect Example

1. Introduction In this article, we will look at the Intersect operation. SQL Set Theory contains the Intersect. Most of the RDBMS like Oracle, SQL Server, and PostgreSQL support the Intersect operator. However, MySQL does not. In this article, we will understand what the Intersect operator is and how to emulate it in MySQL. 2. What does Set Theory mean? ...

Read More »