Okay, so here are two other
tables in the zoo database.
The first one, taxonomy,
gives the scientific names for
all our animal species.
We've been using the common names
like brown bear in our other tables.
This table gives not quite the full
taxonomic name but a lot of it.
The brown bear is genus Ursus.
Species arctos.
And the family Ursidae.
And the oder Carnivora.
We have to call this column
t_order instead of order,
because order is a reserved
word in SQL for order buy.
The t is for taxonomy.
And if we look in this table over here,
we'll see the common names for
all of the orders.
Bats belong in the order Chiroptera and
lizards and
snakes belong to the order Squamata.
and llamas and moose and warthogs all
belong to the order Artiodactyla.
Okay, okay, so
really these tables are just here
to give you more stuff to join.
Big surprise.
This time we want to find out which
orders have the most individual animals
in the zoo, and we want to give
their common names like monotremes,
instead of their scientific
names like monotremata.
So you'll probably need to use both
of those tables, the taxonomy and
the order names table, plus the animals
table with the individual animals in it.
So the problem is, to list the taxonomic
orders by their common names,
sorted by how many individual animals
we have of each order in the zoo.
To see the full schemas the tables,
take a look at the instructor notes.
حسنًا، يوجد جدولان آخران
.في قاعدة بيانات حديقة الحيوان
،يقدم الجدول الأول، taxonomy
الأسماء العلمية
.لجميع أنواع الحيوانات
لقد كنا نستخدم الأسماء الشائعة مثل
.brown bearفي الجداول الأخرى
لا يعطي هذا الجدول تمامًا الاسم
.التصنيفي الكامل لكن الكثير منه
.brown bear من فصيلة Ursus
.والنوع هو arctos
.والعائلة هي Ursidae
.والرتبة هي Carnivora
يجب تسمية هذا العمود
،t_order بدلاً من order
لأن order هي كلمة
.محفوظة في SQL لـ order buy
.وحرف t اختصار لكلمة taxonomy
،وإذا نظرنا إلى هذا الجدول هنا
سنرى الأسماء الشائعة
.لجميع الرتب
تنتمي Bats (الخفافيش) إلى رتبة Chiroptera
(بينما تنتمي lizards (السحالي
.وsnakes (الثعابين) إلى رتبة Squamata
(تنتمي حيوانات llamas (اللاما) وmoose (الموظ) وwarthogs (الخنازير الوحشية الأفريقية
.جميعًا إلى الرتبة Artiodactyla
حسنًا، لذلك، هذه
الجداول موجودة هنا فقط
.لإعطائك المزيد من العناصر لدمج الجداول
.مفاجأة كبيرة
نريد هذه المرة أن نتعرف على أي
الرتب لديها أكبر عدد من الحيوانات الفردية
في الحديقة، ونريد أن نعطيها
،الأسماء الشائعة مثل monotremes
بدلاً من أسمائها العلمية
.مثل monotremata
لذلك، فمن المحتمل أن تحتاج إلى استخدام كلا
الجدولين، جدول taxonomy
وorder names، بالإضافة إلى جدول
.الحيوانات مع الحيوانات الفردية الموجودة به
وبالتالي، تكمن المشكلة في إدراج الرتب
،التصنيفية حسب أسمائها الشائعة
وفرزها تبعًا لعدد الحيوانات الفردية
.الموجودة في كل رتبة في حديقة الحيوان
،لترى المخططات الكاملة للجداول
.قم بإلقاء نظرة على ملاحظات المدرب
OK, aqui estão outras duas
tabelas do banco de dados de zoológico.
A primeira, taxonomia,
informa os nomes científicos da
espécie de todos os nossos animais.
Estamos usando os nomes comuns
como urso pardo em nossas outras tabelas.
Esta tabela não fornece o nome taxonômico completo,
mas grande parte dele.
O urso pardo é genus Ursus.
Espécie arctos.
E a família é Ursidae.
E a ordem Carnivora.
Temos que chamar essa coluna de
t_order em vez de order,
pois order é uma palavra reservada
em SQL para order by.
O t significa taxonomia.
E se observarmos esta tabela aqui,
veremos os nomes comuns para
todas as ordens.
Os morcegos pertencem à ordem Chiroptera,
os lagartos e
as cobras pertencem à ordem Squamata.
E as lhamas, os alces e os javalis
pertencem à ordem Artiodactyla.
OK, OK, então
realmente essas tabelas estão aqui apenas
para proporcionar mais coisas para unir.
Grande surpresa.
Dessa vez queremos descobrir quais
ordens têm mais animais individuais
no zoológico e queremos dar a eles
seus nomes comuns como monotremados,
em vez dos nomes científicos
como monotremata.
Provavelmente você precisará usar ambas as
tabelas, a taxonomia e
a nomes de ordem, mais a tabela animais
com os animais individuais nela.
O problema é listar as ordens taxonômicas
por seus nomes comuns,
classificados por quantos animais individuais
temos de cada ordem no zoológico.
Para ver os esquemas completos das tabelas,
consulte as notas do instrutor.
这是动物园数据库中另外的两个表格
第一个是分类学表格 其中
给出了全部动物物种的学名
我们在其它表格中使用的是常用名 例如棕熊
这个表格没有列出全部分类学名称 但包括了大部分
棕熊是熊属
棕熊种
熊科
食肉目
我们称该列为 t_order 而不是 order
因为 order 在 SQL 中是个保留词 用于 order by 语句
t 指分类学
如果我们在这个表格中进行查询 会看到所有目类的
通用名
蝙蝠属于翼手目 而蜥蜴和蛇
属于有鳞目
大羊驼、驼鹿和疣猪则属于偶蹄目
好的 那么
这些表格为你提供了可用于连接的更多材料
这非常令人惊喜
这次我们希望找出动物园里哪些目类
拥有的动物数量最多 我们希望使用通用名
而不是学名 比如用 monotremes 而不是 monotremata
因此你可能需要用到这两个表格 分类学和
目类名称表格 以及包含全部动物在内的动物表格
那么问题就是 使用通用名列出分类学下的各目
按照动物园中每个目下有多少动物进行分类
要想了解完整的表格结构描述 请查阅讲师注释