Note: The Listed platform will permanently shut down December 31, 2026. Your data published on Listed will still be available in your personal Standard Notes account. Learn more

[CC4057NP] 1st Sit Examination Question Paper Scenario (Autumn Semester 2023)

Scenario for developing the database

Ilearn International College is an educational institution in Lalitpur, Nepal, established in 1999. The college specialises in teaching different IT and Business degrees and is affiliated with London Metropolitan University. The college has different courses for its students. In courses, there are different subjects under various courses assigned to teachers.

In Ilearn International College, firstly the students are enrolled in a course of the college. A student at Ilearn International College can enrol in a course only. With that being said, while maintaining the enrolment record, the Student ID, Student Name, Student Phone Numbers are maintained with the enrolment date and completion date. Similarly, while maintaining the records of course details such as Course Name, Subjects Name, and Teacher Name are recorded. Moreover, the teachers of Ilearn International College are responsible for delivering quality content at the college. Hence, a subject has multiple teachers allocated to it to ensure the quality of work.

The college has been keeping track of students and course records in various registers. In order to solve this traditional approach of record-keeping, you are required to develop a database for the college which will consist of at least five entities with a minimum of five records in each table. Likewise, you are also required to implement suitable constraints in each table.

Each record of the table is to be uniquely identified using a suitable attribute. Before developing the database, itself, you are required to define appropriate business rules for the defined scenario and draw an ERD (Entity Relationship Diagram) and Relational Diagram of the database model.


Business Rules:

  • There are different subjects under various courses.
    Courses (N) -------------- (N) Subjects
  • A student can enroll in a course only // one course can be enrolled by many students
    Students (N) -------------- (1) Courses
  • A subject has multiple teachers // one teacher is allocated to only one subject
    Teachers (N) -------------- (1) Subjects

Entity Relationship Diagram

erd

Relational Diagram

rd

MySQL Codes:

  • Create and use database IIC

    create database iic;
    use iic;

  • Create Table Courses

    CREATE TABLE courses (
    course_id int PRIMARY KEY,
    name varchar(50) NOT NULL,
    year int NOT NULL,
    description varchar(255),
    price int
    );

  • Create Table Students

    CREATE TABLE students (
    student_id int PRIMARY KEY,
    name varchar(100) NOT NULL,
    contact varchar(15),
    enrollment_date date,
    completion_date date,
    course int,
    FOREIGN KEY (course) REFERENCES courses (course_id)
    );

  • Create Table Subjects

    CREATE TABLE subjects (
    subject_id int PRIMARY KEY,
    name varchar(50) NOT NULL,
    credit int NOT NULL,
    subject_code varchar(10) UNIQUE,
    description varchar(255)
    );

  • Create Table Teachers

    CREATE TABLE teachers (
    teacher_id int PRIMARY KEY,
    name varchar(100) NOT NULL,
    subject int,
    contact varchar(15) UNIQUE,
    joined_on date,
    FOREIGN KEY (subject) REFERENCES subjects (subject_id)
    );

  • Create Junction Table Course_Subject_Relationship

    CREATE TABLE course_subject_relationship (
    id int PRIMARY KEY AUTO_INCREMENT,
    course int,
    subject int,
    FOREIGN KEY (course) REFERENCES courses (course_id),
    FOREIGN KEY (subject) REFERENCES subjects (subject_id)
    );


Screenshot

ss


सक्यो!


You'll only receive email when they publish something new.

More from Prabesh Sapkota
All posts