
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Found 140 Articles for SQL

59 Views
In SQL, there are several ways to achieve this, including using LEFT JOIN, NOT EXISTS, and NOT IN. This article will explore these methods in detail, providing examples and guidance on when to use each approach. Using LEFT JOIN with IS NULL Using NOT EXISTS Using NOT IN 1. Using LEFT JOIN with IS NULL The LEFT JOIN operation returns all records from the left table (the first table) and the matching records from the right table (the second table). When no match is found, ... Read More

27 Views
In this article, we are going to learn how to get column names from a table using an SQL query. If you don't know what SQL is, keep reading because everything is covered from scratch. SQL stands for Structured Query Language, which is used to interact with databases. Basically, queries are used to perform CRUD operations on databases. Steps to Retrieve Column Names Here is the step-by-step explanation of getting columns from a table. Step 1: Check Database First, check the database where the table exists. If the database does not exist, run the following query to create it. CREATE ... Read More

95 Views
In this article, we will learn how to find the 2nd largest value in a column of a table. It’s a pretty common task when working with databases, especially when you need to analyze data. We will explore efficient methods to find the second-largest value using SQL queries, with step-by-step explanations and examples for better understanding. Steps to Retrieve 2nd Largest Value in a Column Here is the step-by-step explanation of getting 2nd largest value in a column in a table. Step 1: Check Database First, check the database where the table exists. If the database does not exist, run the ... Read More

221 Views
It is not uncommon in SQL to analyze tables vertically or horizontally in an attempt to obtain a solution. This might include establishing a baseline for evaluating successive states, determining boolean variables, or even classifying information without requiring joins over distinct tables. In this article, we explain relevant similarities with examples. Setting Up the Database Let us set up a database with a sample table to illustrate the processes involved in the case studies, this setup will feature the insertion of dummy values to test comparisons. First of all, create a database using the CREATE DATABASE statement − CREATE DATABASE ... Read More

25 Views
When we work with database tables, we need to insert multiple rows into database tables. We can improve the efficiency of SQL queries if we use an efficient method to insert multiple rows into database tables. We can reduce the number of queries sent to the server. We will discuss different methods and their advantages for inserting multiple rows into database tables. You can select your best method depending on your data and your choice. We should follow practices when we insert data into database tables - We should prepare statements for dynamic data to ... Read More

170 Views
Working with dates in SQL can be challenging, especially for beginners. We need to make sure that the format of the date values are consistent throughout the queries, whether you're dealing with simple DATE types or complex DATETIME values. This article will walk you through the process of comparing two dates using different approaches, including examples and outputs, ensuring clarity and understanding. In SQL dates are typically stored in DATE or DATETIME format and to compare two dates, we can use comparison operators such as − =: Checks if two dates are equal. : Checks if one date is ... Read More

119 Views
While working with a database to avoid duplicates, we should follow certain practices when we create the database table. Define primary key to identify rows cluster and non-cluster indexes. Use constraints for data integrity in performance. Database tables may have duplicate rows after following best practices. These duplicate rows create issues while we retrieve data from the database. So we must ensure unique database rows. To do so, first of all, we need to verify whether a table has duplicate rows, If duplicate rows exist, we must remove them by altering the table data. This article will ... Read More

198 Views
SQL Injection is a common security vulnerability. It occurs when an attacker manipulates a web application's database queries by injecting malicious SQL code. One of the most critical areas for SQL Injection exploitation is the login page of an application. When a user enters their credentials, these inputs are typically used to construct a database query to verify the user’s identity. If the application does not properly sanitize these inputs, an attacker can bypass authentication by injecting SQL statements that modify the intended query, granting them unauthorized access. What is SQL Injection? SQL injection is a code injection technique that ... Read More

69 Views
In SQL databases, it is often necessary to retrieve the list of table names within a database to understand the structure or to perform the certain operations. Each SQL-based database system offers specific ways to query its metadata to extract the table names. In this article, we will explore how to get the names of tables in popular relational database systems including the MySQL, SQL Server, PostgreSQL and Oracle. We will cover the built-in SQL queries and functions that are commonly used for this task. Need to Retrieve Table Names? Database Exploration: When working with ... Read More

1K+ Views
In SQL, it is common to store data in different formats like VARCHAR, INT, FLOAT, etc. based on the needs of the application. However, sometimes we may need to convert a VARCHAR column to an INT for performing arithmetic operations, comparisons or other logical queries that require integer values. This article will explore various ways to convert VARCHAR (string) data types to INT in SQL using the built-in functions the potential pitfalls and examples. Why Convert VARCHAR to INT? While working with databases we may need to convert VARCHAR to INT in the following scenarios − ... Read More