exam questions

Exam 98-364 All Questions

View all questions & answers for the 98-364 exam

Exam 98-364 topic 1 question 80 discussion

Actual exam question from Microsoft's 98-364
Question #: 80
Topic #: 1
[All 98-364 Questions]

You have the database table named Cars as defined below:

You have the following Structured Query Language (SQL) statement:

How many rows are returned by the SQL statement?

  • A. 4
  • B. 5
  • C. 6
  • D. 7
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
TheRandomOne
Highly Voted 4 years, 8 months ago
A is the correct answer in this case. In this case since its "<>" (not equals to), makes it a little trickier. AND - Removes all results that have color black OR country USA. Example: Black Germany -> TRUE AND FALSE -> FALSE This would not retrieve the record. If you have OR, it would retrieve all except BLACK AND USA. Example: Black Germany -> TRUE OR FALSE -> TRUE This would retrieve the record. Run the operation on your head and count them. It should be 4 retrieved.
upvoted 17 times
...
donmcallan
Highly Voted 4 years, 5 months ago
The answer is D is D because we are using AND operator which requires both paramenters to be true
upvoted 8 times
...
emka_ka
Most Recent 3 years, 3 months ago
Four records returned is correct: Use Boolean on each row evaluating values in Country AND Colour and accounting for =! The first line for instance gives TRUE as both values are true acc to the query, as neither color is black nor country is USA. T and T gives T for AND. The second row gives FALSE - because the color isn't Black so we want that, it's TRUE acc to the <>, but the Country is USA, which we don't want, a false acc to <> part of the query. So we have T and F giving an overall F for AND. Evaluating in Boolean comparisons manner each record for values for each of the attributes (Colour and Country), only four records have True and True for our 'not Black and not USA' so overall TRUE to be returned for Boolean AND. From top to bottom Boolean for each record according to NOT and AND is T, F, T, T, F, T, F, F. For AND Boolean is: attribute1 attribute2 returns T T T T F F F T F F F F
upvoted 2 times
...
Morgane
3 years, 8 months ago
A is correct. If that can help anyone, I found that adding in your head "rows where" on either side of the "AND" helped me understand that you need to deduct from the results all rows that have black as well as all rows that have a USA location, hence 4 rows in this case. (remove 3 black rows you get 5 rows that still include one USA row, then remove that one and you get 4).
upvoted 1 times
...
JasonGraham
4 years, 4 months ago
The Answer is A. I recreated the table in SMSS and I ran the query just as it is in this question. It returned 4 rows.
upvoted 5 times
...
crisdrum
4 years, 7 months ago
If you run the operation the answer is A
upvoted 3 times
...
jgarrids
4 years, 8 months ago
La respuesta es D. AND implica que se cumplan las dos condiciones mientras que OR implica que se cumpla una u otra. Teniendo eso en cuenta la respuesta es clara.
upvoted 1 times
...
vishnu15
4 years, 8 months ago
A is correct
upvoted 3 times
...
bulat
4 years, 9 months ago
The option A is correct
upvoted 3 times
...
drx
4 years, 9 months ago
For the answer to be A, the query would have OR in the statement instead of AND. Otherwise the answer is 1 which is not listed. The Convertible is the only car that is Black AND made in the US. "The AND operator displays a record if all the conditions separated by AND are TRUE. The OR operator displays a record if any of the conditions separated by OR is TRUE." The AND operator displays a record if all the conditions separated by AND are TRUE. The OR operator displays a record if any of the conditions separated by OR is TRUE.
upvoted 5 times
Pink_Dreams
4 years, 9 months ago
Well done!
upvoted 1 times
...
JasonGraham
4 years, 4 months ago
Sounds good but if you run the query it returns 4 rows and the answer is A.
upvoted 1 times
...
emka_ka
3 years, 3 months ago
I thought so initially, but the <> is a plot twist. Following Boolean comparison, you will get 4 rows, not 7. You'll need to take into account only rows for which Country AND Colour give TRUE acc to Boolean comparisons rules. It's easier to remember that when you have =! and AND, count as if it was = to and OR without having to use Boolean.
upvoted 1 times
emka_ka
3 years, 3 months ago
to the moderator, please ignore and delete the above of mine in reply to user 'drx'. the OR part was an error. I posted without that at the top of the thread. apologies!
upvoted 1 times
...
...
...
goodidea
4 years, 10 months ago
a becouse it is not ,and and
upvoted 2 times
...
julie2020
4 years, 11 months ago
I believe D is right answer... right ????
upvoted 1 times
...
CezarS
4 years, 11 months ago
i think it's A because we have an AND in the statement, not an OR
upvoted 7 times
...
Saisha
4 years, 11 months ago
it should be D
upvoted 2 times
...
nadzir
5 years ago
the answer should be D, right?
upvoted 5 times
JasonGraham
4 years, 4 months ago
No, it's A. I ran the query in SMSS and it returned 4 rows.
upvoted 1 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 ...