Translation:How many tables are there in the restaurant?
So here's where に and で can get a little confusing.
When there's an action verb involved, you use に to mark location if it involves a direction of movement (レストランにいきます, I'm going to the restaurant) and で if you're trying to show where you are when you're doing something (みせで本をかいました, I bought a book at the store). There are, of course, exceptions to this, but that's the easiest way to think of it.
When there's no action verb involved, such as in this sentence, に is generally used to show location instead. Other examples might be:
へやにいます = I'm in my room.
つくえのうえにあります = It's on top of the desk.
いすの下に本があります = There's a book under the chair.
へやにです is like saying "I is in my room." It's understandable, but grammatically incorrect.
です is the verb for "is" or "to be." You use it, in this context, to describe characteristics. Ex:
ほんです = It is a book.
あかいです = It is red.
かれはアメリカ人です = He is American.
います, which is the -ます form of the verb いる, is the verb that describes the existence and/or presence of animate things. It's the equivalent to ある for living critters like people or animals. When you describe the location of something, you're talking about it being present somewhere -- hence the use of いる / ある.
I'm curious what you mean by います meaning "I have." Could you provide an example of this use?
So, in those sentences, います is still being used to demonstrate existence. 犬がいます literally means "There is a dog." But, depending on the context, it can be interpreted as "I have a dog."
Ex: If someone asked you if you had any pets, you could say 犬がいます. Or if you're about to invite someone to your home, you could say it and they'd know you're warning them that there's a dog there.
But if you're talking about something unrelated and you want to tell someone you have a dog, you'd want to use 持つ (もつ / to have or possess) so there was no confusion. If you just use いる, they'd assume you meant there was a dog somewhere nearby and you were trying to draw their attention to it.
I know you've already been answered, but I hope this is easier to understand;
です acts like a "=".
（あり）います shows existence.
「名前はジョンです」 means "My name = John"
「そこにあります」 means "It is existing at this place"
"My name is existing as John" and "It is = at this place" don't make much sense, unless context says otherwise.
Simply put に is used where something exists (います/あります）somewhere while で is used when indicating the place or means of transport or if something is made by or from something. Both are interchangable only in case of movement.
Other than that, に is also used when talking about specific time (at nine o'clock - 九時に) but only if it's specific, not with terms like today, this week or the next year.
In a vacuum, you are correct. But with a little context you are wrong. You are talking to somone about going to a restaurant. You mention that you are doing something at school. Because the other person doesn't want to confuse you when they realize they don't want to wait for a table they say, "Oh, um, at the restaurant, how many tables are there?" If they said, "How many tables are there at the restaurant?" You would first be confused about why they were asking about tables at the school because that was the topic until they changed it at the end of the sentence, instead of the beginning of the sentence.
Suggestion for Duolingo: Make this a more practical sentence and have us learn how to ask if there are tables available in the restaurant.
So far, Duolingo lacks on the practicality aspect. It teaches us how to say that there are 9 desks in the room or that I go to bed at 12am but no, I don't want to wake up... Or there are 5 birds (where?).
While some stuff is good and practical, some of these sentences could be written so they are more practical....
I wish it was a bit more geared towards real life scenarios.
i see, but it's not the answer
why do i need to use 'there' in this question ?
will it become "レストランにテーブルはいくつですか？" otherwise? i understand why 'there' in "there are five tables in the restaurant" cannot be omitted, but "how many tables are in the restaurant?" sounds perfectly fine to me, no need for 'there'
where did the word ikutsu come from? If it was used in a previous lesson I apologize. I just can't help but feel random words are sprung on you sometimes and it's unhelpful. It's okay when it's accompanied by a picture or the kanji but when it isn't it's extremely confusing.
Technically it is correct but there is no previous content that was implied at the start. What I mean by that is は is use to establish topic, in this case "Talking about the tables in the restaurant, How many are there?" When you use が It is establishing subject, but more in the sense of "how about the chairs in this restaurant, how many are there?" So you can still use が, but it is more natural to use は first, Especially when asking a question in that manner.
So, how would this be taken in Japan? Would it be the same as asking how many tables are free now? In Australia this would likely to interpreted as asking about the maximum number of people the restaurant can sit, say, if you were planning a wedding and want to know if they'd have space for 100 guests.
Same reason in English: How many (いくつ) vs. How much (いくら).
For a better explanation, asking "how many?" inquires typically about physical quantity. "How much?" is used more for intangible quantities and amounts, especially when asking about money.
This comes best when differentiating "how much money?" and "How many $10s do you have?", as a rather specific example.
Imagine は as "regarding" so レストランにテーブルはいくつありますか? is literally "Regarding the tables in the restaurant, how many of them are there?" while レストランにはテーブルがいくつありますか？means "Regarding the restaurant, how many tables does it have?". Please note that the second version needs が to sound complete.
But why is this just に, where are they just taught us last lesson that には was used in asking how many chairs are in the room.
by rights, something in the teaching of this program is not good at really helping understand.
The previous lesson repeatedly asked 部屋には椅子がいくつありますか
So how doesnt that carry here? We're asking in the room is the topic, には、this makes sense given what we've learned up until now, but here, in the restaurant is also the topic, so, には, makes sense given what I've learned.
Both are correct - には and に on its own - in both sentences. The topic doesn't have to be emphasised. は means something along the lines of "regarding". The sentence without は is a straightforward translation of "How many tables are there in the restaurant?" while adding は would be something like "Regarding what's in the restaurant, how many tables are there?" even though nobody would say that in English.
If you're being sarcastic, that's shameful. In fact, if you want to book a table in a restaurant, you will use this sentence. Although the word "available" isn't there it's implicit. Anyway, if it wasn't it would be easy to just research for the word "available" and turn "レストランにテーブルはいくつありますか？" in ""レストランに[available]テーブルはいくつありますか？ ".
Btw, you can change the words and use the strucutre for other situations. Now you know that if you want to know how many things are in somewhere, you have to use "[place]に[things]はいくつありますか？". It's very useful. For example, "How many jobs are there in the company?", "How many people are there in your house/family?", etc, etc. You just need to learn the words you want and use it.