1. Home
  2. Explore
  3. Computer Science
  4. Foreign Keys and Referential Integrity

Study methods

Flashcards
Quiz
Fill in the blanks
Written test
Lesson
Notes
Podcast
Content

Foreign Keys and Referential Integrity

  • 58Unfamiliar
  • 0Learning
  • 0Familiar
  • 0Mastered
Topic: Integrity and Schema

What is a foreign key in a relational database?

58 questions

  1. 1

    What is a foreign key in a relational database?

    1. A

      A derived value used to calculate attributes in another relation

    2. B

      A single attribute used to sort tuples within a relation

    3. C

      A group of attributes used to guarantee uniqueness within one relation

    4. D

      A group of attributes used to refer to tuples in another relation

    Correct answer
    D

    A group of attributes used to refer to tuples in another relation

    Explanation

    A foreign key is an attribute or group of attributes used to refer to tuples in another relation.

  2. 2

    What does a referential integrity constraint prevent?

    1. A

      Attributes from having values of different data types

    2. B

      References from pointing to nonexistent tuples

    3. C

      Relations from containing more than one candidate key

    4. D

      Tuples from containing null values in every column

    Correct answer
    B

    References from pointing to nonexistent tuples

    Explanation

    Referential integrity requires a reference to point to an existing tuple rather than becoming a dangling reference.

  3. 3

    How are keys conventionally represented in a relational schema?

    1. A

      The key attributes are placed in parentheses

    2. B

      The key attributes are written in boldface

    3. C

      The key attributes are written in lowercase

    4. D

      The key attributes are underlined

    Correct answer
    D

    The key attributes are underlined

    Explanation

    Underlining an attribute or group of attributes in a relational schema indicates that it is a key.

  4. 4

    Why is roll number a key for the Student relation?

    1. A

      It uniquely identifies each student tuple

    2. B

      It identifies the department offering a course

    3. C

      It identifies the degree program of a student

    4. D

      It identifies the professor advising a student

    Correct answer
    A

    It uniquely identifies each student tuple

    Explanation

    The value of roll number can be used to uniquely identify a particular row or tuple in the Student relation.

  5. 5

    What does the advisor attribute in the Student relation represent?

    1. A

      The department ID of the student's academic department

    2. B

      The course ID of the student's current course

    3. C

      The employee ID of the student's faculty advisor

    4. D

      The roll number of the student's department head

    Correct answer
    C

    The employee ID of the student's faculty advisor

    Explanation

    Advisor stores the employee ID of the faculty member identified as the student's advisor.

  6. 6

    What is required of the advisor value for a student in the example database?

    1. A

      It must identify the student's degree string

    2. B

      It must identify the student's department name

    3. C

      It must identify a faculty member's employee ID

    4. D

      It must identify the student's current course ID

    Correct answer
    C

    It must identify a faculty member's employee ID

    Explanation

    All students are required to have an advisor, and the advisor value comes from the employee ID domain of faculty members.

  7. 7

    If more information about a student's advisor is needed, what should be done?

    1. A

      Use the student's roll number as the advisor identifier

    2. B

      Search for the advisor's name in the enrollment relation

    3. C

      Look up the advisor in the appropriate related relation

    4. D

      Infer the information from the student's degree value

    Correct answer
    C

    Look up the advisor in the appropriate related relation

    Explanation

    The advisor attribute identifies the faculty member, while additional details must be obtained from the appropriate relation, such as Professor.

  8. 8

    Which attribute identifies a department in the Department relation?

    1. A

      Department ID

    2. B

      Department name

    3. C

      Department HOD

    4. D

      Department phone

    Correct answer
    A

    Department ID

    Explanation

    Department ID is used as the key to identify departments, even though the name could also serve as a key in the example.

  9. 9

    What does the HOD attribute in the Department relation identify?

    1. A

      The numerical identifier assigned to the department

    2. B

      The degree program offered by the department

    3. C

      The faculty member responsible for heading the department

    4. D

      The office phone number assigned to the department

    Correct answer
    C

    The faculty member responsible for heading the department

    Explanation

    HOD identifies the faculty member who is academically responsible for running the department.

  10. 10

    Which attribute serves as the key for the Professor relation?

    1. A

      Employee ID

    2. B

      Department number

    3. C

      Professor name

    4. D

      Start year

    Correct answer
    A

    Employee ID

    Explanation

    Employee ID identifies professors in the Professor relation.

  11. 11

    What does start year represent in the Professor relation?

    1. A

      The year the faculty member completed a degree

    2. B

      The year the faculty member became a department head

    3. C

      The year the faculty member joined the department

    4. D

      The year the faculty member first taught a course

    Correct answer
    C

    The year the faculty member joined the department

    Explanation

    Start year records the year in which the faculty member joined the particular department.

  12. 12

    What does the department number in the Professor relation indicate?

    1. A

      The department in which the professor is employed

    2. B

      The number of courses taught by the professor's department

    3. C

      The department in which the professor earned a degree

    4. D

      The order in which the professor joined the institute

    Correct answer
    A

    The department in which the professor is employed

    Explanation

    All faculty members work in departments, and this attribute identifies the professor's department.

  13. 13

    Which attribute acts as the key for the Course relation?

    1. A

      Course ID

    2. B

      Course name

    3. C

      Department number

    4. D

      Credits

    Correct answer
    A

    Course ID

    Explanation

    Course ID is used to identify courses and serves as the key for the Course relation.

  14. 14

    What does the credits attribute of a course indicate?

    1. A

      The number of students permitted to enroll in the course

    2. B

      The number of professors assigned to teach the course

    3. C

      The number of semesters required to teach the course

    4. D

      The number of credits earned upon completing the course

    Correct answer
    D

    The number of credits earned upon completing the course

    Explanation

    Credits records the number of credits earned when the course is completed.

  15. 15

    What does the department number in the Course relation identify?

    1. A

      The department that offers the course

    2. B

      The department that created the course prerequisite

    3. C

      The department in which every student must enroll

    4. D

      The department that employs every course instructor

    Correct answer
    A

    The department that offers the course

    Explanation

    The department number indicates which department offers the course.

  16. 16

    Why does the Enrollment relation require a composite key containing roll number, course ID, semester, and year?

    1. A

      A student may take several courses and a course may recur across offerings

    2. B

      Each student can have only one course and one grade overall

    3. C

      Each course ID independently identifies every enrollment tuple

    4. D

      Semester and year identify students independently of their courses

    Correct answer
    A

    A student may take several courses and a course may recur across offerings

    Explanation

    A student can take several courses, and the same course can be offered in different semesters and years, so all four attributes are needed to identify an enrollment.

  17. 17

    What values can the semester attribute take in the example database?

    1. A

      Odd for January and even for August

    2. B

      Summer for August and winter for January

    3. C

      Fall for August and spring for January

    4. D

      Odd for August and even for January

    Correct answer
    D

    Odd for August and even for January

    Explanation

    The example uses odd for the August semester and even for the January semester.

  18. 18

    What value does grade have for an enrollment in the current semester?

    1. A

      The student's previous grade

    2. B

      Null

    3. C

      The course's credit value

    4. D

      Zero

    Correct answer
    B

    Null

    Explanation

    The grade is null during the current semester and receives an appropriate value after the semester ends.

  19. 19

    What information does the Enrollment relation capture?

    1. A

      Departments offering courses and assigning phone numbers

    2. B

      Courses requiring prerequisites and changing names

    3. C

      Professors joining departments and receiving salaries

    4. D

      Students taking courses and receiving grades

    Correct answer
    D

    Students taking courses and receiving grades

    Explanation

    Enrollment records how students enroll in courses and the grades associated with those enrollments.

  20. 20

    What does a tuple in the Teaching relation represent?

    1. A

      A professor teaching a course in a particular semester and year

    2. B

      A department offering a degree in a particular semester and year

    3. C

      A course requiring another course in a particular semester and year

    4. D

      A student completing a course in a particular semester and year

    Correct answer
    A

    A professor teaching a course in a particular semester and year

    Explanation

    Teaching records which employee teaches which course in a specified semester and year, along with the classroom information.

  21. 21

    Why are all the attributes of a Teaching tuple needed for its key in the example?

    1. A

      Every professor teaches exactly one course during employment

    2. B

      No proper subset uniquely identifies a course-teaching assignment

    3. C

      Semester and year alone identify every teaching assignment

    4. D

      Every course is taught by exactly one professor in all years

    Correct answer
    B

    No proper subset uniquely identifies a course-teaching assignment

    Explanation

    An employee can teach several courses, a course can have several professors, and offerings recur by semester and year, so no subset is sufficient.

  22. 22

    If a tuple (C1,C2)(C_1,C_2)(C1​,C2​) appears in the Prerequisite relation, what does it mean?

    1. A

      C2C_2C2​ must be successfully completed before enrolling in C1C_1C1​

    2. B

      C1C_1C1​ and C2C_2C2​ must be taught by the same professor

    3. C

      C1C_1C1​ must be successfully completed before enrolling in C2C_2C2​

    4. D

      C1C_1C1​ and C2C_2C2​ must be taken during the same semester

    Correct answer
    C

    C1C_1C1​ must be successfully completed before enrolling in C2C_2C2​

    Explanation

    The first course, C1C_1C1​, is the prerequisite for the second course, C2C_2C2​.

  23. 23

    In the example, what relationship does a Data Structures course have to a Database Systems course?

    1. A

      The two courses are alternative names for one course

    2. B

      The two courses must always be taken in the same semester

    3. C

      Database Systems is a prerequisite for Data Structures

    4. D

      Data Structures is a prerequisite for Database Systems

    Correct answer
    D

    Data Structures is a prerequisite for Database Systems

    Explanation

    The example states that Data Structures should be completed before taking Database Systems.

  24. 24

    Which attribute is a foreign key in the Department relation?

    1. A

      HOD, referencing Professor employee ID

    2. B

      Name, referencing Student roll number

    3. C

      Phone, referencing Course ID

    4. D

      Department ID, referencing Enrollment grade

    Correct answer
    A

    HOD, referencing Professor employee ID

    Explanation

    The HOD attribute stores a professor's employee ID and therefore references the Professor relation.

  25. 25

    Which foreign-key relationship is represented by Student.department number?

    1. A

      It references Department.department ID

    2. B

      It references Course.course ID

    3. C

      It references Student.roll number

    4. D

      It references Professor.employee ID

    Correct answer
    A

    It references Department.department ID

    Explanation

    Student.department number links each student to the corresponding department ID.

  26. 26

    Which foreign-key relationship is represented by Professor.department number?

    1. A

      It references Professor.employee ID

    2. B

      It references Course.course ID

    3. C

      It references Department.department ID

    4. D

      It references Student.roll number

    Correct answer
    C

    It references Department.department ID

    Explanation

    The department number in Professor references the department ID of the Department relation.

  27. 27

    Which foreign-key relationship is represented by Student.advisor?

    1. A

      It references Enrollment.roll number

    2. B

      It references Professor.employee ID

    3. C

      It references Course.course ID

    4. D

      It references Department.department ID

    Correct answer
    B

    It references Professor.employee ID

    Explanation

    Advisor stores a faculty member's employee ID and references the Professor relation.

  28. 28

    Which foreign-key relationship is represented by Enrollment.roll number?

    1. A

      It references Professor.employee ID

    2. B

      It references Course.course ID

    3. C

      It references Student.roll number

    4. D

      It references Department.department ID

    Correct answer
    C

    It references Student.roll number

    Explanation

    Enrollment.roll number identifies the student associated with an enrollment and references Student.

  29. 29

    Which foreign-key relationship is represented by Enrollment.course ID?

    1. A

      It references Course.course ID

    2. B

      It references Student.roll number

    3. C

      It references Department.department ID

    4. D

      It references Professor.employee ID

    Correct answer
    A

    It references Course.course ID

    Explanation

    Enrollment.course ID identifies the course associated with an enrollment and references Course.

  30. 30

    Which statement correctly describes foreign-key naming?

    1. A

      A foreign key must always have exactly the referenced key's name

    2. B

      A foreign key may have a different name from the referenced key

    3. C

      A foreign key cannot reference a primary key with another name

    4. D

      A foreign key must always be a single attribute

    Correct answer
    B

    A foreign key may have a different name from the referenced key

    Explanation

    Names such as department number and department ID may differ even though they represent the same referenced concept.

  31. 31

    How can ambiguous attribute names be disambiguated when the same name occurs in multiple relations?

    1. A

      Use dot notation such as Course.course ID

    2. B

      Use only the attribute name without its relation

    3. C

      Replace every repeated attribute name with a key symbol

    4. D

      Place the repeated attribute name in quotation marks

    Correct answer
    A

    Use dot notation such as Course.course ID

    Explanation

    Dot notation specifies the relation and attribute, such as Course.course ID, to remove ambiguity.

  32. 32

    What is a relational schema diagram used to show?

    1. A

      Only the physical storage locations of relation tuples

    2. B

      Only the SQL commands used to create each relation

    3. C

      Relations, attributes, keys, and foreign-key references

    4. D

      Only the number of rows currently stored in each relation

    Correct answer
    C

    Relations, attributes, keys, and foreign-key references

    Explanation

    A relational schema diagram displays relation names, attributes, underlined keys, and arrows showing foreign-key references.

  33. 33

    What does relational algebra consist of?

    1. A

      Commands that take individual values as inputs and return programs

    2. B

      Procedures that take database users as inputs and return permissions

    3. C

      Rules that take SQL keywords as inputs and return physical files

    4. D

      Operators that take relations as inputs and return new relations

    Correct answer
    D

    Operators that take relations as inputs and return new relations

    Explanation

    Relational algebra is a set of unary and binary operators that operate on relations and produce new relations.

  34. 34

    What is a database query in the context of this material?

    1. A

      A request to underline the keys in a relational schema

    2. B

      A request to change the physical location of a database file

    3. C

      A request to define the employee ID of a professor

    4. D

      A request to retrieve specified data from the database

    Correct answer
    D

    A request to retrieve specified data from the database

    Explanation

    A query is a data retrieval request specifying the information wanted from the database.

  35. 35

    Why is relational algebra described as procedural?

    1. A

      It requires users to write a program in a general-purpose language

    2. B

      It specifies the sequence of operations used to obtain the result

    3. C

      It can be applied only to relations stored in procedural databases

    4. D

      It specifies only the desired result without describing operations

    Correct answer
    B

    It specifies the sequence of operations used to obtain the result

    Explanation

    Relational algebra describes what operations to perform and how to combine their results.

  36. 36

    How can a relational algebra expression be conceptually represented?

    1. A

      As a list containing only the final relation's attributes

    2. B

      As a tree with intermediate results flowing toward the root

    3. C

      As a single key pointing directly to every database tuple

    4. D

      As a diagram showing only foreign-key arrows

    Correct answer
    B

    As a tree with intermediate results flowing toward the root

    Explanation

    An algebraic expression can be viewed as a tree in which information flows through operations toward the final output at the root.

  37. 37

    What role does relational algebra play in a relational query engine?

    1. A

      It stores all relation tuples independently of the database engine

    2. B

      It prevents SQL queries from being translated into internal expressions

    3. C

      It provides operators that the engine can implement and optimize

    4. D

      It replaces every relation key with a procedural variable

    Correct answer
    C

    It provides operators that the engine can implement and optimize

    Explanation

    The relational query engine uses relational algebra operators and can optimize how those operators are executed.

  38. 38

    How is SQL characterized in the material?

    1. A

      As a largely declarative way to specify queries

    2. B

      As a notation used only to identify foreign keys

    3. C

      As a physical storage language for relation tuples

    4. D

      As a purely procedural sequence of relational operators

    Correct answer
    A

    As a largely declarative way to specify queries

    Explanation

    SQL is described as a largely declarative query language whose requests are internally translated into relational algebra expressions.

  39. 39

    Why can translating SQL queries into relational algebra expressions support optimization?

    1. A

      The translation guarantees that every query returns all database tuples

    2. B

      The translation converts every query into a foreign-key constraint

    3. C

      The algebraic expression can be rewritten into a more efficient execution plan

    4. D

      The translation removes the need to identify relation keys

    Correct answer
    C

    The algebraic expression can be rewritten into a more efficient execution plan

    Explanation

    Relational algebra expressions can be rewritten or rearranged so that the query is executed more efficiently.

  40. 40

    Which pair consists only of unary relational algebra operators?

    1. A

      Difference and join

    2. B

      Union and intersection

    3. C

      Select and project

    4. D

      Cross product and union

    Correct answer
    C

    Select and project

    Explanation

    Select and project each operate on one relation, so they are unary operators.

  41. 41

    What does the select operator do?

    1. A

      It removes every tuple containing a repeated attribute value

    2. B

      It combines tuples from two relations into one relation

    3. C

      It returns only selected attributes from every tuple

    4. D

      It returns tuples satisfying a specified condition

    Correct answer
    D

    It returns tuples satisfying a specified condition

    Explanation

    Selection chooses rows or tuples that satisfy a given selection condition.

  42. 42

    What is the schema of a relation produced by selection?

    1. A

      A schema containing one attribute for every selected tuple

    2. B

      The schema of the relation referenced by a foreign key

    3. C

      Only the attributes mentioned in the condition

    4. D

      The same schema as the input relation

    Correct answer
    D

    The same schema as the input relation

    Explanation

    Selection filters tuples but retains the same attributes, order, and overall schema as the input relation.

  43. 43

    What does the expression c3_{\theta}(R) return?

    1. A

      All attributes in RRR that appear in condition θ\thetaθ

    2. B

      All tuples in RRR that satisfy condition θ\thetaθ

    3. C

      All distinct values appearing in the key of RRR

    4. D

      All tuples in another relation referenced by RRR

    Correct answer
    B

    All tuples in RRR that satisfy condition θ\thetaθ

    Explanation

    The selection operator σθ\sigma_{\theta}σθ​ applies condition θ\thetaθ to relation RRR and returns the satisfying tuples.

  44. 44

    Why are successive selection operations commutative?

    1. A

      Selection changes the attributes before applying the next condition

    2. B

      Both orders return tuples satisfying both conditions

    3. C

      Both orders always produce different relation schemas

    4. D

      Selection can be applied only once to any relation

    Correct answer
    B

    Both orders return tuples satisfying both conditions

    Explanation

    The expressions σc1(σc2(R))\sigma_{c_1}(\sigma_{c_2}(R))σc1​​(σc2​​(R)) and σc2(σc1(R))\sigma_{c_2}(\sigma_{c_1}(R))σc2​​(σc1​​(R)) both retain exactly the tuples satisfying both conditions.

  45. 45

    Which is a valid basic selection condition?

    1. A

      Comparing a relation name with a foreign-key arrow

    2. B

      Comparing a tuple count with an unrelated attribute name

    3. C

      Comparing two relation schemas without referencing attributes

    4. D

      Comparing an attribute with another attribute or an appropriate constant

    Correct answer
    D

    Comparing an attribute with another attribute or an appropriate constant

    Explanation

    A basic condition compares two attributes or compares an attribute with a constant of an appropriate type.

  46. 46

    How is a composite selection condition formed?

    1. A

      By replacing every condition with a foreign-key constraint

    2. B

      By combining only conditions that compare relation names

    3. C

      By combining basic conditions with AND, OR, or NOT

    4. D

      By projecting the attributes used in several relations

    Correct answer
    C

    By combining basic conditions with AND, OR, or NOT

    Explanation

    Basic Boolean conditions can be combined using AND, OR, and NOT to form composite conditions.

  47. 47

    Which comparison operators are available for selection conditions?

    1. A

      Less than, less than or equal, greater than, greater than or equal, equal, and not equal

    2. B

      Equal, approximately equal, and logically equivalent

    3. C

      Only equal and not equal

    4. D

      Only greater than and less than

    Correct answer
    A

    Less than, less than or equal, greater than, greater than or equal, equal, and not equal

    Explanation

    The six comparison operators listed are less than, less than or equal, greater than, greater than or equal, equal, and not equal.

  48. 48

    What must generally be true of domains when ordered comparison operators are used?

    1. A

      The domains must support a meaningful linear ordering

    2. B

      The domains must contain exactly the same number of values

    3. C

      The domains must contain only character strings

    4. D

      The domains must contain only foreign-key values

    Correct answer
    A

    The domains must support a meaningful linear ordering

    Explanation

    Ordered comparisons make sense when the relevant domains have an appropriate ordering relationship.

  49. 49

    Which relational algebra expression retrieves all professors named Giridhar?

    1. A

      σname=′Giridhar′(Professor)\sigma_{name='Giridhar'}(Professor)σname=′Giridhar′​(Professor)

    2. B

      πname=′Giridhar′(Professor)\pi_{name='Giridhar'}(Professor)πname=′Giridhar′​(Professor)

    3. C

      πProfessor=′Giridhar(name)\pi_{Professor='Giridhar}(name)πProfessor=′Giridhar​(name)

    4. D

      σProfessor=′Giridhar′(name)\sigma_{Professor='Giridhar'}(name)σProfessor=′Giridhar′​(name)

    Correct answer
    A

    σname=′Giridhar′(Professor)\sigma_{name='Giridhar'}(Professor)σname=′Giridhar′​(Professor)

    Explanation

    The condition name = 'Giridhar' filters the Professor relation to tuples whose name is Giridhar.

  50. 50

    Which expression retrieves professors whose start year is between 1980 and 1985, inclusive?

    1. A

      σstartYear=1980 OR startYear=1985(Professor)\sigma_{startYear=1980\ \text{OR}\ startYear=1985}(Professor)σstartYear=1980 OR startYear=1985​(Professor)

    2. B

      σstartYear<1980 OR startYear>1985(Professor)\sigma_{startYear<1980\ \text{OR}\ startYear>1985}(Professor)σstartYear<1980 OR startYear>1985​(Professor)

    3. C

      σstartYear≥1980 AND startYear≤1985(Professor)\sigma_{startYear\geq1980\ \text{AND}\ startYear\leq1985}(Professor)σstartYear≥1980 AND startYear≤1985​(Professor)

    4. D

      πstartYear≥1980 AND startYear≤1985(Professor)\pi_{startYear\geq1980\ \text{AND}\ startYear\leq1985}(Professor)πstartYear≥1980 AND startYear≤1985​(Professor)

    Correct answer
    C

    σstartYear≥1980 AND startYear≤1985(Professor)\sigma_{startYear\geq1980\ \text{AND}\ startYear\leq1985}(Professor)σstartYear≥1980 AND startYear≤1985​(Professor)

    Explanation

    Inclusive bounds require the condition startYear≥1980startYear \geq 1980startYear≥1980 AND startYear≤1985startYear \leq 1985startYear≤1985.

  51. 51

    What does the project operator do?

    1. A

      It changes the key values of the input relation

    2. B

      It keeps selected attributes and discards the others

    3. C

      It keeps selected tuples and discards the others

    4. D

      It combines two relations using matching foreign keys

    Correct answer
    B

    It keeps selected attributes and discards the others

    Explanation

    Projection removes unwanted columns while retaining the requested attributes.

  52. 52

    What is the schema of the result of projecting attribute list LLL from relation RRR?

    1. A

      The attributes of the relation referenced by RRR

    2. B

      Only the key attributes of RRR

    3. C

      The attributes listed in LLL

    4. D

      All attributes originally present in RRR

    Correct answer
    C

    The attributes listed in LLL

    Explanation

    The output schema consists exactly of the attributes in the projection list LLL.

  53. 53

    Why can projection produce fewer tuples than the input relation?

    1. A

      Different input tuples may become identical after unwanted attributes are removed

    2. B

      Different input tuples are always retained as separate duplicates

    3. C

      Projection automatically removes every tuple containing a null value

    4. D

      Projection changes every tuple into a foreign-key reference

    Correct answer
    A

    Different input tuples may become identical after unwanted attributes are removed

    Explanation

    Because relations are sets, duplicate projected tuples are retained only once when different input tuples agree on the projected attributes.

  54. 54

    What happens when the projection list contains a key of the input relation?

    1. A

      The output becomes a relation containing duplicate tuples

    2. B

      The output necessarily has fewer tuples than the input

    3. C

      The output has the same number of tuples as the input

    4. D

      The output contains only the key value of the input relation

    Correct answer
    C

    The output has the same number of tuples as the input

    Explanation

    A key uniquely identifies each input tuple, so projecting it preserves a distinct tuple for every input tuple.

  55. 55

    What result is produced by first selecting Student tuples with degree equal to M.S. and then projecting name?

    1. A

      One tuple for every original student attribute

    2. B

      One tuple for every department offering an M.S. degree

    3. C

      One tuple for every M.S. enrollment record

    4. D

      One tuple for each distinct M.S. student name

    Correct answer
    D

    One tuple for each distinct M.S. student name

    Explanation

    Selection keeps M.S. students, and projection keeps only their names; repeated names appear once because the result is a set.

  56. 56

    Why can projecting only name from M.S. students lose information in the example?

    1. A

      Students in different departments may have the same name

    2. B

      Projection always removes all students with an M.S. degree

    3. C

      Names cannot be stored in a relational database

    4. D

      The name attribute is necessarily a foreign key to Course

    Correct answer
    A

    Students in different departments may have the same name

    Explanation

    Two students named Mahesh can become one tuple when only name is projected, even though they represent different students.

  57. 57

    Why does projecting roll number and name from Student preserve the number of tuples?

    1. A

      Name is always unique among all students

    2. B

      Roll number is a key and prevents projected duplicates

    3. C

      Degree and department number are automatically restored

    4. D

      Projection preserves every discarded attribute internally

    Correct answer
    B

    Roll number is a key and prevents projected duplicates

    Explanation

    Because roll number is a key, no two Student tuples can produce the same roll-number-and-name combination.

  58. 58

    Which notation represents projection in relational algebra?

    1. A

      δL(R)\delta_{L}(R)δL​(R)

    2. B

      πL(R)\pi_{L}(R)πL​(R)

    3. C

      σL(R)\sigma_{L}(R)σL​(R)

    4. D

      ρL(R)\rho_{L}(R)ρL​(R)

    Correct answer
    B

    πL(R)\pi_{L}(R)πL​(R)

    Explanation

    The symbol π\piπ denotes projection, with LLL as the requested attribute list and RRR as the input relation.

Question 1 of 58
Question 1 of 58

Ask anything

We've read this whole study set, so questions about it get the best answers.

FlashcardsQuizFill in the blanksWritten testLessonNotesPodcastContent