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 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.
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
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).
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.
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.
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.
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!
No, it's A. I ran the query in SMSS and it returned 4 rows.
upvoted 1 times
...
...
This section is not available anymore. Please use the main Exam Page.98-364 Exam Questions
Log in to ExamTopics
Sign in:
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.
TheRandomOne
Highly Voted 4 years, 8 months agodonmcallan
Highly Voted 4 years, 5 months agoemka_ka
Most Recent 3 years, 3 months agoMorgane
3 years, 8 months agoJasonGraham
4 years, 4 months agocrisdrum
4 years, 7 months agojgarrids
4 years, 8 months agovishnu15
4 years, 8 months agobulat
4 years, 9 months agodrx
4 years, 9 months agoPink_Dreams
4 years, 9 months agoJasonGraham
4 years, 4 months agoemka_ka
3 years, 3 months agoemka_ka
3 years, 3 months agogoodidea
4 years, 10 months agojulie2020
4 years, 11 months agoCezarS
4 years, 11 months agoSaisha
4 years, 11 months agonadzir
5 years agoJasonGraham
4 years, 4 months ago