Category: Queries
-
Sorting Results
The SQL ORDER BY clause is used to sort the data in ascending or descending order, based on one or more columns. By default, some databases sort the query results in an ascending order. In addition to that, ORDER BY clause can also sort the data in a database table in a preferred order. This case may…
-
Delete Query
The SQL DELETE Statement The SQL DELETE Statement is used to delete the records from an existing table. In order to filter the records to be deleted (or, delete particular records), we need to use the WHERE clause along with the DELETE statement. If you execute DELETE statement without a WHERE clause, it will delete all the records from…
-
Update Query
The SQL UPDATE Statement The SQL UPDATE Statement is used to modify the existing records in a table. This statement is a part of Data Manipulation Language (DML), as it only modifies the data present in a table without affecting the table’s structure. To filter records that needs to be modified, you can use a WHERE clause…
-
Insert Into… Select Statement
The Insert Into… Select Statement The SQL INSERT INTO… SELECT statement is used to add/insert one or more new rows from an existing table to another table. This statement is a combination of two different statements: INSERT INTO and SELECT. When these statements are used together, the SELECT statement first retrieves the data from an existing table…
-
Select Into Statement
The SQL Select Into Statement The SQL SELECT INTO Statement creates a new table and inserts data from an existing table into the newly created table. The new table is automatically created based on the structure of the columns in the SELECT statement and can be created in the same database or in a different database. However,…
-
Select Query
The SQL SELECT Statement The SQL SELECT Statement is used to fetch the data from a database table which returns this data in the form of a table. These tables are called result-sets. CLAUSES and OPERATORS available in SQL can be used with the SELECT statement in order to retrieve the filtered records of a database table.…
-
Insert Query
The SQL INSERT INTO Statement The SQL INSERT INTO Statement is used to add new rows of data into a table in the database. Almost all the RDBMS provide this SQL query to add the records in database tables. Each value in the records we are inserting in a table using this statement should be of the…