Found 85 Articles for RDBMS

Sixth Normal Form (6NF)

Amit Diwan
Updated on 15-Jun-2020 14:18:09

4K+ Views

In 6NF, the relation variable is decomposed into irreducible components. A relation is in 6NF, only if, It is in 5NF, and every join dependency on the relation is trivialLet us see an example −Enrollment_NoNameMarksThe possible join dependencies for the above would be −{Enrollment_No, Marks}{Enrollment_No, Name}In Sixth Normal Form (6NF), it would be decomposed to −Enrollment_NoNameEnrollment_No MarksLet us see another example −Student_IDStudent_FirstNameStudent_LastNameMarksS01TomAlter90S02JacobWatson80S03HarrySmith85Let us decompose the table −Student_IDStudent_FirstNameS01TomS02JacobS03HarryStudent_IDStudent_LastNameS01AlterS02WatsonS03SmithStudent_IDMarksS0190S0280                     S03                   85Now the above tables are in 6NF, but as you can guess on your know that ... Read More

Unique Key in RDBMS

Alex Onsman
Updated on 15-Jun-2020 14:19:07

674 Views

Many users consider Primary Key as Unique Key, since both uniquely identify a table, but Unique Key is different from Primary Key. Unique Key accepts null values and Primary Key cannot have null.Let us compare Primary Key and Unique Key and understand its concept −UsageA Unique Key is used to prevent duplicate values in a column. Primary Key provided uniqueness to a table.NULL ValuesA primary key cannot accept NULL values; this makes Primary Key different from Unique Key, since Unique Key allows one value as NULL value.VolumeA table can only have a single Primary Key, whereas a Unique Key can ... Read More

RDBMS terminologies

Amit Diwan
Updated on 15-Jun-2020 14:23:10

8K+ Views

RDMS Terminologies include Database, Table, Columns, etc. Let us see them one by one −DatabaseDatabase is a collection of tables like , , etc.TableA table is a collection of rows and columns , for example, StudentIdStudentNameStudentRank052Tom1035David2077John3ColumnColumn is in a table −RowRow is also called a tuple in RDBMS. A relation in a database has rows and columns.Primary KeyEvery table has one Primary key and cannot have null values.For example, ProjectID is a primary key in Project Table, since it uniquely identifies the project:ProjectIDProjectNameP01Cluster Grouping SystemP02Hospital Management SystemForeign KeyIf you want to link two tables, use Foreign Key.For example, Employee table has DEPT_ID ... Read More

Foreign Key in RDBMS

Ricky Barnes
Updated on 15-Jun-2020 13:40:33

3K+ Views

A Foreign Key creates a link between tables. It references the primary key in another table and links it.For example, the DeptID in the Employee table is a foreign key −EmpIDEmpNameEmpAgeDeptIDDeptIDDeptNameDeptZoneThe DeptID in the Department table is a Primary Key in the Department Table.The DeptID in the Employee table is a Foreign Key in the Employee Table.The below figure represents the same −Above, you can see our two tables. The Foreign Key of the Employee table is the Primary Key of the Department table.

Alternate Key in RDBMS

Amit Diwan
Updated on 15-Jun-2020 14:21:14

4K+ Views

Alternate Key or Secondary Key is the key that has not been selected to be the primary key, but are candidate keys. However, it is considered a candidate key for the primary key.A candidate key not selected as a primary key is called alternate or secondary key. Candidate key is an attribute or set of attributes that you can consider as a Primary key.Let us see an example −Student_IDStudent_EnrollStudent_NameStudent_Email0962717Manishaaa@gmail.com0552655Mananabc@gmail.com0672699Shreyaspqr@gmail.comAbove, Student_ID, Student_Enroll and Student_Email are the candidate keys. They are considered candidate keys since they can uniquely identify the student record. Select any one of the candidate key as the primary. Rest ... Read More

Candidate Key in RDBMS

Ricky Barnes
Updated on 15-Jun-2020 13:38:01

1K+ Views

Each table has only a single primary key. Each relation may have one or more candidate key. One of these candidate key is called Primary Key. Each candidate key qualifies for Primary Key. Therefore candidates for Primary Key is called Candidate Key.Candidate key can be a single column or combination of more than one column. A minimal super key is called a candidate key.ExampleEmployeeID and EmployeeEmail, both can be a Primary key; therefore both are candidate keys. Select any of the as Primary Key for your table, since a table can have only a single Primary Key.Let us see another example ... Read More

Surrogate Key in RDBMS

Ricky Barnes
Updated on 15-Jun-2020 13:48:52

821 Views

A Surrogate Key’s only purpose is to be a unique identifier in a database, for example, incremental key, GUID, etc. It hasSurrogate Key has no actual meaning and is used to represent existence. It has an existence only for data analysis.ExampleKeyProductIDPrice505_921987200698_561256170304_571898250458_661666110Above, the surrogate key is Key in the table.Other ExamplesSome other examples of a Surrogate Key −Counter can also be shown as Surrogate Key.System date/time stampRandom alphanumeric string.

Super Key in RDBMS

Ricky Barnes
Updated on 15-Jun-2020 13:46:26

2K+ Views

Super Key is an attribute (or a set of attributes) that uniquely identify a tuple i.e. an entity in entity set.It is a superset of Candidate Key, since Candidate Keys are selected from super key.ExampleLet us see an example −Student_IDStudent_EnrollStudent_NameStudent_EmailS024545Daveddd@gmail.comS344541Jackjjj@gmail.comS224555Markmmm@gmail.comThe following are the super keys for the above table −{Student_ID}{Student_Enroll}{Student_Email}{Student_ID, Student_Enroll}{Studet_ID, Student_Name}{Student_ID, Student_Email}{Student_Name, Student_Enroll}{Student_ID, Student_Enroll, Student_Name}{Student_ID, Student_Enroll, Student_Email}{Student_ID, Student_Enroll, Student_Name, Student_Email}The following would be the candidate key from the above −{Student_ID}{Student_Enroll}{Student_Email}Read More

Entity Integrity Rule in RDBMS

Alex Onsman
Updated on 15-Jun-2020 13:22:51

5K+ Views

For Entity Integrity Rule, each table has a Primary Key.Primary Key cannot have NULL value.Student_IDStudent_AwardsStudent_AwardsAbove, you can see our primary key is Student_ID. We cannot consider Student_Awards as the primary key since not every student would have received the award.Let us see another example −Employee_IDEmployee_NameEmployee_AgeEmployee_LocationIn the above table, the Primary Key is Employee_IDLet us now summarize the Entity Integrity Rule −Make sure that each tuple in a table is unique.Every table mush has a primary key, for example, Student_ID for a Student table.Every entity is unique.The relations Primary Key must have unique values for each row.Primary Key cannot have NULL ... Read More

Secondary Key in RDBMS

Amit Diwan
Updated on 15-Jun-2020 13:35:00

6K+ Views

What is a Secondary KeySecondary Key is the key that has not been selected to be the primary key. However, it is considered a candidate key for the primary key.Therefore, a candidate key not selected as a primary key is called secondary key. Candidate key is an attribute or set of attributes that you can consider as a Primary key.Note: Secondary Key is not a Foreign Key.ExampleLet us see an example −Student_IDStudent_EnrollStudent_NameStudent_AgeStudent_Email0969122717Manish25aaa@gmail.com0559122655Manan23abc@gmail.com0679122699Shreyas28pqr@gmail.comAbove, Student_ID, Student_Enroll and Student_Email are the candidate keys. They are considered candidate keys since they can uniquely identify the student record. Select any one of the candidate key as ... Read More

Advertisements