Beruflich Dokumente
Kultur Dokumente
CREATE, ALTER, RENAME, DROP and TRUNCATE statements are the names of few data
definition elements.
ometimes we need to change the data type of a column. To do this, we use the ALTER
TABLE Modify Column command.
SQL has several arithmetic functions to do math on the numbers, such as summing up,
taking average, retrieved from the column. They are:
AVG():- Average of the column
COUNT():- Number of records
MAX():- maximum of the column
MIN():- minimum of the column
SUM():- Sum of the column
The HAVING clause was added to SQL because the WHERE keyword could not be used with
aggregate functions
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.
SELECT A.id
FROM A
WHERE A.age > ALL (SELECT B.age
FROM B
WHERE B. name = "arun")
The meaning of �ALL� is the A.Age should be greater than all the values returned by
the subquery. There is no entry with name �arun� in table B. So the subquery will
return NULL. If a subquery returns NULL, then the condition becomes true for all
rows of A (See this for details). So all rows of table A are selected.
the ANY and ALL operators are used with a WHERE or HAVING clause.
The ANY operator returns true if any of the subquery values meet the condition.
(���� ����� ��� ��� ������ �� �� ��� �� ���� ��� ����� ���� ��� ����� ��� ���� ����
�� �� ���� ��� ����� ��� �� ���� ���� ���� �� �� �����
SELECT ProductName
FROM Products
WHERE ProductID = all (SELECT ProductID FROM OrderDetails WHERE Quantity = 10);
The ALL operator returns true if all of the subquery values meet the condition.
https://www.edufever.com/mcq-on-dbms/