PRJ301 Workshop
PRJ301 Workshop
Duration: 75 minutes
1. Create database name Task_YourID (2 marks) on MS SQL Server, has a table with at
least 2 rows sample data. Student must write SQL script to create database for
submission.
This database is aim to manage ATM cards in a bank using SQL, you can create three
tables: User, Tasks and TaskAssigment:
Users Table:
The Users table will store information about the users who manage and complete tasks.
user_id: A unique identifier for each user.
username: The username of the user.
email: The email address of the user.
password: The hashed password for the user's login.
registration_date: The date when the user registered.
Tasks Table:
The Tasks table will store information about the tasks to be managed.
task_id: A unique identifier for each task.
title: The title of the task.
description: A description of the task.
created_date: The date when the task was created.
due_date: The date by which the task should be completed.
status: The status of the task (e.g., pending, in progress, completed).
TaskAssignments Table:
The TaskAssignments table will store information about which users are assigned to
which tasks.
assignment_id: A unique identifier for each task assignment.
task_id: The ID of the assigned task, referencing the task_id column in the Tasks
table.
user_id: The ID of the assigned user, referencing the user_id column in the Users
table.
assigned_date: The date when the task was assigned to the user.
complete_date: The date when the task was completed
Relationships:
The user_id column in the TaskAssignments table will reference the user_id
column in the Users table.
The task_id column in the TaskAssignments table will reference the task_id
column in the Tasks table.
Login Requirements:
A user must successfully log in using their email and password to manage and
complete tasks.
Non-users or failed login attempts should not be able to access the task
management system, only signup
Completing a Task:
When a user completes a task, the complete_date in the TaskAssignments table
should be updated.
The task’s status in the Tasks table should be updated to 'completed'.
Notice: Student must strictly follow all requirements as describe above for marking,
Any modification the requirement detail is not allowed and will get no mark!