Professional Documents
Culture Documents
MeCoLr Report
MeCoLr Report
MeCoLr
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.
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
Contributor
Follow
• Learner can follow any contributor and Mentor. He can also follow
Project that are hosted by Mentor.
Feedback
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.
6
Work Break Structure:
-
1. Requirement Gathering 2 Days
7
13. Integrate System Module 2 Days 11, 12
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
Mentor Table:
Entity Integrity Men_ID
Contributor Table:
Learner Table:
28
Project Table:
Project_Follower Table:
Project_Cont Table:
Feedback Table:
29
Query Table:
Ans_Query Table:
Mentor_Follower Table:
Contr_Follower Table:
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:
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)
);
34
FOREIGN KEY (Pro_ID) REFERENCES Project(Pro_ID),
FOREIGN KEY (Lea_ID) REFERENCES Learner(Lea_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)
);
36
User Privileges:
37
Monitor and User Admin | Areeba Amir
38
Queries:
All Mentors
SELECT
Reg_ID , Username as “MENTORS”
FROM Register
WHERE U_role = ’Mentor’;
39
FROM Register
WHERE Age >27
AND U_role = ‘Mentor’;
Equijoin:
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;
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;
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
Right Join
43
SELECT Learner.Lea_ID, Query.Query_Ques
FROM Learner
RIGHT JOIN Query
ON Query.Lea_ID = Learner.Lea_ID;
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:
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');
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;
SELECT *
FROM Pro_F_06;