Home » Core Java » sql » Page 3

sql

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 »

SQL Except Example

1. Introduction In this article, we will look at the Except operation. The Except is an operator of SQL Set Theory. The Except operator was introduced in the Microsoft SQL Server. Oracle supports MINUS operator which is equivalent to Except. However, MySQL supports neither Minus nor except. In this article, we will understand what the Except operator is and how ...

Read More »

SQL Order By Clause Example

1. Introduction In this article, we will look at the Order by Clause. The Order by Clause sorts records returned by Select Queries. It’s an optional clause and can sort records with single or multiple tables. 2. Order by Clause in Relational Algebra Relational Algebra considers relations assets(auto-sorted). Hence, there is no concept of sorting or ordering there. However, SQL ...

Read More »

SQL Where Clause Example

1. Introduction In this article, we will look at the SQL Where Clause. The Update, Delete, and Select statements have an optional Where clause. 2. Where in Relational Algebra The condition we put to filter records is the “where” clause in Relational Algebra. The condition parameter is : σ (Cond)(Relation Name) Here, σ= selectorcond = filter condition i.e. where clause ...

Read More »

SQL IN – SQL NOT IN

This article focuses on the functionality and usage of the SQL In and the SQL Not In operators. The first operator filters out rows from the multiple values mentioned in the Where clause. While SQL Not In operator excludes the rows with any of the values from the Where clause. 1. About SQL In and SQL Not In Operators Let ...

Read More »