0% found this document useful (0 votes)
4 views10 pages

Database Assignment 123 Group 3

The document outlines a project assignment for a Bachelor's degree course in Cybersecurity and Digital Forensics Engineering at the University of Dodoma. It details the management of software projects, user interactions, and the database schema required to support these functionalities, including entities such as projects, users, bug reports, and updates. Additionally, it includes SQL commands for creating tables and inserting sample data into a relational database system.

Uploaded by

shadrackmusa2003
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views10 pages

Database Assignment 123 Group 3

The document outlines a project assignment for a Bachelor's degree course in Cybersecurity and Digital Forensics Engineering at the University of Dodoma. It details the management of software projects, user interactions, and the database schema required to support these functionalities, including entities such as projects, users, bug reports, and updates. Additionally, it includes SQL commands for creating tables and inserting sample data into a relational database system.

Uploaded by

shadrackmusa2003
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 10

UNIVERSITY OF DODOMA (UDOM)

DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING (CSE)

MEMBERS
S/N NAME REG NO: SIGNATURE
1 ELIAS LUGOMELA ANATHORY T24-03-20211
2 JOSHUA ELIZEUS KAHIGWA T24-03-13190
3 SHADRAK MUSA NZOWA T24-03-20505
4 GIDION ABRAHAM MARWA T24-03-13180
5 GWANDUMI ADAM T24-03-18525
6 JASPINA BERNARD T24-03-16909
7 FAIDA NJILE T24-03-17223
8 ANECTUS PHILEMON T24-03-23706
9 OCTAVIAN WILLIAM MALOPHA T24-03-16528

PROGRAM: BACHELOR’S DEGREE IN CYBERSECURITY AND DIGITAL


FORENSICS ENGINEERING.

COURSE NAME: INTRODUCTION TO DATABASE SYSTEMS

COURSE CODE: CP 121

ASSIGNMENT TYPE: PROJECT ASSIGNMENT

GROUP NUMBER: 3
Assignment

Our website manages software projects for downloads to users. Each software project has a unique
project id (8 characters long), can be assigned one or more categories (the categories are A, B ,C
and D), has a status (D or P), and has a description (text of at most 256 characters). Some projects
may depend on other projects and we keep track of the dependency. Each project is developed and
owned by a single developer (who is our subscriber), and uploaded to our website in one or more
transactions.

Our users are identified by name (at most 20 characters), email (at most 20 characters), and a
unique user id (8 characters long). They can be either guest users or subscribed users (subscribers
for short). The subscribers have passwords (at most 8 characters) and we keep the date of the
subscription. They need the password to access our website to file bug reports or upload software
projects or update patches. A user can download any project, the number of downloads per user
per project is recorded. The subscribers can file bug reports for any project. Every bug identified
has an id (a positive integer) and a description (text of at most 256 characters). The bug id’s must
be unique for all bugs concerning the same project. The date of filing of a bug report is recorded.
Each bug report deals with a single project and can report a single bug. Each bug report is made
by a single subscriber.

Some of our subscribers are developers. They develop the software projects and also software
updates for their own projects. Each update for a project has an id (8 characters long), a name (at
most 20 characters), a status (P or U), a description (text of at most 256 characters), and is assigned
a particular type (the type are 1, 2 and 3). Each update for a project is created by a single developer,
the one who originally created the project. Each update patch is uploaded to our website in a
transaction.

Each transaction has an id (6 characters long) and a date when it took place. The transaction id’s
must be unique for all transactions concerning the same project.
Questions

a) Use the E-R Model to model the above scenario with E-R Diagram. State any assumptions
necessary to support your design
Answer

b) From the ERD in a) draw the corresponding logical schemas. Carefully observe both
Entity and Referential integrity constrains

Answer
1. Project
projectId priviledgeId category status description

2. Depends_on (Project-Project)
projectId projectId

3. User
userId name email
4. Downloads (Project-User)
userId projectId down_per_user_per_project

5. Privilege
priviledgeId userId subscriber_reqId privilegeStatus

6. Subscribers_requirement
subscriber_reqId password dateOfSubscription

7. Role
roleId roles privilegeId

8. Bug_report
bugRepId description projectId dateOfFiling

9. Update_patch
updateId roleId name status description type projectId

10. Transaction
transactionId projectId updateId date

c) From the logical schemas in b) choose at least three schemas and tabulate their
corresponding Data dictionaries. Carefully observe domain constrain on each attribute.
You may Update_patch also suggest any general constrain that may apply on each
attribute or relation

Answer
1. Project

Attribute Data type Constraints Description

projectId INT PRIMARY KEY A unique identifier for each project.


Used to reference projects in related
tables
privilegeId INT FOREIGN KEY Refers to the level of access or
permission associated with the project
or user role.
category CHAR NOT NULL Represents a type or classification
assigned to the project
status ENUM NOT NULL The current lifecycle state of the
project.
Description VARCHAR NOT NULL A detailed textual explanation or
summary of the project.

2. User

Attribute Data type Constraint Description


userId INT PRIMARY KEY A unique identifier for each
user. Used to reference users in
related tables
name VARCHAR NOT NULL The full name of the individual
email VARCHAR NO NULL The user’s email address

3. Privilege

Attribute Data type Constraint Description


priviledgeId INT PRIMARY KEY A unique identifier for each
privilege. Used to reference
privilege in related tables
privilegeStatus ENUM NOT NULL The state of privilege present
userId INT FOREIGN KEY Referring to a unique identifier
for each user.
Subscriber_reqId INT FOREIGN KEY Referring to a unique identifier
for each subscriber requirement
in another table. Used to
reference privilege in related
tables

d) Create the corresponding Physical schema for the logical schema in b). With reference to
the types of values suggested in c) fill the physical schema with data. Use SQL Server as
your RDBMS

Answer
physical schema
1. Project:
SQL
CREATE TABLE Project (
projectId CHAR(8) PRIMARY KEY,
privilegeId INT FOREIGN KEY REFERENCES Privilege(privilegeId),
category CHAR(1) NOT NULL CHECK (category IN ('A', 'B', 'C', 'D')),
status CHAR(1) NOT NULL CHECK (status IN ('D', 'P')),
description VARCHAR(256) NOT NULL
);

Sample
INSERT INTO Project values
('PRJ00101', 1, 'A', 'P', 'Photo editing software with AI filters'),
('PRJ00202', 2, 'B', 'D', 'Cloud-based accounting tool for SMEs'),
('PRJ00303', 1, 'C', 'P', 'Mobile game with offline mode'),
('PRJ00404', 3, 'D', 'P', 'Open-source antivirus software');

2. User:
SQL
CREATE TABLE [User] (
userId CHAR(8) PRIMARY KEY,
name VARCHAR(20) NOT NULL,
email VARCHAR(20) NOT NULL
);

Sample
INSERT INTO User VALUES
('USR00001', 'Amina Joseph', '[email protected]'),
('USR00002', 'Baraka Felix', '[email protected]'),
('USR00003', 'Neema John', '[email protected]'),
('USR00004', 'Kelvin Paul', '[email protected]');

3. Depends_on
SQL
CREATE TABLE Depends_on (
projectId CHAR(8) NOT NULL,
dependsOnProjectId CHAR(8) NOT NULL,
PRIMARY KEY (projectId, dependsOnProjectId),
FOREIGN KEY (projectId) REFERENCES Project(projectId),
FOREIGN KEY (dependsOnProjectId) REFERENCES Project(projectId)
);
Sample
INSERT INTO Depends_on
VALUES
('PRJ00303', 'PRJ00101'),
('PRJ00404', 'PRJ00202');

4. Downloads:
SQL
CREATE TABLE Downloads (
userId CHAR(8) NOT NULL,
projectId CHAR(8) NOT NULL,
down_per_user_per_project INT NOT NULL CHECK
(down_per_user_per_project >= 0),
PRIMARY KEY (userId, projectId),
FOREIGN KEY (userId) REFERENCES [User](userId),
FOREIGN KEY (projectId) REFERENCES Project(projectId)
);

Sample
INSERT INTO Downloads
VALUES
('USR00001', 'PRJ00101', 3),
('USR00002', 'PRJ00101', 1),
('USR00001', 'PRJ00202', 2),
('USR00003', 'PRJ00303', 5);

5. Privilege:
SQL
CREATE TABLE Privilege (
privilegeId INT PRIMARY KEY,
privilegeStatus VARCHAR(10) NOT NULL CHECK (privilegeStatus IN ('Active',
'Inactive', 'Pending')),
userId CHAR(8) NOT NULL,
subscriber_reqId INT NOT NULL,
FOREIGN KEY (userId) REFERENCES [User](userId),
FOREIGN KEY (subscriber_reqId) REFERENCES
Subscribers_requirement(subscriber_reqId)
);

Sample
INSERT INTO Privilege
VALUES
(1, 'Active', 'USR00001', 101),
(2, 'Inactive', 'USR00002', 102),
(3, 'Pending', 'USR00003', 103);

6. Role:
SQL
CREATE TABLE Role (
roleId INT PRIMARY KEY,
roles VARCHAR(30) NOT NULL,
privilegeId INT NOT NULL,
FOREIGN KEY (privilegeId) REFERENCES Privilege(privilegeId)
);

Sample
INSERT INTO Role
VALUES
(1, 'Developer', 1),
(2, 'Reviewer', 2),
(3, 'Admin', 3);

7. Subscribers_requirement
SQL
CREATE TABLE Subscribers_requirement (
subscriber_reqId INT PRIMARY KEY,
password VARCHAR(8) NOT NULL,
dateOfSubscription DATE NOT NULL
);

Sample
INSERT INTO Subscribers_requirement
VALUES
(101, 'abc12345', '2024-11-01'),
(102, 'pass7788', '2024-12-15'),
(103, 'secure09', '2025-01-20');

8. Report_bug
SQL
CREATE TABLE Bug_report (
bugRepId INT PRIMARY KEY,
description VARCHAR(256) NOT NULL,
projectId CHAR(8) NOT NULL,
dateOfFiling DATE NOT NULL,
userId CHAR(8) NOT NULL,
FOREIGN KEY (projectId) REFERENCES Project(projectId),
FOREIGN KEY (userId) REFERENCES [User](userId)
);

Sample
INSERT INTO Bug_report
VALUES
(101, 'App crashes on login screen after patch update', 'PRJ00101', '2025-06-01',
'USR00001'),
(102, 'Missing download link on mobile layout', 'PRJ00202', '2025-06-03', 'USR00003'),
(103, 'Incorrect file version on update 1.2', 'PRJ00303', '2025-06-05', 'USR00002');

9. Update_patch
SQL
CREATE TABLE Update_patch (
updateId CHAR(8) PRIMARY KEY,
roleId INT NOT NULL,
name VARCHAR(20) NOT NULL,
status CHAR(1) NOT NULL CHECK (status IN ('P', 'U')),
description VARCHAR(256) NOT NULL,
type INT NOT NULL CHECK (type IN (1, 2, 3)),
projectId CHAR(8) NOT NULL,
FOREIGN KEY (roleId) REFERENCES Role(roleId),
FOREIGN KEY (projectId) REFERENCES Project(projectId)
);

INSERT INTO Update_patch


VALUES
('UPD00101', 1, 'Login Fix', 'U', 'Resolved login delay on slow networks', 2, 'PRJ00101'),
('UPD00202', 1, 'Dark Mode', 'P', 'Adds optional dark theme for UI', 1, 'PRJ00303'),
('UPD00303', 2, 'Firewall Sync', 'U', 'Improved real-time sync with system firewall', 3,
'PRJ00404');

10. Transaction
SQL
CREATE TABLE Transaction (
transactionId CHAR(6) PRIMARY KEY,
projectId CHAR(8) NOT NULL,
updateId CHAR(8) NOT NULL,
date DATE NOT NULL,
FOREIGN KEY (projectId) REFERENCES Project(projectId),
FOREIGN KEY (updateId) REFERENCES Update_patch(updateId)
);

Sample
INSERT INTO Transaction
VALUES
('TX0001', 'PRJ00101', 'UPD00101', '2025-06-10'),
('TX0002', 'PRJ00303', 'UPD00202', '2025-06-12'),
('TX0003', 'PRJ00404', 'UPD00303', '2025-06-13');

You might also like