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
SQL Articles - Page 3 of 12
557 Views
Setting a Column Value to Null To set a column value to NULL, use the SQL UPDATE statement, which allows modification of existing records in a table. The basic syntax for setting a column value to NULL is − Syntax UPDATE table_name SET column_name = NULL WHERE conditions; Where − table_name: Replace this with the name of the table you intend to update. column_name: Substitute this with the name of the column to be updated. NULL: Denotes the NULL value in SQL. ... Read More
171 Views
What is an Identity Column? The Identity column of a table is a column whose value increments consequently. This can be used to create unique identifiers, such as primary keys. Syntax Following is the syntax to create an Identity column. The initial setting for identity is represented as IDENTITY (1, 1). IDENTITY [ ( seed , increment ) ] Where − Seed: The seed determines the initial value of an ID, with a default setting of 1. Increment: This denotes the step value for ID increments, which also defaults ... Read More
9K+ Views
When we work with databases, we often need to search for the name of a Person whose name starts with a specific Letter. We can also find the names of persons whose name starts with a specific letter using SQL. This is possible by using the 'LIKE' operator in SQL, it allows us to do pattern matching on a text. Prerequisites: The following are the prerequisites to understand this tutorial - Basic SQL syntax understanding. A database management tool like MySQL, Oracle SQL or SQLite. What is 'LIKE' Operator? The ... Read More
941 Views
In SQL, date and time values are handled using specific data types, such as DATE, DATETIME, TIMESTAMP, etc. Each database management system (DBMS) may have its conventions for date formats, so understanding how to specify and use these formats is essential for working with dates in SQL. The following are the data types to handle date and time in SQL: DATE: Stores date values (year, month, day). DATETIME: Stores date and time values (year, month, day, hour, minute, second). TIMESTAMP: Stores date and time values, ... Read More
255 Views
Assume we have created a table in database and the table consists of duplicate records or, you need to check if there are multiple entries of the same record in the database. In order to find such duplicate records you can make use of below sample queries. Printing Duplicate Rows in an SQL Table Lets consider we have a table named as Students with the columns ID, Name, Age. Using the following query − CREATE TABLE Students( ID INT NOT NULL, NAME VARCHAR (20) NOT NULL, AGE ... Read More
762 Views
You can handle and manipulate date and time values within a database using SQL queries. You need to filter records based on date comparisons, like checking if a date is greater than today. We will query this using our own sample data as given below. Date Comparisons You can use various comparison operators, like >, =, and CURRENT_DATE; Here, date_column is the field containing the date values you want to compare. “CURRENT_DATE” is a keyword in SQL that represents the current date. Example Consider you have created a table named EVENTS using the CREATE TABLE statement as ... Read More
6K+ Views
In this article, we will write an SQL(Structured Query Language) query to find the Nth highest salary from a database table. We can obtain the 2nd highest salary, 3rd highest salary, and so on. Certainly, This is the most commonly asked question in an interview. There are different methods to achieve this, we will understand every technique in detail. Problem Statement Assume we have a table named employees with 3 columns namely, EmployeeId, EmployeeName and, EmployeeSalary as shown below − EmployeeId EmployeeName EmployeeSalary 10001 Mahesh 33000 10002 John 35000 10003 Abdul 34500 ... Read More
511 Views
Overview Production databases are crucial for storing and retrieving data in organizations. SQL queries are essential for efficiently retrieving specific information from these databases. The article aims to equip readers with practical knowledge for working with production databases using SQL queries. Understanding SQL Queries and Relational Databases Relational databases provide a structured framework for organizing and storing data efficiently. Data modeling techniques, including normalization, help in designing effective databases. Understanding these concepts is essential for writing SQL queries that retrieve information accurately and efficiently from complex databases. Let’s dive into a few real world examples − Example 1 Creating ... Read More
3K+ Views
Data architecture design consists of standards that have certain rules, policies, and data types to be collected, from where the data is collected, storage of data, arrangement of data, and then using that data for further analysis. Data plays a vital role in the successful execution of business strategy. Data architecture design It helps us to show how users view the data in the database. It describes the type of data structures used to manage data and make the processing easy. the concept of dbms depends on its architecture. It is divided into three models i.e. conceptual model, ... Read More
19K+ Views
Anomalies means problems or inconsistency which happened during the operations performed on the table. There can be many reasons that anomaly occur for example, It occurs when data is stored multiple times unnecessarily in the database i.e. redundant data is present or it occur when all the data is stored in a single table. normalization is used to overcome the anomalies. the different type of anomalies are insertion, deletion and updation anomaly. Input The same input is used for all three anomalies. Student ID Name Age Branch Branch_Code Hod_name 1 A 17 Civil 101 Aman ... Read More