WGU Data Management - Foundations (D426) Exam Questions

Page: 1 / 14
Total 60 questions
Question 1

Which syntax feature classifies the explicit string, numeric, or binary values used in SQL queries?



Answer : A

In SQL, literals represent explicit values such as numbers, strings, or binary data directly written into queries. For example:

SELECT * FROM Employees WHERE Salary > 50000;

Here, 50000 is a numeric literal.

Option A (Correct): Literals are explicit values used in SQL queries, such as 123, 'John Doe', and TRUE.

Option B (Incorrect): Comments are non-executable text used for documentation within SQL code, typically denoted by -- or /* ... */.

Option C (Incorrect): Identifiers are names of tables, columns, or other database objects, such as EmployeeID.

Option D (Incorrect): Keywords are reserved words in SQL (e.g., SELECT, FROM, WHERE) that define operations and syntax.


Question 2

Which action does the % operator accomplish in MySQL?



Answer : C

The % operator in MySQL is known as the modulus operator. It returns the remainder of a division operation between two numbers.

Example:

sql

SELECT 10 % 3; -- Output: 1 (10 divided by 3 gives remainder 1)

Option A (Incorrect): Raising a number to a power is done using the POW() function or ^ in some SQL dialects.

Option B (Incorrect): The = operator is used for equality comparisons, not %.

Option C (Correct): The modulus operator (%) finds the remainder when one number is divided by another.

Option D (Incorrect): Subtraction is performed using the - operator.


Question 3

Which type of join selects all the rows from both the left and right table, regardless of match?



Answer : A

A Full Join (FULL OUTER JOIN) selects all records from both tables, filling in NULL values where there is no match. This ensures that no data is lost from either table.

Example Usage:

sql

SELECT Employees.Name, Departments.DepartmentName

FROM Employees

FULL OUTER JOIN Departments ON Employees.DeptID = Departments.ID;

This query retrieves all employees and all departments, even if an employee has no assigned department or a department has no employees.

Types of Joins:

FULL OUTER JOIN (Correct Answer) Includes all rows from both tables, filling missing values with NULL.

LEFT JOIN (Incorrect) Includes all rows from the left table and matching rows from the right table.

RIGHT JOIN (Incorrect) Includes all rows from the right table and matching rows from the left table.

CROSS JOIN (Incorrect) Produces a Cartesian product (each row from one table is combined with every row from another table).

Thus, the correct answer is FULL JOIN, which ensures that all rows from both tables appear in the result.


Question 4

Which description defines a data type?



Answer : A

A data type defines the kind of data a column can store in a database. It ensures data consistency and efficient storage.

Option A (Correct): A data type is a named set of values, such as INTEGER, VARCHAR, DATE, etc.

Option B (Incorrect): A tuple refers to a row in a relational database, not a data type.

Option C (Incorrect): Data types define column values, but they do not correspond directly to columns.

Option D (Incorrect): Data types do not have a varying set of rows; they define attributes for columns.


Question 5

Which keyword or clause indicates the desired sequence when displaying a set of records returned from a SELECT statement?



Answer : C

The ORDER BY clause in SQL is used to sort query results in ascending (ASC) or descending (DESC) order.

Example Usage:

sql

SELECT Name, Salary FROM Employees ORDER BY Salary DESC;

This retrieves all employees, sorted by salary in descending order.

Why Other Options Are Incorrect:

Option A (BETWEEN) (Incorrect): Used for filtering ranges but does not order results.

Option B (DISTINCT) (Incorrect): Removes duplicate rows but does not control order.

Option D (LIKE) (Incorrect): Used for pattern matching, not sorting.

Thus, ORDER BY is the correct choice for defining the sequence of query results.


Question 6

Which main characteristic is used to differentiate between strong and weak entities in the process of database design?



Answer : B

In database design, an entity is classified as strong or weak based on whether it has a primary key that uniquely identifies its records.

Differences Between Strong and Weak Entities:

CREATE TABLE Orders (

OrderID INT PRIMARY KEY,

CustomerID INT

);

CREATE TABLE OrderDetails (

OrderDetailID INT,

OrderID INT,

ProductID INT,

PRIMARY KEY (OrderDetailID, OrderID),

FOREIGN KEY (OrderID) REFERENCES Orders(OrderID)

);

Orders is a strong entity (has OrderID as its own primary key).

OrderDetails is a weak entity (depends on OrderID for uniqueness).

Why Other Options Are Incorrect:

Option A (Association) (Incorrect): Associations describe relationships but do not define strong/weak entities.

Option C (Foreign key) (Incorrect): Weak entities depend on foreign keys, but primary keys define their status.

Option D (Cardinality) (Incorrect): Cardinality defines relationship constraints but does not differentiate entity types.

Thus, the correct answer is Primary key, as it is the defining characteristic between strong and weak entities.


Question 7

Which relationship exists between occurrences of the same entity types?



Answer : B

A unary relationship (also known as a recursive relationship) occurs when an entity relates to itself.

Example Usage:

Employees and Managers:

sql

CREATE TABLE Employees (

EmpID INT PRIMARY KEY,

Name VARCHAR(50),

ManagerID INT,

FOREIGN KEY (ManagerID) REFERENCES Employees(EmpID)

);

Here, ManagerID references another Employee a unary (self-referential) relationship.

Why Other Options Are Incorrect:

Option A (Modality) (Incorrect): Describes optional vs. mandatory relationships, not self-referencing.

Option C (Cardinality) (Incorrect): Defines how many instances relate, not the type of relationship.

Option D (Binary) (Incorrect): Binary relationships involve two different entities, not self-referencing.

Thus, the correct answer is Unary, as it describes relationships within the same entity type.


Page:    1 / 14   
Total 60 questions