Download as pdf or txt
Download as pdf or txt
You are on page 1of 50

SOFTWARE REQUIRMENTS SPECIFICATION

MeCoLr

Ammara Khan CT – 006


Mehwish Alam CT – 007
Minahil Tariq CT - 026
Areeba Aamir CT - 029
Contents

Background:........................................................................................................... 4
What is MeCoLr? ................................................................................................... 4
Major Features of the system includes: .............................................................. 4
Query............................................................................................................... 4
Project ............................................................................................................. 4
Contributor ...................................................................................................... 5
Follow .............................................................................................................. 5
Feedback ......................................................................................................... 5
Settings............................................................................................................ 5
View ................................................................................................................ 5
Help ................................................................................................................. 6
SOFTWARE REQUIREMENTS SPECIFICATION ......................................................... 6
Work Break Structure: ........................................................................................... 7
Pert Chart: ............................................................................................................. 9
Gantt Chart: ......................................................................................................... 10
Use Case: ............................................................................................................. 11
Activity Diagram: ................................................................................................. 12
User: ................................................................................................................. 12
Mentor: ............................................................................................................ 13
Contributor: ...................................................................................................... 14
Learner: ............................................................................................................ 15
Data Flow Diagram .............................................................................................. 16
Level 0: ............................................................................................................. 16
Mentor: ......................................................................................................... 16
Contributor: ................................................................................................... 17
Learner: ......................................................................................................... 17
Level 1 .............................................................................................................. 18

1
User: .............................................................................................................. 18
Mentor: ......................................................................................................... 19
Contributor: ................................................................................................... 20
Learner: ......................................................................................................... 21
Level 2 .............................................................................................................. 22
User: .............................................................................................................. 22
Mentor: ......................................................................................................... 23
Contributor: ................................................................................................... 24
Learner: ......................................................................................................... 25
Scenario:........................................................................................................ 26
ERD Diagram: ....................................................................................................... 27
Referential Integrity and Entity Integrity: ............................................................ 28
Register Table: .................................................................................................. 28
Mentor Table: ................................................................................................... 28
Contributor Table: ............................................................................................ 28
Learner Table: ................................................................................................... 28
Project Table: .................................................................................................... 29
Project_Follower Table: .................................................................................... 29
Project_Cont Table: .......................................................................................... 29
Feedback Table: ................................................................................................ 29
Query Table: ..................................................................................................... 30
Ans_Query Table: ............................................................................................. 30
Mentor_Follower Table: ................................................................................... 30
Contr_Follower Table: ...................................................................................... 30
General Constraints: ............................................................................................ 31
NOT NULL: ........................................................................................................ 31
NULL: ................................................................................................................ 31
AUTO_INCREMENT: .......................................................................................... 31
Relational Diagram: ............................................................................................. 32
2
Sql Code Using Erd Plus: ...................................................................................... 33
User Privileges: .................................................................................................... 37
Queries: ............................................................................................................... 39
All Mentors ....................................................................................................... 39
All Contributors Order By Age ........................................................................... 39
Mentors Aged Above 27 ................................................................................... 39
Order Register table by user role ...................................................................... 40
Equijoin:............................................................................................................ 40
Joining More Than Two Tables.......................................................................... 41
Left Join: ........................................................................................................... 42
Right Join .......................................................................................................... 43
Cross Join | Outer Join ...................................................................................... 44
Joining With “Using” Clause: ............................................................................. 45
Group Functions: .............................................................................................. 45
Group By Clause: .............................................................................................. 46
Having Clause: .................................................................................................. 46
Subqueries ........................................................................................................ 47
Group Func In Subquery: .................................................................................. 47
Views ................................................................................................................ 48
Records Entered in the Tables: ............................................................................ 48

3
Background:
As a programmer, we all need a platform where we can connect with different
people and learn more about the industry. To overcome this problem, we think of
a system (MeCoLr) where we connect beginners with professionals and help them
grow faster and better. This system provides different features for their users.
MeCoLr is implemented using file system last year, this year we are trying to
compile our system and integrating with database to make it more stable and
convenient.

What is MeCoLr?
MeCoLr is a platform that connect different user on one platform providing them
the opportunity to get help from each other and connect with industry
professional. MeCoLr have three different user that are Learner, Contributor and
Mentor. Each of the user have different access of the site and have different
functionalities that they can used.

Major Features of the system includes:

Query

• Learner can add different queries using our platform which can be
answered by both Mentor and Contributor

• Leaner can create, view, edit and delete their previous posted
queries.

Project

• Mentor can add different project by posting its details on our


platform.
4
Mentor can create, view, edit and delete their previous posted
projects.

• Mentor can request any contributor to join them in their project.

Contributor

• Contributor can contribute to different projects hosted by different


Mentor.

• Contributor can answer different query which is posted by Learner.

Follow

• Learner can follow any contributor and Mentor. He can also follow
Project that are hosted by Mentor.

• Contributor can follow different Mentor and Projects and request to


contribute.

Feedback

• Each user can post as many feedback on MeCoLr.

Settings

• Each user have the access to change it username and its details.

• User can also change their password but user must enter its old
password for security concern.

View

User can view their profile and can also make changes to his/her
profile.

5
Help

• Team of MeCoLr is always there for you, User can reach out to team
in case of any issues.

• User can also view FAQs which can be very helpful to understand the
structure and model of the website.

SOFTWARE REQUIREMENTS SPECIFICATION


The software requirements specification of our system MeCoLr is described below:

6
Work Break Structure:

Task ID Task Name Duration Predecessors

-
1. Requirement Gathering 2 Days

2. Content/Technical Analysis 5 Days 1

3. Resource and Budget Criteria 3 Days 1

4. System Documentation & Contract with


Stack Holder
4 Days 2, 3

5. Assigning and Scheduling Task 1 Day 4

6. UML/ERD Diagram 10 Days 5

7. Database Design 2 Days 6

8. UI/UX Design 5 Days 6

9. Design Prototype 8 Days 8

10. Develop System Module 25 Days 9, 7

11. Testing Customer Experience 1 Day 10

12. DB Security Testing 1 Day 10

7
13. Integrate System Module 2 Days 11, 12

14. System Testing 3 Days 13

15. Configuration and Customization 6 Days 14

16. Roll Out Final Version 1 Day 15

8
Pert Chart:

9
Gantt Chart:

10
Use Case:

11
Activity Diagram:

User:

12
Mentor:

13
Contributor:

14
Learner:

15
Data Flow Diagram

Level 0:

User:

Mentor:

16
Contributor:

Learner:

17
Level 1
User:

18
Mentor:

19
Contributor:

20
Learner:

21
Level 2
User:

22
Mentor:

23
Contributor:

24
Learner:

25
Scenario:
MeCoLr is a system that supports three users as Learner, Contributor, and Mentor.
As for Learner, he can post any query he has which can be answered by either
Contributor or Mentor. As for Contributor, he can contribute to different project,
he is someone who has enough knowledge and some previous experience. As for
Mentor, he can create different projects by using the MeCoLr platform. One
Project can have different contributors which are working together as a team,
whereas learners can follow up on any project. Users can also follow other users.
All the queries have their particular ids which are saved in a database all users
have their particular ids as well. Which is used to fetch data from database using
joining and other functionality. Option of giving feedbacks is also available.

26
ERD Diagram:

27
Referential Integrity and Entity Integrity:

Register Table:
Entity Integrity Reg_ID

Referential Integrity ---------

Mentor Table:
Entity Integrity Men_ID

Referential Integrity Reg_ID

Contributor Table:

Entity Integrity Con_ID

Referential Integrity Reg_ID

Learner Table:

Entity Integrity Lea_ID

Referential Integrity Reg_ID

28
Project Table:

Entity Integrity Pro_ID

Referential Integrity Men_ID

Project_Follower Table:

Entity Integrity Pro_ID & Lea_ID

Referential Integrity Pro_ID & Lea_ID

Project_Cont Table:

Entity Integrity Pro_ID & Con_ID

Referential Integrity Pro_ID & Con_ID

Feedback Table:

Entity Integrity Feedback_ID

Referential Integrity Reg_ID

29
Query Table:

Entity Integrity Q_ID

Referential Integrity Lea_ID & Con_ID

Ans_Query Table:

Entity Integrity Ans_ID

Referential Integrity Q_ID , Con_ID & Men_ID

Mentor_Follower Table:

Entity Integrity MFol_ID

Referential Integrity Lea_ID, Con_ID & Men_ID

Contr_Follower Table:

Entity Integrity CFol_ID

Referential Integrity Lea_ID & Con_ID

30
General Constraints:
In this schema, the suggested general constraints would be:

NOT NULL:
The NOT NULL constraint enforces a column to NOT accept NULL values.

NULL:
A NULL value in a table is a value in a field that appears to be blank. A field with a NULL value is a field
with no value.

AUTO_INCREMENT:
Auto-increment allows a unique number to be generated automatically when a new record is
inserted into a table.

The table register have general constraints of AUTO_INCREMENT which will increment the value of
Reg_id by one at each entry.

31
Relational Diagram:

32
Sql Code Using Erd Plus:

CREATE TABLE Register


(
Reg_ID INT NOT NULL AUTO_INCREMENT,
username VARCHAR(10) NOT NULL,
Email VARCHAR(10) NOT NULL,
passw VARCHAR(20) NOT NULL,
Age INT NOT NULL,
Contact INT NOT NULL,
u_role INT NOT NULL,
languages VARCHAR(10) NOT NULL,
PRIMARY KEY (Reg_ID)
);

CREATE TABLE Mentor


(
Men_ID VARCHAR(10) NOT NULL,
Bio VARCHAR(50) NOT NULL,
Expertise VARCHAR(50) NOT NULL,
Descr VARCHAR(100) NOT NULL,
Skills VARCHAR(20) NOT NULL,
Reg_ID INT NOT NULL,
PRIMARY KEY (Men_ID),
FOREIGN KEY (Reg_ID) REFERENCES Register(Reg_ID)
);

CREATE TABLE Contributor


(
Con_ID VARCHAR(10) NOT NULL,
Bio VARCHAR(50) NOT NULL,
Descr VARCHAR(100) NOT NULL,
Expertise VARCHAR(50) NOT NULL,

33
Interest VARCHAR(40) NOT NULL,
Skills VARCHAR(20) NOT NULL,
PRIMARY KEY (Con_ID),
Reg_ID INT NOT NULL,
FOREIGN KEY (Reg_ID) REFERENCES Register(Reg_ID)
);

CREATE TABLE Learner


(
Lea_ID VARCHAR(10) NOT NULL,
Bio VARCHAR(50) NOT NULL,
Interest VARCHAR(40) NOT NULL,
Descr VARCHAR(100) NOT NULL,
PRIMARY KEY (Lea_ID),
Reg_ID INT NOT NULL,
FOREIGN KEY (Reg_ID) REFERENCES Register(Reg_ID)
);

CREATE TABLE Project


(
Pro_ID VARCHAR(10) NOT NULL,
Pro_name VARCHAR(20) NOT NULL,
Pro_details VARCHAR(50) NOT NULL,
Pro_Desc VARCHAR(100) NOT NULL,
Men_ID VARCHAR(10) NOT NULL,
PRIMARY KEY (Pro_ID),
FOREIGN KEY (Men_ID) REFERENCES Mentor(Men_ID)
);

CREATE TABLE Project_Follower


(
Pro_ID VARCHAR(10) NOT NULL,
Lea_ID VARCHAR(10) NOT NULL,
PRIMARY KEY (Pro_ID, Lea_ID),

34
FOREIGN KEY (Pro_ID) REFERENCES Project(Pro_ID),
FOREIGN KEY (Lea_ID) REFERENCES Learner(Lea_ID)
);

CREATE TABLE Project_cont


(
Pro_ID VARCHAR(10) NOT NULL,
Con_ID VARCHAR(10) NOT NULL,
Contribution VARCHAR(500) NOT NULL,
PRIMARY KEY (Pro_ID, Con_ID),
FOREIGN KEY (Pro_ID) REFERENCES Project(Pro_ID),
FOREIGN KEY (Con_ID) REFERENCES Contributor(Con_ID)
);

CREATE TABLE Feedback


(
Feedback_ID VARCHAR(10) NOT NULL,
Feedback_given VARCHAR(100) NOT NULL,
Reg_ID INT NOT NULL,
PRIMARY KEY (Feedback_ID),
FOREIGN KEY (Reg_ID) REFERENCES Register(Reg_ID)
);

CREATE TABLE Query


(
Q_ID VARCHAR(10) NOT NULL,
Query_Ques VARCHAR(50) NOT NULL,
Lea_ID VARCHAR(10) NULL,
Con_ID VARCHAR(10) NULL,
PRIMARY KEY (Q_ID),
FOREIGN KEY (Lea_ID) REFERENCES Learner(Lea_ID),
FOREIGN KEY (Con_ID) REFERENCES Contributor(Con_ID)
);

35
CREATE TABLE Ans_Query
(
Ans_ID VARCHAR(10) NOT NULL,
Ans VARCHAR(100) NOT NULL,
Q_ID VARCHAR(10) NOT NULL,
Con_ID VARCHAR(10) NULL,
Men_ID VARCHAR(10) NULL,
PRIMARY KEY (Ans_ID),
FOREIGN KEY (Q_ID) REFERENCES Query(Q_ID),
FOREIGN KEY (Con_ID) REFERENCES Contributor(Con_ID),
FOREIGN KEY (Men_ID) REFERENCES Mentor(Men_ID)
);

CREATE TABLE Follow


(
Fol_ID VARCHAR(10) NOT NULL,
Lea_ID VARCHAR(10) NULL,
Con_ID VARCHAR(10) NULL,
Men_ID VARCHAR(10) NULL,
Follower VARCHAR(10) NOT NULL,
Followed VARCHAR(10) NOT NULL,
PRIMARY KEY (Fol_ID),
FOREIGN KEY (Lea_ID) REFERENCES Learner(Lea_ID),
FOREIGN KEY (Con_ID) REFERENCES Contributor(Con_ID),
FOREIGN KEY (Men_ID) REFERENCES Mentor(Men_ID)
);

36
User Privileges:

Administrator | Mehwish Alam

Database Manager | Ammara Khan

37
Monitor and User Admin | Areeba Amir

Maintenance and Process Admin | Minahil Tariq

38
Queries:
All Mentors
SELECT
Reg_ID , Username as “MENTORS”
FROM Register
WHERE U_role = ’Mentor’;

All Contributors Order By Age


SELECT
Reg_ID , Username as “CONTRIBUTORS”, Age
FROM Register
WHERE U_role = ‘Contributor’
ORDER BY Age;

Mentors Aged Above 27


SELECT
Reg_ID , Username

39
FROM Register
WHERE Age >27
AND U_role = ‘Mentor’;

Order Register table by user role


SELECT * FROM Register
order by u_role;

Equijoin:

● Joining Mentor and Register to get the data of all Mentors


SELECT Register.Reg_ID , Register.Username, Register.Age, Register.Email, Register.Contact,
Register.Languages, Register.U_role, Mentor.Bio, Mentor.Expertise, Mentor.Descr,
Mentor.Skills
From Register, Mentor
WHERE Register.Reg_ID = Mentor.Reg_ID;

40
● Joining Contributor and Register to get the data of all Contributors
SELECT Register.Reg_ID , Register.Username, Register.Age, Register.Email, Register.Contact,
Register.Languages, Register.U_role, Contributor.Bio, Contributor.Expertise,
Contributor.Descr, Contributor.Skills
From Register, Contributor
WHERE Register.Reg_ID = Contributor.Reg_ID;

● Joining Mentor and Register to get the data of all Learners


SELECT Register.Reg_ID , Register.Username, Register.Age, Register.Email, Register.Contact,
Register.Languages, Register.U_role, Learner.Bio, Learner.Descr
From Register, Learner
WHERE Register.Reg_ID = Learner.Reg_ID;

Joining More Than Two Tables

41
● All Learners Feedbacks by joining Learner, Register and Feedback
SELECT Register.Reg_ID, Register.Username “LEARNERS”, Register.U_role, Learner.Lea_ID,
Feedback.Feedback_given
FROM Register, Learner, Feedback
WHERE Register.Reg_ID = Learner.Reg_ID AND Register.Reg_ID = Feedback.Reg_ID;

● Project details and contributor details joining Project_Contributor, Register and


Contributor
SELECT Project.Pro_ID, Project.Pro_name, Project.Pro_details,
Register.username"Contributors", Project_cont.Contribution
FROM Project,Register,Contributor,Project_cont
WHERE Project.Pro_ID = Project_cont.Pro_ID AND Project_cont.Con_ID = Contributor.Con_ID
AND Contributor.Reg_ID = Register.Reg_ID

Left Join:
● Joining Mentor and Project with outer join to see all the Mentors and their
Projects who have or don’t have projects
SELECT Mentor.Men_ID, Project.Pro_ID, Project.Pro_name, Project.Pro_details
FROM Mentor
LEFT JOIN Project
ON Project.Men_ID = Mentor.Men_ID;

42
● Joining Register,Mentor and Mentor_Followers with left join to see which
mentor have and which don’t have followers

SELECT Register.username "Mentor", Mentor.Men_ID, Mentor_follower.Lea_ID


"Learners", Mentor_follower.Con_ID"Contributors"
FROM Mentor
LEFT JOIN Mentor_follower
ON Mentor.Men_ID = Mentor_follower.Men_ID
LEFT JOIN Register
ON Register.Reg_ID = Mentor.Reg_ID

Right Join

43
SELECT Learner.Lea_ID, Query.Query_Ques
FROM Learner
RIGHT JOIN Query
ON Query.Lea_ID = Learner.Lea_ID;

SELECT Register.username"Learners",Learner.Lea_ID, Query.Query_Ques


FROM Learner
RIGHT JOIN Query
ON Query.Lea_ID = Learner.Lea_ID
RIGHT JOIN Register
ON Register.Reg_ID = Learner.Reg_ID
WHERE Register.u_role = "Learner";

Cross Join | Outer Join

SELECT Project.Pro_name, Mentor.M_ID


FROM Project
CROSS JOIN Mentor;

44
Joining With “Using” Clause:
● Joining project and project_followers
SELECT Project.Pro_ID, Project.Pro_name, Project_Follower.Lea_ID “Follower”
FROM Project JOIN Project_Follower
USING (Pro_ID);

Group Functions:

● MAX, MIN AND AVG Age of Users in the System


SELECT MAX(Age), MIN(Age), AVG(Age)
FROM Register;

● Total Learners in the system


SELECT COUNT(*)
FROM Register
WHERE U_role = 'Learner';

45
● Counting the no of projects done by mentor no 3
SELECT Count(*)
FROM Project
WHERE Men_id = 'M_003';

Group By Clause:
● Query to count how many contributor one project has using group by clause
SELECT pro_id, contribution, Count(Con_ID)
From project_cont
GROUP BY Pro_ID;

Having Clause:
● Finding projects that have contributor more than 2 using having clause
SELECT pro_id, contribution, Count(Con_ID) 'Contributors'
From project_cont
GROUP BY Pro_ID
HAVING Contributors>=2;

46
Subqueries
● User whos age is greater than “AmmaraKhan” using subquery
SELECT Reg_ID, Username
FROM Register
WHERE Age>
(SELECT Age
FROM Register
WHERE Username = 'AmmaraKhan');

Group Func In Subquery:


● Using group gunction in subquery to know the users greater than average age
SELECT Reg_ID, Username, Age, U_Role
From Register
WHERE Age>
(SELECT AVG(Age)
FROM Register);

47
Views
● Mentor 3 View of his/her projects
CREATE VIEW Pro_M_03
AS SELECT Pro_name, Pro_details
From Project
Where Men_ID = 'M_003';

SELECT *
FROM Pro_M_03;

● Creating view of the projects followed by learner having id “L_006”


CREATE VIEW Pro_F_06
AS SELECT Pro_ID
From Project_follower
Where Lea_ID = 'L_006';

SELECT *
FROM Pro_F_06;

Records Entered in the Tables:


All the records are in the record folder of the attached zip file.
48
49

You might also like