1/22
Fill-in-the-blank practice flashcards covering SQL data definition language (LDD), data manipulation language (LMD), aggregation functions, grouping, and constraints.
In SQL, the aggregate function that computes the total sum of a column is __________.
SUM
To retrieve the lowest value among a set of column values, SQL provides the aggregate function __________.
MIN
To find the highest value in a specified column, SQL uses the aggregate function __________.
MAX
The aggregate function that computes the sum divided by the number of entries is __________.
AVG
The aggregate function that serves as a counter to return the total number of rows or values is __________.
COUNT
To temporarily rename a column or assign an alias in a query, SQL uses the keyword __________.
AS
In SQL, __________ is used to group data by common attributes, often indicated by the need to aggregate per 'each' category.
GROUP BY
Because WHERE cannot be applied directly to aggregate functions, SQL uses the __________ clause to filter aggregated groups.
HAVING
In an ORDER BY clause, results are sorted in ascending order using the keyword __________.
ASC
In an ORDER BY clause, results are sorted in descending order using the keyword __________.
DESC
Under LDD (Data Definition Language), the command used to define a new database structure is __________.
CREATE TABLE
In a relational schema description, a foreign key is denoted by a(n) __________ next to the column name.
#
In SQL data types, __________ defines a maximum fixed length where values of shorter lengths are acceptable.
VARCHAR
The data type CHAR represents a(n) __________ length, meaning inputs with fewer or more characters than specified are invalid.
fixed
To add a new column to an existing table, the syntax is ALTER TABLE 'table' __________ 'colonne' type;.
ADD
To delete an existing column from a table, the statement syntax is ALTER TABLE 'table' __________ 'colonne';.
DROP
To enforce a mandatory value on a column in an existing table, the statement is ALTER TABLE 'table' MODIFY 'colonne' type SET __________;.
NOT NULL
To enforce a condition such as column > 0 via an ALTER TABLE statement, SQL uses a(n) __________ constraint.
CHECK
To automatically assign a predefined value when no value is provided, SQL uses the __________ constraint.
DEFAULT
To remove a primary key from an existing table, the command is ALTER TABLE 'table' DROP CONSTRAINT __________;.
PRIMARY KEY
Under LMD, the statement used to insert new records into a table is __________.
INSERT INTO
In SQL, the command used to modify existing values in table fields based on a condition is __________.
UPDATE
To remove existing rows from a table that satisfy a specific condition, SQL uses the __________ FROM statement.
DELETE