Task 1
Task 1
Project Members:
1. Courses Table
Attributes:
o course_id (Primary Key – used to identify the course uniquely)
o course_code (used for storing the code of course offered)
o course_name (used for storing the name of course offered)
o instructor_name (used for storing the name of instructor teaching the course)
o academic_year (used for storing the information of year and semester (e.g fall,
spring, summer) of the course offered)
o semester (used for storing the Semester in which the course is offered)
Purpose: This table stores information about courses offered, including their unique
identifiers and instructors.
Foreign Keys: None.
2. Documents Table
Attributes:
o document_id (Primary Key – uniquely identifying any document)
o upload_date (used for storing the date document was uploaded)
o file_path (used for storing and fetching file via the reference file path of the
document)
o title (used for storing the title/name of the document offered)
o is_free (used for storing the Boolean value of true and false according to
accessibility of document)
o price (used for storing the price of the document)
o description (used for storing the brief description of document)
Purpose: Tracks uploaded documents and their details, such as availability and pricing.
Foreign Keys:
o department_id (Links to Departments table)
o user_id (Links to Users table via "Uploaded by")
3. Departments Table
Attributes:
o department_id (Primary Key)
o department_name (used for storing the name of department)
Purpose: Represents academic departments associated with courses and documents.
Foreign Keys:
o university_id (Links to University table)
4. University Table
Attributes:
o university_id (Primary Key)
o university_name (used for storing the name of university)
o campus_location (used for storing the campus location of the university)
Purpose: Stores details of universities offering courses and maintaining departments.
Foreign Keys: None
5. Users Table
Attributes:
o user_id (Primary Key)
o name (used for storing thename of user consisting of two attributes (first_name
and last_name )
o email (used for storing the email of the user)
o age (used for storing the age of the user)
o contact_no (used for storing the contact number of the user)
o password (used for storing the encrypted password of the user)
o bio (used for storing a brief biography of the user)
o join_date (used for storing the date the user joined the system)
o program (used for storing the academic program of the user, if applicable)
o semester (used for storing the current semester of the user, if applicable)
Purpose: Captures user information for students.
Foreign Keys:
o department_id (Links to Departments table via enrollment)
6. Wallet Table
Attributes:
o wallet_id (Primary Key – uniquely identifying each wallet)
o balance (used for storing the available balance in the wallet)
Purpose: Manages user wallet balances for transactions.
Foreign Keys:
o user_id (Links to Users table)
Attributes:
o log_id (Primary Key – uniquely identifying each action log)
o action_timestamp (used for storing the timestamp of the logged action)
o action_type (used for storing the type of action performed by the user)
o address (used for storing the IP or device address of the user performing the action)
Purpose: Records user actions within the system.
Foreign Keys:
o user_id (Links to Users table)
8. Loans Table
Attributes:
o loan_id (Primary Key – uniquely identifying each loan)
o request_date (used for storing the date when the loan was requested)
o approval_date (used for storing the date when the loan was approved)
o repayment_date (used for storing the date by which the loan should be repaid)
o amount (used for storing the loan amount requested or granted)
o status (used for storing the status of the loan, e.g., pending, approved, rejected)
Purpose: Tracks loans taken by users.
Foreign Keys:
o user_id (Links to Users table)
9. Notifications Table
Attributes:
o notification_id (Primary Key – uniquely identifying each notification)
o is_read (used for storing whether the notification has been read by the user)
o created_date (used for storing the creation date of the notification)
o message (used for storing the content of the notification)
Purpose: Manages notifications for users.
Foreign Keys:
o user_id (Links to Users table)
10. Document Stats Table
Attributes:
o stats_id (Primary Key – uniquely identifying each statistics entry)
o purchases (used for storing the total number of times the document was purchased)
o views (used for storing the total number of times the document was viewed)
Purpose: Tracks document analytics, such as views and purchases.
Foreign Keys:
o document_id (Links to Documents table)
Attributes:
o access_key_id (Primary Key – uniquely identifying each access key)
o access_key (used for storing the generated access key for a file)
o is_used (used for storing whether the access key has been used)
o date_created (used for storing the creation date of the access key)
o used_date (used for storing the date when the access key was used)
Purpose: Manages file access for users.
Foreign Keys:
o document_id (Links to Documents table)
Attributes:
o tag_id (Primary Key – uniquely identifying each tag)
o tag_name (used for storing the name of the tag)
Purpose: Stores tags for categorizing documents and discussions.
Foreign Keys: None explicitly listed.
Attributes:
o document_id (Foreign Key to Documents table)
o tag_id (Foreign Key to Tags table)
Purpose: Links documents with tags.
Attributes:
o discussion_id (Primary Key – uniquely identifying each discussion)
o is_read (used for storing whether the discussion has been read by the user)
o created_date (used for storing the creation date of the discussion)
o message (used for storing the content of the discussion)
Purpose: Facilitates user discussions.
Foreign Keys:
o user_id (Links to Users table)
Attributes:
o discussion_id (Foreign Key to Discussions table)
o tag_id (Foreign Key to Tags table)
Purpose: Links discussions with tags.
Attributes:
o comment_id (Primary Key – uniquely identifying each comment)
o comment_date (used for storing the date when the comment was made)
o comment_text (used for storing the text of the comment)
Purpose: Tracks comments made on discussions.
Foreign Keys:
o discussion_id (Links to Discussions table)
Attributes:
o transaction_id (Primary Key – uniquely identifying each transaction)
o remaining_balance (used for storing the balance remaining after the transaction)
o transaction_date (used for storing the date of the transaction)
o amount (used for storing the amount involved in the transaction)
o transaction_type (used for storing the type of transaction, e.g., credit, debit)
Purpose: Records all monetary transactions.
Foreign Keys:
o user_id (Links to Users table)
Relations
Departments - Courses
Departments - Universities
Departments-Users
Users - Documents
Documents - Tags
Discussions - Tags
Users - Notifications
Users – Wallet
Users – Loans
Users – Discussion_comments
Users – Discussion
Users – Transaction
Courses – Documents