Cec005-Cec41s4 SQL2 Manapao
Cec005-Cec41s4 SQL2 Manapao
Quiz Result
Wrong/Skipped
Right Answer
1. Which SQL join gives both matched and unmatched rows of data?
Description : When discussing unmatched rows being included along with matched rows, the OUTER
JOIN, either LEFT or RIGHT, fulfills this criterion by including all rows from at least one table along with
Page 1 of 4
matching rows from the other table.
Your Answer : A join that creates the cartesian product of two tables.
Description : A CROSS JOIN in SQL combines all rows from one table with all rows from another table,
creating the Cartesian product. It does not consider any matching conditions and results in a combined set
containing every possible combination of rows between the tables.
Description : In SQL Self Join, a table is joined to itself. This means each row of the table is joined with itself
and all other rows concerning stated conditions if any. In other words, we can say that it is a merge between
two copies of the same table. This is extremely helpful when the foreign key references the primary key of
the same table.
Description : In a relational database, the Foreign Key is a field or set of fields in one table that uniquely
identifies a record in another table, establishing a relationship between the tables.
5. Outer joins always result in a reduced number of rows compared to inner joins.
Description : In an outer join, rows that do not have matching values in the joined columns are still
included in the result set, along with the matched rows. As a result, the number of rows in the output of an
outer join could be greater than or equal to the number of rows in the original tables, depending on the
specific join conditions and data present.
Description : Large databases can suffer from data redundancy, which refers to the unnecessary repetition
or duplication of data, potentially leading to inefficiencies, storage issues, and inconsistencies within the
Page 2 of 4
database.
Description : The primary purpose of the SQL JOIN statement is to merge or combine data from multiple
tables based on a related column between them, producing a unified result set.
8. When might you use a "CROSS JOIN" intentionally, and what should you consider when using it?
Your Answer : Use a CROSS JOIN carefully, as it can lead to large result sets and performance
issues.
Description : A CROSS JOIN is used intentionally when you want to create a Cartesian product or combine
rows without specific matching conditions. However, caution is necessary as it can generate excessively
large result sets, impacting performance, and should be used judiciously to avoid unintended
consequences.
Description : A SQL SELF JOIN is used to combine rows from the same table based on a related column
within that table. It's employed when data needs to be correlated or compared within a single table.
10. Which statement is used to join two or more tables in a JOIN condition?
Description : The SELECT statement in SQL is used to retrieve data from one or more tables. When joining
tables, the SELECT statement is accompanied by the JOIN clause to specify the tables and conditions for
combining their data.
Page 3 of 4
Page 4 of 4