Informatics Practices
An organization wants to create a table EMPLOYEE, DEPENDENT to maintain the following details about its employees and their dependents.
EMPLOYEE (EmployeeID, AadhaarNumber, Name, Address, Department)
DEPENDENT (EmployeeId, DependentName, Relationship).
There are 10 records each in both tables.
(i) Name the attributes of the Employee, which can be used as candidate keys.
(ii) What is the degree of the Employee Table?
(iii) What is the Cardinality of a Dependent Table?
(iv) Which is the Primary key of Dependent Table?
Answer
(i) In the EMPLOYEE table, the attributes AadhaarNumber and EmployeeID can be used as candidate keys. This means that either AadhaarNumber or EmployeeID can uniquely identify each record in the EMPLOYEE table.
(ii) In the EMPLOYEE relation, there are five attributes, resulting in a degree of 5.
(iii) The cardinality of a table is the number of rows (records) it contains. The DEPENDENT table has 10 records. Hence, the cardinality of the DEPENDENT table is 10.
(iv) For the DEPENDENT table, the combination of EmployeeID and DependentName can be used as the primary key because each dependent is uniquely associated with an employee.
Related Questions
Write a program in Python to input elements in an empty list. Also delete an element from the list which a user will input.
Consider the following list.
emp=["Aditya", 40000, "Deepak",50000, "Yashmit", 60000, "Bhavya", 80000](i) To Insert the value "Ramit" at index number 4.
(ii) To check whether element 50000 is present in the list or not.
(iii) To display the first 3 elements from the list.
(iv) To remove the fifth element from the list.
Find out the errors in the following code snippet and rewrite the code by underlining the corrections made.
30=y for i in range (2, 6) print (true) else: print ("Loop over")Consider the following dictionary and write the answers of the following:
DAYS={"day1": "Sunday", "day2": "Monday", "day3":"Tuesday", 'day5':" Thursday"}(a) Add 'Wednesday' to the dictionary DAYS as a key 'day4'.
(b) Remove 'day5' item from the dictionary.
(c) Given the Dictionary metal, what is the output generated by the following code:
metal={"first":"gold", "second":"silver", "first":"copper"} print(metal)