Group By and Having The GROUP BY statement groups rows that have the same values into summary rows, like "find the number of customers in each dept". The GROUP BY statement is must be used with aggregate functions (COUNT, MAX, MIN, SUM, AVG) to group the result-set by one or more columns. GROUP BY Syntax
SQL DML, DML and DQL commands
1. DDL(Data Definition Language) : DDL or Data Definition Language really comprises of the SQL orders that can be utilized to characterize the information base diagram. It just arrangements with portrayals of the information base pattern and is utilized to make and adjust the structure of data set articles in the data set.
Instances of DDL orders:
○ CREATE –is utilized to make the information base or its articles (like table, file, work, sees, store system and triggers).
○ DROP –is utilized to erase objects from the information base.
○ ALTER-is utilized to adjust the structure of the information base.
○ TRUNCATE–is utilized to eliminate all records from a table, including all spaces dispensed for the records are taken out.
○ COMMENT –is utilized to add remarks to the information word reference.
○ RENAME –is utilized to rename an item existing in the information base.
2. DQL (Data Query Language) :
DML proclamations are utilized for performing questions on the information inside pattern objects. The motivation behind DQL Command is to get some blueprint connection dependent on the inquiry passed to it.
Illustration of DQL:
○ SELECT –is utilized to recover information from the an information base.
3. DML(Data Manipulation Language) : The SQL orders that manages the control of information present in the information base have a place with DML or Data Manipulation Language and this incorporates the majority of the SQL explanations.
Instances of DML:
○ INSERT –is utilized to embed information into a table.
○ UPDATE –is utilized to refresh existing information inside a table.
○ DELETE –is utilized to erase records from an information base table.
Comments
Post a Comment