Customers and Orders are separate entities, related via CustomerID.
Why Other Options Are Incorrect:
Option A (Reflexive relationship) (Incorrect):Used forself-referencing entities, not two different entities.
Option B (Entity type) (Incorrect):Defines aclass of objects, but does not establish relationships.
Option D (Attribute) (Incorrect):Attributesdescribeentities but do not connect them.
Thus, the correct answer isRelationship, as it connectstwo separate entities.
[Reference:Relationships in ER Models., ]
Question 2
Which syntax feature classifies the explicit string, numeric, or binary values used in SQL queries?
Options:
A.
Literals
B.
Comments
C.
Identifiers
D.
Keywords
Answer:
A
Explanation:
In SQL,literalsrepresent explicit values such asnumbers, strings, or binary datadirectly written into queries. For example:
SELECT * FROM Employees WHERE Salary > 50000;
Here, 50000 is anumeric literal.
Option A (Correct):Literalsare explicit values used in SQL queries, such as 123, 'John Doe', and TRUE.
Option B (Incorrect):Commentsare non-executable text used for documentation within SQL code, typically denoted by -- or /* ... */.
Option C (Incorrect):Identifiersare names oftables, columns, or other database objects, such as EmployeeID.
Option D (Incorrect):Keywordsare reserved words in SQL (e.g., SELECT, FROM, WHERE) that define operations and syntax.
[Reference:SQL syntax fundamentals in SE 3050 zyBooks., ]
Question 3
Which type of join selects all the rows from both the left and right table, regardless of match?
Options:
A.
Full Join
B.
Outer Join
C.
Inner Join
D.
Cross Join
Answer:
A
Explanation:
AFull Join (FULL OUTER JOIN)selectsall 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 retrievesall employees and all departments, even if an employeehas no assigned departmentor a departmenthas no employees.
Types of Joins:
FULL OUTER JOIN (Correct Answer)→ Includesall rows from both tables, filling missing values with NULL.
LEFT JOIN (Incorrect)→ Includesall rows from the left tableandmatching rows from the right table.
RIGHT JOIN (Incorrect)→ Includesall rows from the right tableandmatching rows from the left table.
CROSS JOIN (Incorrect)→ Produces aCartesian product(each row from one table is combined with every row from another table).
Thus, the correct answer isFULL JOIN, whichensures that all rows from both tables appear in the result.