Q What are different types of constraint in SQL ?
Following are the different types of constraints in SQl:-
When a foreign key refers to the column of the same table then it is called self referencing foreign key.
Q what is aggregate function ?
Following are the different types of constraints in SQl:-
- Primary Key Constraint
- Foreign Key Constraint
- Unique Constraint
- Check Constraint
- Not Null Constraint
When a foreign key refers to the column of the same table then it is called self referencing foreign key.
Aggregate function returns single value after performing calculation on set of values.Aggregate functions are generally used with the GROUP BY clause of the SELECT statement.
- AVG() - It is used to find the average value
- COUNT() - It is used to find the number of rows
- MAX() - It is used to find the largest value
- MIN() - It is used to find the smallest value
- SUM() - It is used to find the sum
No comments:
Post a Comment