Category: Misc

  • SQL Auto Increment

    Databases are used to store the humongous amount of data logically. You might have come across various instances wherein you face difficulty mentioning a unique number for every record present in the table. This scenario is practically impossible because the manual entry is restricted. Thus, there’s no scope for incrementing the values. In this kind of…

  • Change datatype of column in SQL

    SQL being a dynamically manipulating database query language lets you play with your data-set that may be organized or unorganized. Such data may be presented in the form of different types depending upon your requirements. There are various methods to change the types of data present in the rows or columns of your database. Here, we will discuss…

  • Types of SQL JOIN

    SQL JOIN A SQL Join is used to fetch or combine data (rows or columns) from two or more tables based on the defined conditions. Table 1: Order OrderID CustomerID OrderName ProductName 12025 101 Peter ABC 12030 105 Robert XYX 12032 110 James XYZ 12034 115 Andrew PQR 12035 120 Mathew AAA Table 2: Customer CustomerID CustomerName…

  • SQL EXCEPT

    Usually, we use a JOIN clause to get the combined result from more than one table. Sometimes, we need a result set that contains records from one table but not available in the other table. In that case, SQL provides an EXCEPT clause/operator. The EXCEPT clause in SQL is widely used to filter records from more than…

  • Nth Highest salary

    Finding the Nth highest salary( 2nd, 3rd, or nth highest) in a table is the most important and common question asked in various interviews. Here we will show you the best and easiest way to write SQL queries to find nth highest salary in a table. To show this, we are using Table Emp having employee details like EID, ENAME,…

  • How to Delete Duplicate Rows in SQL?

    In this section, we learn different ways to delete duplicate rows in MySQL and Oracle. If the SQL table contains duplicate rows, then we have to remove the duplicate rows. Preparing sample data The script creates the table named contacts. In the above table, we have inserted the following data. We execute the script to recreate test data after…

  • How to run SQL Script?

    What is SQL Script? The SQL script is a set of commands that saved as a file in SQL Scripts and it contain one or more SQL statements. We use SQL Scripts to create, run, edit, view or delete the script files. We must remember the following points while using the SQL Scripts: Accessing the SQL Scripts 1. First, login to the Workstation.…

  • How to create functions in SQL?

    SQL has many built-in functions for performing the calculation of data. SQL provides built-in functions to perform the operations. Some useful functions of SQL are performing the mathematical calculations, string concatenation and sub-string etc. SQL functions are divided into two parts: SQL Aggregate Functions SQL Aggregate functions return a single value which is calculated from the values. SQL Scalar functions SQL Scalar functions returns the single value according to the input…

  • What is Web SQL?

    Web SQL Database is a web page used for storing or managing the data in the database. The API is supported by Google Chrome, Opera and Android browsers. The Web SQL API is not a part of the HTML5 specification, but is a separate specification. It addresses a set of APIs to manipulate the client-side database. Open databases, transactions, are the basic methods to execute. The W3C web application is…

  • Joining Three or More Tables in SQL

    Joining multiple tables in SQL is some tricky task. It can be more difficult if you need to join more than two tables in single SQL query, we will analyze how to retrieve data from multiple tables using INNER JOINs. In this section, we have used two approaches to join three or more tables in SQL. Example: We are creating…