exam questions

Exam DA0-001 All Questions

View all questions & answers for the DA0-001 exam

Exam DA0-001 topic 1 question 47 discussion

Actual exam question from CompTIA's DA0-001
Question #: 47
Topic #: 1
[All DA0-001 Questions]

Given the following customer and order tables:


Which of the following describes the number of rows and columns of data that would be present after performing an INNER JOIN of the tables?

  • A. Five rows, eight columns
  • B. Seven rows, eight columns
  • C. Eight rows, seven columns
  • D. Nine rows, five columns
Show Suggested Answer Hide Answer
Suggested Answer: A 🗳️

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
ronniehaang
Highly Voted 2 years, 2 months ago
Selected Answer: A
A. Five rows, eight columns. Inner join returns only the rows where there is a match between the two tables in the specified join condition. In this case, the join condition would be based on the "Customer ID" column, which is present in both tables. So, the inner join of the two tables would result in 5 rows where there is a match in the "Customer ID" column, and each row would have 8 columns (all columns from both tables).
upvoted 6 times
...
Manizha
Most Recent 5 months, 1 week ago
Selected Answer: B
Table 1 has Customer_IDs: 004, 004, 008, 003, 001, 001, 002 Table 2 has Customer_IDs: 004, 009, 008, 003, 002, 001, 007 Let's count matches: 004 appears twice in Table 1, once in Table 2 = 2 rows in result 008 appears once in each = 1 row 003 appears once in each = 1 row 002 appears once in each = 1 row 001 appears twice in Table 1, once in Table 2 = 2 rows (009 and 007 only appear in Table 2, so they drop out) Total number of rows: 2 + 1 + 1 + 1 + 2 = 7 rows Count columns: Table 1: Customer_ID, Order_date, Product, Discount_code (4 columns) Table 2: Customer_ID, Active_flag, Segment, Store_ID, Spend (5 columns) When joined, Customer_ID appears only once Total columns: 4 + 5 - 1 = 8 columns Therefore, the result will have 7 rows and 8 columns.
upvoted 1 times
...
MadalinaUsurelu
6 months, 3 weeks ago
B. I just tried in SQL
upvoted 1 times
...
Swift_and_Quick
1 year ago
B is the correct answer. There are 7 rows in the order table, all those 7 rows will retain when inner join occurred because Customer_ID matches the customer table. Since customer like 001 and 004 appear twice in the order table, they will appear twice in the newly joined table as well. There are 8 columns because Customer_ID column is in both tables, 4 unique columns in customer table, 3 unique columns in order table, combined is 8 columns. I tried it with SQL and it returned 7 rows, A is not the answer, joined table can have duplicates.
upvoted 1 times
...
Hiromi_Nakatani
2 years, 3 months ago
Selected Answer: B
B. Seven rows, eight columns
upvoted 4 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago