Method signatures

Method signatures define/describe:

  • the name/identifier of the method
  • the parameters of the method (identifier and data type)
  • the return type of the method eg void or int etc

Objectives

Students will be able to:

  • undertand the importance of referential integrity in database design
  • understand the idea of CASCADE when updating a table in a database

Data Integrity

Data integrity refers to the accuracy, consistency, and completeness of data throughout its lifecycle.

It ensures that data is reliable and trustworthy, free from corruption or unauthorized modification.

Data integrity is crucial for maintaining the reliability of databases and ensuring that data is accurate and reliable throughout its lifecycle in the database.

Relational Databases

Data Integrity

Data Integrity

So we know that database entities (tables) must have a primary key.

To create a relationship between tables, a foreign key will be required.

But what if the primary key that the foreign key is refering to is deleted from the database?

How will this impact in a database with multiple entities that refer to each other?

Watch the video and complete the worksheet.

Practical Referential Integrity Activity

TBD

Objective

Design an Entity Relationship Diagram (ERD) for a university course registration system, demonstrating understanding of entities (tables), attributes (fields), relationships (cardinality and modality).

Scenario

The university database must manage the following data:

  • Students - every student has an ID, a name, and an email
  • Courses - every course has a course ID, a professor, a title, and a department)
  • Professors - every professor has an ID, a name, a department, and an email)
  • Registrations - every registration has a registration date, a studentID and a courseID

System Rules:

  • Students can register for many courses; each course can have many students.
  • Each course is taught by one and only one professor; a professor can teach multiple courses or no courses.
  • Each registration links one student to one course
  • A student might not be registered for any courses yet.

Instructions

  1. Identify and define all entities and their attributes.
  2. Determine relationships between entities.
  3. Specify cardinality and modality for each relationship.
  4. Draw the ERD using software or on paper.
  5. Write a paragraph explaining your choices for each relationship's cardinality and modality.

Resources

Tags

ERDdata consistency entity composite primary data redundancy foreignSQL