Arora Educator
Topic : Database
BY- SACHIN ARORA SIR
Arora Educator
Database Keys
Arora Educator
BY- SACHIN ARORA SIR
Database Keys Arora Educator
1. Super Key = Many Attributes
2. Candidate Key = One Attribute (Part of Super Key)
3. Primary key = Unique/Not Null/Not Repeat
4. Composite Key = Combination of PK
5. Foreign Key = 2 Table
Arora Educator
BY- SACHIN ARORA SIR
Database Keys
1. Super key
✓ A super key is a group of single
or multiple keys which
identifies rows in a table.
✓ The super key would be Arora Educator
EMPLOYEE-ID, (EMPLOYEE_ID,
EMPLOYEE-NAME), etc.
Arora Educator
BY- SACHIN ARORA SIR
Database Keys Arora Educator
2. Candidate key
✓ Candidate key can be a
single column or
combination of more
than one column.
Arora Educator
BY- SACHIN ARORA SIR
Database Keys Arora Educator
3. Primary key
✓ The Primary Key can't be a duplicate.
✓ A table cannot have more than one primary key.
✓ The primary key field cannot be null.
Arora Educator
BY- SACHIN ARORA SIR
Database Keys Arora Educator
4. Composite Key
✓ When there is no primary key = Join attributes and
create a primary key.
✓ Or..Collection of primary key.
✓ ATM Card + PIN
✓ Username + OTP om mobile
Arora Educator
BY- SACHIN ARORA SIR
Arora Educator
Database Keys
5. Foreign key
✓ Foreign keys are the column of
the table which is used to point to
the primary key of another table.
✓ in the EMPLOYEE table,
Department_Id is the foreign key,
and both the tables are related.
Arora Educator
BY- SACHIN ARORA SIR
Q.40. Which statement is wrong about PRIMARY KEY
constraint in SQL? Arora Educator
1) The PRIMARY KEY uniquely identifies each record in
a SQL database table
2) Primary key can be made based on multiple
columns
3) Primary key must be made of any single columns
4) Primary keys must contain UNIQUE values.
5) All of these Arora Educator
Q.41. Which is/are correct statements about primary
key of a table? Arora Educator
1) Primary keys can contain NULL values
2) Primary keys cannot contain NULL values.
3) A table can have only one primary key with single or
multiple fields
4) A table can have multiple primary keys with single
or multiple fields
5) 2&3 Arora Educator
Q.42 What is the difference between a PRIMARY KEY
and a UNIQUE KEY? Arora Educator
1) Primary key can store null value, whereas a unique
key cannot store null value.
2) We can have only one primary key in a table while
we can have multiple unique keys
3) Primary key cannot be a date variable whereas
unique key can be Arora Educator
4) None of these
5) All of these
Arora Educator
Arora Educator
Arora Educator
Arora Educator
Q.43. Which of the following are the synonyms for
Column and ROW of a table? Arora Educator
1) Row = [Tuple, Record]
2) Column = [Field, Attribute]
3) Row = [Tuple, Attribute]
4) Columns = [Field, Record]
1) 1 and 2 Arora Educator
2) 3 and 4
3) Only 1
4) Only 2
Q.44. Which one of the following attribute can be
taken as a primary key? Arora Educator
1) Name
2) Street
3) Id
4) Department
5) All of these
Arora Educator
Q.45. Consider attributes ID , CITY and NAME . Which
one of this can be considered as a super key?
Arora Educator
1) NAME
2) ID
3) CITY
4) CITY , ID
5) All of these
Arora Educator
Q.46. This identifies rows in a table? Arora Educator
1) Candidate key
2) Sub key
3) Super key
4) Foreign key
5) All of these
Arora Educator
Q.47. A attribute in a relation is a foreign key if the
_______ key from one relation is used as an attribute in
that relation . ? Arora Educator
1) Candidate
2) Primary
3) Super
4) Sub
5) All of these
Arora Educator
Q.48. Which one of the following cannot be taken as a
primary key. ? Arora Educator
1) Id
2) Register number
3) Dept_id
4) Street
5) None of these
Arora Educator
Q.49. It is the columns of a table that points to the
candidate key of another table. ? Arora Educator
1) Primary Key
2) Super key
3) Candidate Key
4) Foreign key
5) All of these
Arora Educator
Q.50. Which of the following describes the primary key
_____. ? Arora Educator
1) It must be unique
2) It helps in indexing of a large database
3) It makes sorting quicker
4) All of these
5) None of these
Arora Educator
Q.51. Which of the following is NOT a good primary key
_____? Arora Educator
1) Social security number
2) Order number
3) Zip code
4) Student ID number
5) All of these
Arora Educator
Q.52. How many primary keys can a table have _____?
Arora Educator
1) One
2) At least one, but not more than two
3) Between 1 and 5
4) No limit
5) None of these
Arora Educator
Q.53. The columns of a table correspond to?
Arora Educator
1) Table
2) Record
3) Field
4) Cell
5) All of these
Arora Educator
Q.54. The foreign key is found in? Arora Educator
1) Parent table
2) Dependent table
3) Pivot table
4) Index table
5) All of these
Arora Educator
Q.55. A two-dimensional table of data Arora Educator
is called a _____?
1) Group Arora Educator
2) Set
3) Declaration
4) Relation
5) All of these