Content
Classified in Computers
Written at on English with a size of 5.21 KB.
Primary Key : A Primary Key is the minimal set of attributes of a table that has the task to uniquely identify the rows, or we can say the tuples of the given particular table.It is the first key which is used to identify one and only one instance of an entity uniquely. An entity can contain multiple keys as we saw in PERSON table. The key which is most suitable from those lists become a primary key. In the EMPLOYEE table, ID can be primary key since it is unique for each employee. In the EMPLOYEE table, we can even select License_Number and Passport_Number as primary key since they are also unique.For each entity, selection of the primary key is based on requirement and developers.
Foreign key :A foreign key is different from a super key, candidate key or primary key because a foreign key is the one that is used to link two tables together or create connectivity between the two.Here, in this section, we will discuss foreign key, its use and look at some examples that will help us to understand the working and use of the foreign key. We will also see its practical implementation on a database, i.E., creating and deleting a foreign key on a table.A foreign key is the one that is used to link two tables together via the primary key. It means the columns of one table points to the primary key attribute of the other table. It further means that if any attribute is set as a primary key attribute will work in another table as a foreign key attribute. But one should know that a foreign key has nothing to do with the primary key.
Attributes and it's types: Attributes are the properties which describe an entity.In relational databases, we have tables, and each column contains some entity that has some attributes, so all the entries for that column should strictly follow the attribute of the entity. Entities define the characteristic property of the attributes.
Types of Attribute : 1) Composite Attribute :It can be divided into smaller sub parts, each sub part can form an independent attribute. 2) Simple Or Automic Attribute : Attributes that cannot be further subdivided are called atomic attributes. 3) Single valued Attribute : Attributes having a single value for a particular item is called a single valued attribute.4) Multi valued Attribute : Attribute having a set of values for a single entity is called a multi-valued attribute.5)Derived Attribute : When one attribute value is derived from the other is called a derived attribute.6)Complex Attribute : Nesting of composite and multi-valued attributes forms a complex attribute.
Difference between File processing and DBMS .
1)DBMS is a collection of data. In DBMS, the user is not required to write the procedures. File system is a collection of data. In this system, the user has to write the procedures for managing the database.2)DBMS gives an abstract view of data that hides the details.File system provides the detail of the data representation and storage of data.3)DBMS provides a good protection mechanism.File System is very difficult to protect a file under the file system.4)DBMS contains a wide variety of sophisticated techniques to store and retrieve the data.File system can't efficiently store and retrieve the data.5) DBMS provides a crash recovery mechanism, i.E., DBMS protects the user from the system failure.File system doesn't have a crash mechanism, i.E., if the system crashes while entering some data, then the content of the file will lost.
Dif