Upload
esmatullah-adel
View
44
Download
0
Embed Size (px)
Citation preview
Identifiers
ها شناسه
: عادل الله عصمت کننده تهیه
01:09 AM Gharjistan University Computer Science Faculty Farah Branch
2
Topics:
• Identifier• Types of identifier
شناسه•شناسه • اقسام
01:09 AM Gharjistan University Computer Science Faculty Farah Branch
3
Identifiers (keys):
• An attribute (or combination of attributes) that uniquely identifies individual instances of an entity type is called identifier.
ترکیب • یا و خاصه صفت یکفقط که خاصه های صفت از
موجودیت نمونه یک فقط ویاد شناسه بنام کند تعریف را
میشود.
01:09 AM Gharjistan University Computer Science Faculty Farah Branch
4
Types of identifiers:
• There are five types of identifiers:
1. Candidate key2. Primary key3. Composite key4. Alternate key5. Foreign key
•: دارد وجود شناسه قسم پنج
کاندید 1. کلید
اصلی 2. کلید
مرکب 3. کلید
دیگر 4. کلید
خارجی 5. کلید
01:09 AM Gharjistan University Computer Science Faculty Farah Branch
5
Types of identifiers…
• Candidate key:• An attribute that could be a
key…satisfies the requirements for being an identifier. Or when more than one attributes can uniquely identifies individual instance of an entity type then each of them is called candidate key.
•: کاندید کلیدتوانایی • که خاصه صفت یک
. باشد داشته را شدن کلیدهای نیازمندی تمام یعنی
. و کند پوره را شدن شناسهصفت یک از بیش وقتیکه یا
فقط و فقط که بتواند خاصهرا موجودیت نمونه یک
از یکی پسهر کند تعریفیاد کاندید کلید بنام آنها
میشود.
Nangarhar Univeristy Computer Science 6
Primary key:
• An attribute or combination of attributes that uniquely identifies each row in a relation is called primary key.
• It is designate by underlining it.
ترکیب • یا و خاصه صفت یکو فقط که خاصه صفت از
جدول در را سطر یک فقطاصلی کلید بنام کند تعریف
. میشود یادزیرین • خط نوشتن توسط و
. میشود معین
Nangarhar Univeristy Computer Science 7
Composite key:
• A primary key that consists of more than one attribute is called composite key.
• It is used when there is no chance to uniquely identify an instance with single attribute.
• In this we combine two or more than two attributes to uniquely identify an instance.
از • بیش دارای که اصلی کلیدبنام باشد خاصه صفت یک
. میشود یاد مرکب کلیدمیشود • استفاده وقتی
که نباشد این امکان زمانیکهفقط خاصه صفت یک توسطجدول در را سطر یک فقط و
. کنیم معرفییا • و دو ما اصلی کلید در
را خاصه صفت دو از بیشترفقط و فقط تا میکنیم ترکیب
جدول در را سطر یک. کنیم معرفی
Nangarhar Univeristy Computer Science 8
Alternate key:
• Candidate keys which are not chosen as the primary key are known as alternate keys.
کلید • منحیث ایکه کاندید کلیدباشد نشده انتخاب اصلی. میشود یاد دیگر کلید بنام
Candidate key
Nangarhar Univeristy Computer Science 9
Foreign key:
• An attribute in a relation of a database that serves as the primary key of another relation in the same data base.
• Mean that when we want to relate one relation with other ,we put the primary key of one table in other.
یک • در خاصه صفت یکمنحیث دیتابیسکه جدول
در دیگر جدول یک اصلی کلیدوظیفه ایفاء دیتابیس همینیاد خارجی کلید بنام میکند
میشود.ما • زمانیکه معنا این به
با را جدول یک که میخواهیمپس دهیم ربط دیگر جدولدر را جدول یک اصلی کلید
کلید منحیث دیگر جدول. میدهیم قرار خارجی
Nangarhar Univeristy Computer Science 10
Foreign key…
01:09 AM Gharjistan University Computer Science Faculty Farah Branch
11