• SQL – How To Drop A Database?

    SQL – How To Drop A Database?

    SQL How To Drop A Database? Table Of Contents: How To Drop A Database? Examples Of Dropping A Database? (1) How To Drop A Database? Syntax: DROP DATABASE databasename; (2) Examples Of Dropping A Database? DROP DATABASE testDB;

    Read More

  • SQL – How To Create A Database?

    SQL – How To Create A Database?

    SQL – How To Create A Database? Table Of Contents: Syntax Of Creating SQL Database. Examples Of Creating Database. (1) Syntax Of Creating SQL Database. CREATE DATABASE databasename; (2) Examples Of Creating SQL Database. CREATE DATABASE testDB;

    Read More

  • SQL – Insert Into

    SQL – Insert Into

    SQL Insert Into Table Of Content: What Is SQL Insert Into Statement? Syntax Of SQL Insert Into Statement. Examples Of SQL Insert Into Statement. (1) What Is SQL Insert Into Statement? The INSERT INTO SELECT statement copies data from one table and inserts it into another table. The INSERT INTO SELECT statement requires that the data types in the source and target tables match. (2) Syntax Of SQL Insert Into Statement. Copy all columns from one table to another table: INSERT INTO table2 SELECT * FROM table1 WHERE condition; Copy only some columns from one table into another table: INSERT INTO table2 (column1,

    Read More

  • SQL – Select Into

    SQL – Select Into

    SQL Select Into Table Of Contents: What Is SQL Select Into? Syntax Of SQL Select Into. Examples Of SQL Select Into. (1) What Is SQL Select Into? The SELECT INTO statement copies data from one table into a new table. (2) Syntax Of SQL Select Into. SELECT * INTO newtable [IN externaldb] FROM oldtable WHERE condition; Copy only some columns into a new table: SELECT * INTO newtable [IN externaldb] FROM oldtable WHERE condition; Note: The new table will be created with the column names and types as defined in the old table. You can create new column names using the AS clause.

    Read More

  • SQL – All Keyword

    SQL – All Keyword

    SQL ALL Keyword Table Of Contents: What Is SQL All Keyword? Syntax Of SQL All Keyword. Examples Of SQL ALL Keyword. (1) What Is SQL All Keyword? The ALL operator: returns a boolean value as a result. The ALL operator: returns TRUE if ALL of the subquery values meet the condition. The ALL operator: is used with SELECT, WHERE and HAVING statements. (2) Syntax Of SQL All Keyword. SELECT column_name(s) FROM table_name WHERE column_name operator ALL (SELECT column_name FROM table_name WHERE condition); Note: The operator must be a standard comparison operator (=, <>, !=, >, >=, <, or <=). (3) Examples Of SQL All Keyword. Product Table: Order Table: Example-1: SELECT ProductName

    Read More

  • SQL – Any Keyword

    SQL – Any Keyword

    SQL Any Keyword Table Of Contents: What Is SQL Any Keyword? Syntax Of SQL Any Keyword. Examples Of SQL Any Keyword. (1) What Is SQL Any Keyword? The ANY operator: returns a boolean value as a result. The ANY operator:  returns TRUE if ANY of the subquery values meet the condition (2) Syntax Of SQL Any Keyword? SELECT column_name(s) FROM table_name WHERE column_name operator ANY (SELECT column_name FROM table_name WHERE condition); Note: The operator must be a standard comparison operator (=, <>, !=, >, >=, <, or <=). (3) Examples Of SQL Any Keyword? Product Table: OrderDetails Table: Example-1: SELECT ProductName FROM Products WHERE

    Read More

  • SQL – Exists

    SQL – Exists

    SQL Exists Keyword Table Of Contents: What Is SQL Exists Keyword? Syntax Of SQL Exists. Examples Of SQL Exists. (1) What Is SQL Exists Keyword? The EXISTS operator is used to look for the existence of a row in a given table that satisfies a set of criteria. It is a Boolean operator that compares the result of the subquery to an existing record and returns true or false. The returned value is true, if the subquery fetches single or multiple records and false if no record is matched. It is used in the combination of the subquery and checks

    Read More

  • SQL – Having

    SQL – Having

    SQL Having Keyword Table Of Contents: What Is SQL having Keyword? Syntax Of SQL Having? Examples Of SQL Having. (1) What Is SQL Having Keyword? SQL HAVING clause is similar to the WHERE clause; they are both used to filter rows in a table based on conditions. However, the HAVING clause was included in SQL to filter grouped rows instead of single rows. These rows are grouped together by the GROUP BY clause, so, the HAVING clause must always be followed by the GROUP BY clause. It can be used with aggregate functions, whereas the WHERE clause cannot. (2) Syntax Of

    Read More

  • SQL – Group By

    SQL – Group By

    SQL – Group By Table Of Contents: What Is SQL Group By ? Syntax Of SQL Group By. Examples Of SQL Group By. (1) What Is SQL Group By? The GROUP BY statement groups rows that have the same values into summary rows, like “find the number of customers in each country”. The GROUP BY statement is often used with aggregate functions (COUNT(), MAX(), MIN(), SUM(), AVG()) to group the result set by one or more columns. (2) Syntax Of SQL Group By? SELECT column_name(s) FROM table_name WHERE condition GROUP BY column_name(s) ORDER BY column_name(s); (3) Examples Of SQL Group By? Example-1 SELECT COUNT(CustomerID), Country FROM Customers GROUP

    Read More

  • SQL – Union

    SQL – Union

    SQL – Union Table Of Contents: What Is SQL Union? Syntax Of SQL Union. Examples Of SQL Union. (1) What Is SQL Union ? The UNION the operator is used to combine the result set of two or more SELECT statements. Every SELECT statement within UNION must have the same number of columns. The columns must also have similar data types The columns in every SELECT statement must also be in the same order (2) Syntax Of SQL Union ? Syntax: UNION Syntax SELECT column_name(s) FROM table1 UNION SELECT column_name(s) FROM table2; Syntax: UNION ALL Syntax SELECT column_name(s) FROM table1 UNION ALL SELECT column_name(s) FROM

    Read More