Okay, so the first thing we're
going to need is an ID column,
because nothing else here is unique.
We'll relate donors to their phone
numbers, using the donor's ID.
The ID is arbitrary, as long as the one
here equals the one down here, but
we'll just put 1,
because Mary is the first donor.
The second thing we know
about a donor is their name.
And we know their favorite animal.
Now, Mary has two phones, so
there will be two rows in donor
phones with Mary's id in them.
And Mary has two kinds of phone,
one is a home phone and one is a mobile.
We'll call that column phone type.
And finally we know
Mary's phone numbers.
So there you have it, you've taken
all the data from this object
oriented record and
structured it into database tables.
حسنًا، أول شيء
،سنحتاجه هو عمود المعرف
.نظرًا لعدم وجود أي شيء آخر فريد
سنقوم بربط المتبرعين بأرقام
.هاتفهم مستخدمين معرف المتبرع
يُعد المعرف اختياريًا طالما أن المعرف
هنا يساوي المعرف أدناه، لكن
سنقوم بوضع 1
.لأن ماري هي المتبرعة الأولى
ثانيًا، نأتي إلى
.اسم المتبرع
.ثم إلى حيوانه المفضل
الآن، ماري لديها هاتفين
لذا، سيكون هناك صفين في هواتف المتبرع
.مع وضع معرف ماري فيهما
،ولديها نوعين من الهواتف
.هاتف منزلي وهاتف محمول
.سنطلق على ذلك العمود اسم نوع الهاتف
في النهاية، نعرف
.أرقام ماري الهاتفية
لقد انتهينا، لقد أخذنا
كل البيانات من
السجل المعتمد على الكائن هذا و
.قمنا بإنشاء جداول قاعدة البيانات بها
OK, a primeira coisa que vamos
precisar é uma coluna ID,
pois nada mais aqui é exclusivo.
Vamos relacionar os doadores com seus números de
telefone, usando a ID do doador.
A ID é arbitrária, desde que esta
aqui seja igual àquela de baixo, mas
colocarei apenas 1,
porque Mary é a primeira doadora.
A segunda coisa que sabemos
sobre um doador é o nome dele.
E sabemos o animal favorito dele.
Mary tem dois telefones, portanto,
haverá duas linhas em telefones do
doador com a ID de Mary nelas.
E Mary tem dois tipos de telefone,
um é o telefone residencial e o outro é um celular.
Chamaremos essa coluna de tipo telefone.
E finalmente sabemos os
números de telefone da Mary.
Então aqui está o resultado. Você pegou
todos os dados deste registro
orientado a objeto e
estruturou-os em tabelas de banco de dados.
好 那么我们需要的第一样东西就是一个 ID 列
因为这里没有其它的东西是唯一的
我们使用捐赠人的 ID 把捐赠人与他们的电话号码关联在一起
ID 是任意的 只要这边的一个等于这边的一个
但我们只填1 因为 Mary 是第一个捐赠人
我们了解的关于捐赠人的第二件事就是他们的名字
并且我们知道他们最喜欢的动物
目前 Mary 有两部电话
因此捐赠人电话那里会有两行 其中包含 Mary 的ID
Mary 有两类电话号码 一个是住宅电话 一个是手机
我们把那列称为电话类型
最后 我们终于知道 Mary 的电话号码了
有了它之后 你已经得到了这条面向对象的记录的
所有数据 并用它构建了一个数据库表