MySQL Database Tutorial – 11 – Advanced Filtering Using AND and OR




Facebook – https://www.facebook.com/TheNewBoston-464114846956315/ GitHub – https://github.com/buckyroberts Google+ – https://plus.google.com/+BuckyRoberts LinkedIn – https://www.linkedin.com/in/buc…

Original source


36 responses to “MySQL Database Tutorial – 11 – Advanced Filtering Using AND and OR”

  1. Just wanted to ask. if we have multiple costumers that has a id of 1 and 2. for example we have 5costumers that has a id no of 1, and 4 costumers of an id no of 2.

    Does, SELECT id, name, city FROM costumers WHERE id=1 OR id=2 AND city="Raleigh"

    will it show all costumers with an id no of 1 and 2.

    Its like, SELECT id, name, city FROM costumers WHERE id=1 OR  id=2

    to make it clear.

    What if there is no costumer with an id no of 1 and 2 that lives in Raleigh, will it give the same result?

    in SELECT id, name, city FROM costumers WHERE id=1 OR id=2 AND city="Raleigh"

  2. just to make it a little bit more clear. OR is a logical operation that stands for sum, AND is a logical operation which stands for multiplication. From math we know, that we do multiplication before sum. So in case we want to change this, we use parenthesis, simple math.

  3. Everyone says how bad schools and teachers are and how good these free tutorials are–and I agree! However, I want to make sure that all these people, if ever they become employers, remember this sentiment and NOT REQUIRE DEGREES FROM PROSPECTIVE EMPLOYEES! Deal? 🙂

  4. @suicidebombadil This is the main reason why i staryed to study on my own. the only reason that i havent dropped out of college just like Bucky did is ecause in my country you cannot have a good salary if dont have a career. so yeah,i go to college just becaus i need that goddamn paper.

  5. no its in binary math and electronics so if you have an or gate and you input 1 and 0 to it it will give you 1 because 1+0=1 but it wont work if you give it 1 + 1 because it cant give you 10 for that it needs a carrier that is why I said its kinda like adding and multiplying because you need carriers to make it a true addition or a true multiplication

Leave a Reply