Questions about Files?

2 persons with same name in the grades exercise

2 persons with same name in the grades exercise

par Ahmad AlLakeas,
Nombre de réponses : 1
Avatar GroupEn

Can we solve the grades exercise using first and last name? because if we encounter 2 persons with the same first name what will display grade returns?

En réponse à Ahmad AlLakeas

Re: 2 persons with same name in the grades exercise

par Siba Haidar,
yes sure
A name can be considered a full name = first +" "+ last. An array of characters can have space inside.
But even though, you may always encounter duplicates.

So that's why when you study databases you will learn that a name is not an identifier, because it is not unique.
You will need an identifier like your student id, to make queries on dbs.
Identification means key. They'd better be integers.

Because later, in Data Structure, and then in Java and other courses, you will learn also the hashing.
Hashing serves in finding something in databases ans data structures quickly.
And the hash number is an int number as to be almost unique for each object.
In particular, hashing an integer is the integer itself, which is very convenient.
That is why, queries in general to be informative and meaningful must be on keys, AND keys must be integers.
There are many IT people in the market, who do not know, or are misusing these concepts,
therefore their work comes erroneos or ineffective (not rapid).

You see your question was very interesting ... thank you.