WGU Data Management – Foundations Exam Questions and Answers
Question 17
What does the aggregate function do?
Options:
A.
It computes values over a set of rows.
B.
It selects rows that appear in one table but not another.
C.
It eliminates one or more columns of a table.
D.
It lists combinations of rows in two tables.
Answer:
A
Explanation:
Anaggregate functionperforms acalculation over multiple rowsand returns asingle value. Examples includeSUM(), AVG(), MAX(), MIN(), and COUNT()in SQL.
Option A (Correct):Aggregate functions compute values over aset of rows, like summingtotal sales or averaging grades.
Option B (Incorrect):Selecting rows that appear in one table but not another is done usingset operations (EXCEPT or MINUS in SQL).
Option C (Incorrect):Eliminating columns is done using thePROJECToperation orSELECT with specific columns.
Option D (Incorrect):Combining rows from two tables refers to aJOIN operation, not aggregation.
[Reference:Aggregate functions in relational algebra., , , ]
Question 18
Which keyword can be used as a clause in an ALTER TABLE statement?
Options:
A.
DELETE
B.
CHANGE
C.
STOP
D.
AGGREGATE
Answer:
B
Explanation:
TheALTER TABLEstatement is used to modify an existing database table structure. One common clause isCHANGE, which allows renaming a column and modifying its data type.
Example:
sql
ALTER TABLE Employees CHANGE COLUMN OldName NewName VARCHAR(50);
Option A (Incorrect):DELETE is used to removerows, not alter table structure.
Option B (Correct):CHANGE is avalid clausefor renaming and modifying columns in MySQL and some other databases.
Option C (Incorrect):STOP is not a valid SQL keyword for altering tables.
Option D (Incorrect):AGGREGATE refers to functions like SUM() and AVG(), not table alterations.
[Reference:SQL ALTER TABLE syntax in SE 3050 zyBooks., ]