11
Identifiers ها ه س ا ن ش: ه عادل ل ل ا ت م ص ع ده ن ن ک ه ی ه ت

Identifiers in database

Embed Size (px)

Citation preview

Page 1: Identifiers in database

Identifiers

ها شناسه

: عادل الله عصمت کننده تهیه

Page 2: Identifiers in database

01:09 AM Gharjistan University Computer Science Faculty Farah Branch

2

Topics:

• Identifier• Types of identifier

شناسه•شناسه • اقسام

Page 3: Identifiers in database

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.

ترکیب • یا و خاصه صفت یکفقط که خاصه های صفت از

موجودیت نمونه یک فقط ویاد شناسه بنام کند تعریف را

میشود.

Page 4: Identifiers in database

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. کلید

Page 5: Identifiers in database

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.

•: کاندید کلیدتوانایی • که خاصه صفت یک

. باشد داشته را شدن کلیدهای نیازمندی تمام یعنی

. و کند پوره را شدن شناسهصفت یک از بیش وقتیکه یا

فقط و فقط که بتواند خاصهرا موجودیت نمونه یک

از یکی پسهر کند تعریفیاد کاندید کلید بنام آنها

میشود.

Page 6: Identifiers in database

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.

ترکیب • یا و خاصه صفت یکو فقط که خاصه صفت از

جدول در را سطر یک فقطاصلی کلید بنام کند تعریف

. میشود یادزیرین • خط نوشتن توسط و

. میشود معین

Page 7: Identifiers in database

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.

از • بیش دارای که اصلی کلیدبنام باشد خاصه صفت یک

. میشود یاد مرکب کلیدمیشود • استفاده وقتی

که نباشد این امکان زمانیکهفقط خاصه صفت یک توسطجدول در را سطر یک فقط و

. کنیم معرفییا • و دو ما اصلی کلید در

را خاصه صفت دو از بیشترفقط و فقط تا میکنیم ترکیب

جدول در را سطر یک. کنیم معرفی

Page 8: Identifiers in database

Nangarhar Univeristy Computer Science 8

Alternate key:

• Candidate keys which are not chosen as the primary key are known as alternate keys.

کلید • منحیث ایکه کاندید کلیدباشد نشده انتخاب اصلی. میشود یاد دیگر کلید بنام

Candidate key

Page 9: Identifiers in database

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.

یک • در خاصه صفت یکمنحیث دیتابیسکه جدول

در دیگر جدول یک اصلی کلیدوظیفه ایفاء دیتابیس همینیاد خارجی کلید بنام میکند

میشود.ما • زمانیکه معنا این به

با را جدول یک که میخواهیمپس دهیم ربط دیگر جدولدر را جدول یک اصلی کلید

کلید منحیث دیگر جدول. میدهیم قرار خارجی

Page 10: Identifiers in database

Nangarhar Univeristy Computer Science 10

Foreign key…

Page 11: Identifiers in database

01:09 AM Gharjistan University Computer Science Faculty Farah Branch

11