Answer : The DEFAULT constraint automatically assigns a value when no value is supplied.
15. What is check constraint?
Answer : The CHECK constraint ensures that the value entered satisfies a particular condition.
16. What is the use of drop table command?
Answer :The DROP TABLE command is used to remove a table completely from the database.
17. What is the use of alter table command?
Answer : The ALTER TABLE command is used to modify the structure of an existing table.
It can be used to :
- Add a new column
- Change the size of existing column
18. What is the use of select command?
Answer : The SELECT command is used to retrieve information from a table.
19. What is the use of distinct clause?
Answer :DISTINCT is used to display only different or unique values.
20. What is the use of where clause?
Answer : The WHERE clause is used to specify a condition for selecting records.
21. What is the use of between operator?
Answer : The BETWEEN operator is used to select values within a specified range.
22. What is the use of ORDER BY clause?
Answer : The ORDER BY clause is used to arrange the result in ascending or descending order.
23. What is the use of GROUP BY clause?
Answer :The GROUP BY clause is used to arrange rows having the same value into groups.
It is commonly used with aggregate functions such as SUM(), AVG(), COUNT(), MAX() and MIN().
24. What is the use of HAVING clause?
Answer : The HAVING clause is used to apply a condition to groups created by GROUP BY.
25. What are aggregate functions?
Answer :
Aggregate functions perform calculations on a group of values and return a single result.
The important aggregate functions are:
- SUM()
- AVG()
- COUNT()
- MAX()
- MIN()
25. What is a join operation?
Answer :In a relational database, information is often stored in more than one table.A join operation is used to combine data from two or more tables
25. What is union?
Answer :The UNION operator is used to combine the results of two SELECT queries into one result.
25. What is cartesian product?
Answer :A Cartesian product combines every row of the first table with every row of the second table.
It can be obtained by writing two tables in the FROM clause without a joining condition.
Example:
SELECT * FROM STUDENT, MARKS;