DMBS - Questions

  1. What is primary key and foreign key?
  2. What all relationships we use in DBMS?
  1. A primary key generally focuses on the uniqueness of the table. It assures the value in the specific column is unique. A foreign key is generally used to build a relationship between the two tables.

  2. There are 3 different types of relations in the database: one-to-one . one-to-many, and . many-to-many .

1 Like
  1. Primary key is used to uniquely identify a row
    foreign key is a column or group of columns in a relational database
    2.one-to-one, one-to-many, and many-to-many
1 Like

1.Primary key is used to uniquely identify a row,and
Foreign key is used to connect two tables or maintain the relationship between them.

  1. One to One, One to Many, and Many to one.
1 Like

1A. PRIMARY KEY constraint uniquely identifies each record in a table.A table can have only ONE primary key.
FOREIGN KEY constraint is used to prevent actions that would destroy links between tables.
2A. There are three different types of relations in database
i.one-to-one
ii.one-to-many
iii.many-to-one

1 Like

1]primary key used to uniquely identify row in the database,
foreign key is uesd to prevent action that would destroy link between tables
2]1 1 to 1
2 1 to many
3 many to 1

1 Like

primary key is unique to a table, it can be used as a foreign key to another table

one to one, one to many, many to one

1 Like
  1. Primiary key is used to uniquely identify a row
  2. one to many and many to one
1 Like

pk is the main key to work with another table as a connector.
fk IS ONE TABLE POINTS TO A pk in another table.

ans 2] one to one, one to many, many to one and many to many

1 Like