Skip to main content

Group By and Having clause

 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

CREATE TABLE (MSSQL SERVER)

 CREATE TABLE (MSSQL SERVER)

Create Table    keyword is used to create table in SQL server database.

 for creating table following syntax required to follow.

Create table Emp

(

Id bigint,

Name varchar(100),

Designation varchar(100),

Dept Varchar(100),

[Adress] varchar(200),

Mobile bigint,

Gender varchar(1),

EntryDate Datetime

)


To create table following parameters/inputs required.

  1. Table Name ( such as Emp,Student etc..)
  2. Field Name ( such as Id,Name etc..
  3. Data Type    ( such as Biging,Int,Varchar etc..)

CREATE TABLE (MSSQL SERVER)



View newly created table
CREATE TABLE (MSSQL SERVER)






Comments