









Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!










The database system should be able to handle the day-to-day operational activities of the SmartMovers Transport Company, which transports chemical products on behalf of registered customers. The system should be able to store and manage information about customers, including their unique customer numbers and details. The system should be able to record information about each transport operation, called a "job," including the pickup and delivery locations, the unique job number, and the unique numbers assigned to each load. The system should be able to store information about the transport units used for each job, including the lorry, driver, assistant, and container. The system should be able to calculate the payment for each job based on the customer type, product type (No Risk or High Risk), and load type (small, medium, or large). The system should be able to manage the transport operations from the 9 regional depots, including the allocation of jobs to individual depots and the management of the transport units assigned to each depot. The system should be able to provide the required information for management decision-making and to handle daily operations efficiently and effectively.
The entities and attributes identified in the given scenario are:
Customer CustomerID (Primary Key) CustomerName CustomerType (Category1, Category2, Category3)
ContactDetails
Job
JobID (Primary Key) PickupLocation DeliveryLocation CustomerID (Foreign Key referencing Customer) ProductType (No Risk, High Risk)
LoadType (Small, Medium, Large)
Load
LoadID (Primary Key) JobID (Foreign Key referencing Job)
ContainerID (Foreign Key referencing Container)
Container
ContainerID (Primary Key) TrailerID (Foreign Key referencing Trailer)
ChemicalProduct
Trailer
TrailerID (Primary Key)
LorryID (Foreign Key referencing Lorry)
Lorry
LorryID (Primary Key) DriverID (Foreign Key referencing Driver) AssistantID (Foreign Key referencing Assistant)
DepotID (Foreign Key referencing Depot)
Driver
DriverID (Primary Key) DriverName
DriverContact
Assistant
AssistantID (Primary Key) AssistantName
AssistantContact
Depot
DepotID (Primary Key) DepotLocation
The relationships between the entities are:
One-to-Many relationship between Customer and Job : A customer can have multiple jobs, but each job is associated with only one customer.
Trailer
TrailerID (Primary Key)
LorryID (Foreign Key referencing Lorry)
Lorry
LorryID (Primary Key) DriverID (Foreign Key referencing Driver) AssistantID (Foreign Key referencing Assistant)
DepotID (Foreign Key referencing Depot)
Driver
DriverID (Primary Key) DriverName
DriverContact
Assistant
AssistantID (Primary Key) AssistantName
AssistantContact
Depot
DepotID (Primary Key) DepotLocation
The provided logical design is in the Third Normal Form (3NF), as it meets the following criteria:
First Normal Form (1NF) : All attributes in the tables are atomic, and there are no repeating groups. Second Normal Form (2NF) : All non-key attributes are fully dependent on the primary key, and there are no partial dependencies. Third Normal Form (3NF) : All non-key attributes are independent of each other and depend only on the primary key.
No further normalization is required, as the logical design is already in 3NF.
The user interface for the database system can be designed using wireframes or any interface-designing tool. The user interface should include the following features:
Data Entry Forms : Forms for entering and updating customer, job, load, container, trailer, lorry, driver, assistant, and depot information. Data Retrieval : Interfaces for querying and retrieving information from the database, such as job details, customer information, and transport unit assignments. Data Validation : Mechanisms to validate the data entered into the system, such as ensuring that customer types are valid, load types are within the allowed range, and that foreign key relationships are maintained.
The following data validation mechanisms can be implemented in the database system:
Data Type Validation : Ensure that the data entered into each field matches the expected data type (e.g., integer for numeric fields, text for character fields). Range Validation : Ensure that the values entered for certain fields, such as load type, are within the allowed range (e.g., small, medium, or large). Referential Integrity Validation : Ensure that foreign key relationships are maintained, such as ensuring that a job is associated with a valid customer, a load is associated with a valid job, and a lorry is associated with a valid depot. Uniqueness Validation : Ensure that certain fields, such as customer ID and job ID, are unique within the database. Null Value Validation : Ensure that required fields, such as customer name and contact details, are not left blank.
These validation mechanisms can be implemented using database constraints, such as data type constraints, check constraints, and foreign key constraints, as well as through the user interface design.
The provided design (ER Model and Logical Design) effectively represents the identified user and system requirements for the SmartMovers Transport Company database system. The design includes the necessary entities and relationships to handle the day-to-day operational activities, such as managing customer information, recording job and load details, and tracking the transport units used for each job. The design also includes features to support management decision-making, such as the ability to calculate payments based on customer type, product type, and load type.
Data Normalization Explanation
Database normalization is a method of organizing data in a database. It involves decomposing a table into smaller tables and defining relationships between them. The goal of normalization is to reduce data redundancy and eliminate anomalies, such as update anomalies, insertion anomalies, and deletion anomalies.
There are four main normal forms used in database normalization:
First Normal Form (1NF) : The database is in 1NF if it contains no repeating groups and all attributes are atomic (single-valued). Second Normal Form (2NF) : The database is in 2NF if it is in 1NF and all non-key attributes are fully dependent on the primary key. Third Normal Form (3NF) : The database is in 3NF if it is in 2NF and all non-key attributes are not transitively dependent on the primary key. Boyce-Codd Normal Form (BCNF) : The database is in BCNF if it is in 3NF and there are no partial dependencies.
Normalization of the Provided Logical Design
The provided logical design in Task 1.1 appears to be in Third Normal Form (3NF). There are no obvious anomalies or partial dependencies present in the design.
Data validation is the process of checking the accuracy and quality of data before using, importing, or processing it. Various types of validation can be performed depending on the target constraints or objectives.
Some common data validation mechanisms include:
Field-level Validation : Checking the data type, format, and range of individual fields. Referential Integrity Validation : Ensuring that foreign key values correspond to valid primary key values in related tables. Business Rule Validation : Enforcing specific business rules or constraints, such as checking for duplicate records or ensuring that certain fields are not null. Cross-field Validation : Validating the relationship between multiple fields, such as ensuring that a start date is earlier than an end date. Validation at the User Interface : Providing immediate feedback to users when they enter invalid data, and guiding them to correct the errors.
The specific data validation mechanisms to be implemented would depend on the requirements and design of the database system.
The relational database system should be developed using SQL DDL (Data Definition Language) statements, based on the ER diagram and logical database design created in the previous tasks.
The database should include the necessary tables, columns, data types, primary keys, and foreign keys to meet the user and system requirements. Additionally, a suitable IDE (Integrated Development Environment) should be used to create a simple interface for inserting, updating, and deleting data in the database.
The usage of DML (Data Manipulation Language) should be explained, with at least one single example per each case (SELECT, UPDATE, and DELETE) from the developed database. The selected queries should be meaningful and relevant to the given scenario.
The importance of security mechanisms for the database should be explained, and proper security mechanisms (e.g., user groups, access permissions) should be implemented in the developed database.
The usage of the following SQL statements should be explained with examples from the developed database:
GROUP BY ORDER BY HAVING BETWEEN WHERE
A suitable test plan should be provided to test the system against user and system requirements. Relevant test cases for the implemented database should also be provided, including expected results in a tabular format and screenshots of the actual results.
The selected test data in Task 3.1(b) should be explained in terms of how it can be used to improve the effectiveness of testing.
sql create table Product (Product_id varchar(50) not null, Product_name varchar(50) not null, Product_type varchar (20) not null, Quantity varchar(100) not null, Manufacture_date date not null, Expiry_date date not null, primary key (Product_id));
sql create table Jobs (Job_id varchar (50) not null, Start_location varchar(50) not null, End_location varchar (50) not null, Product_id varchar(50) not null foreign key(Product_id) references Product(Product_id), Job_date date not null, primary key(Job_id));
Activity 1.
Before developing the database, a database designer must design an ER diagram and a logical design according to the requirements of the user and the system. An ERD serves two general purposes. The first is to design the project long before we start designing the tables in the database. Secondly, during the requirements collection phase (user and system), it helps future database users to explain how we intend to organize the data and why. Most people are not very technical, so an ERD can explain to them easily how this database will be created. The logical design is to explain more details than the ERD. It shows technical details, such as the primary key, the foreign key, and the total number of tables that will be created in normal form.
Smart Movers asked the database developer to create tables to record the necessary details, such as transport unit, client, work, product, payment, and information. Each table can be linked to another table according to certain specifications, and the database designer connects the appropriate tables with the appropriate relationships. Most importantly, each table must contain unique details for the requirements database designer. A primary key is provided for each table.
Activity 2
create table Customers (Customer_id varchar(50) not null, category varchar(20) not null, first_name varchar(50) not null, last_name varchar(50) not null, nic_no varchar(20) not null, address_ varchar(50) not null, mobile_no varchar (20)not null, telephone_no varchar (50) not null, email varchar(50)null, primary key (Customer_id)); --Product table create table Product (Product_id varchar(50) not null, Product_name varchar(50) not null, Product_type varchar (20) not null, Quantity varchar(100) not null, Manufacture_date date not null, Expiry_date date not null, primary key (Product_id)); --Jobs table create table Jobs (Job_id varchar (50) not null, Start_location varchar(50) not null, End_location varchar (50) not null, Product_id varchar(50) not null foreign key(Product_id) references Product(Product_id), Job_date date not null, primary key(Job_id)); --Depot table create table Depot (Depot_id varchar(50) not null, Region varchar(50)not null, Job_id varchar(50)not null foreign key(Job_id) references Jobs(Job_id), depot_date date not null, primary key(Depot_id)); --Transport table create table Transport (Transport_id varchar(50) not null, Driver_name varchar(50) not null, Driver_id varchar(50) not null, Lorry_type varchar(50) not null, Customer_id varchar(50) not null Foreign key(Customer_id) references Customers(Customer_id), Job_id varchar(50)not null foreign key(Job_id) references Jobs(Job_id) , Depot_id varchar(50) not null foreign key(Depot_id) references Depot(Depot_id) , Transpot_date date not null, primary key(Transport_id)); --Payments table create table Payments (Payment_id varchar(50) not null, Customer_id varchar(50) not null Foreign key(Customer_id) references Customers(Customer_id), Product_id varchar(50) not null foreign key(Product_id) references Product(Product_id), Job_id varchar(50)not null foreign key(Job_id) references Jobs(Job_id) , Payment_type varchar(15) not null, Payment_date date not null, Amount varchar(15) not null, primary key(Payment_id)); ``` ## 2.1.2 Provide evidence of the use of a suitable IDE to ## create a simple interface to insert, update and delete data ## in the database I have created a product form using Visual Studio 2012, an integrated development environment (IDE) from Microsoft. It is used to develop computer system programs and includes a code editor, code refactoring tools, a code profiler, forms designer for building GUI applications, web and class designer, and a database schema designer. The product form I created has save, search, update, and delete buttons, demonstrating the use of the IDE to create a simple interface for interacting with the database. **Delete/From/Where** : Used to remove data from the database. Example: DELETE FROM Customers WHERE Customer_id = 'C001'; **Activity 2.** ## 2.3.1 Explain how security mechanisms have been used and ## the importance of these mechanisms for the security of the ## database. Implement proper security mechanisms (e.g., ## user groups, access permissions) in the developed ## database. Database security is essential for any organization that stores sensitive data, such as client information, provider details, or other confidential data. Database security must address and protect the following: The data in the database The database management system (DBMS) Any related applications The physical or virtual database server and the underlying hardware The computing and/or network infrastructure used to access the database Proper database security is crucial to prevent data loss or compromise, which can have serious financial and reputational consequences for the organization. In my developed database, I have implemented security mechanisms by requiring users to enter a valid username and password to access the system. If the user enters incorrect login details, an error message will be displayed. This ensures that only authorized users can access the database, protecting the sensitive information stored within. Additionally, I can implement more advanced security measures, such as user groups and access permissions, to control the level of access each user or group has to the database and its various components. This allows for granular control over who can perform certain actions, such as inserting, updating, or deleting data, further enhancing the overall security of the database system. **SQL Statements and Examples** ## Group By The GROUP BY clause is a SQL command that is used to group rows that have the same values. It is often used in conjunction with aggregate functions (e.g., COUNT, SUM, AVG) to perform calculations on grouped data. **Example:** sql SELECT department, COUNT(*) AS num_employees FROM employees GROUP BY department; This query will group the employees by their department and count the number of employees in each department. ## Order By When you use the SELECT statement to query data from a table, the result set is not sorted in any order. To sort the result set, you use the ORDER BY clause. **Example:** sql SELECT * FROM customers ORDER BY name ASC; This query will return the customer records sorted in ascending order by the name column. ## Having The HAVING clause is used in conjunction with the GROUP BY clause to filter groups based on a specified condition. It is often used to filter the result set after the grouping has been performed. **Example:** sql SELECT department, COUNT(*) AS num_employees FROM employees GROUP BY department HAVING num_employees > 10; This query will return the departments that have more than 10 employees. ## Between The SQL BETWEEN condition allows you to easily test if an expression is within a range of values (inclusive). It can be used in a SELECT, INSERT, UPDATE, or DELETE statement. **Example:** sql SELECT * FROM orders WHERE order_date BETWEEN '2022-01-01' AND '2022-12-31'; This query will return all orders placed between January 1, 2022, and December 31, 2022. ## Where In The WHERE IN clause returns values that match values in a list or subquery. It is a shorthand for manipulating OR conditions. **Example:** sql SELECT * FROM products WHERE category IN ('Electronics', 'Clothing', 'Books'); This query will return all products that belong to the 'Electronics', 'Clothing', or 'Books' category. **Test Plan and Test Cases** ## Test Plan The following test plan is related to the Smart Mover's entire developed system: | Test ID | Test Case | Expected Outcome | | --- | --- | --- | | 01 | Login with correct Username & Password (User name: admin, Password: 123) | Display the Home page of admin | | 03 | Click the Signup button | Display the Signup form successfully | | 04 | Insert relevant details in correct cages and click save button | Record added successfully, message box appears, Click Ok to **Use good metrics:** Metrics are important for more than one reason in software testing projects. They can help you measure the progress, identify bottlenecks, and make informed decisions. **Write clear test cases:** Test cases are an important part of the software testing process. Testers on your team will be reliant on the information displayed to carry out their tasks, so it is crucial to write clear and comprehensive test cases. **Feedback and Recommendations** Based on the independent feedback collected from non-technical users and developers using surveys, questionnaires, and interviews, the following recommendations and suggestions can be made for improvements to the database solution: **Improve User Interface:** The feedback indicates that the user interface could be more intuitive and user-friendly. Simplify the layout, improve navigation, and ensure consistent styling across all forms and pages. **Enhance Data Validation:** Implement more robust data validation to ensure that users cannot enter invalid or incomplete data. This will help maintain data integrity and reduce errors. **Implement Role-based Access Control:** Introduce a role-based access control system to allow different levels of access and permissions for users based on their roles (e.g., admin, manager, employee). **Improve Reporting and Analytics:** Develop more comprehensive reporting and analytics capabilities to provide users with better insights into the data and business performance. **Enhance Security:** Strengthen the security measures, such as implementing two-factor authentication, regular backups, and secure data storage, to protect the system and its data from unauthorized access or breaches. **Provide Comprehensive Documentation:** Ensure that the user guide and technical documentation are thorough, up-to-date, and easily accessible to both end-users and support staff. **Implement Feedback Mechanism:** Establish a formal feedback mechanism, such as a customer support portal or a feedback form, to allow users to easily report issues, request new features, or provide suggestions for improvement. **Conduct Ongoing Maintenance and Updates:** Regularly review and update the system to address any bugs, security vulnerabilities, or changing business requirements. Ensure that the system remains reliable, efficient, and up-to-date. By addressing these recommendations, the database solution can be further enhanced to better meet the needs of both non-technical users and developers, improving its overall effectiveness and user satisfaction. **Gantt Chart** [Gantt chart image] **Harvard Referencing** Techopedia. (2015). Techopedia. [Online]. [19 June 2020]. Available from: https://www.techopedia.com/definition/4371/system-requirements Ulf eriksson. (2011). Reqtest. [Online]. [19 June 2020]. Available from: https://reqtest.com/requirements-blog/what-are-non-functional- requirements/ Guru99. (2020). Guru99. [Online]. Available from: https://www.guru99.com/ functional-vs-non-functional-requirements.html Jhigh. (2020). Jhigh. Available from: http://jhigh.co.uk/Higher/dbases/ anomalies.html Informatica. (2020). Available from: https://www.informatica.com/services- and-training/glossary-of-terms/data-validationdefinition.html Techopedia. (2017). Techopedia. Available from: https:// www.techopedia.com/definition/10283/data-validation W3schools. (2020). W3schools. Available from: https://www.w3schools.com/ sql/sql_check.asp Zentut. (2020). Zentut. Available from: https://dev.mysql.com/doc/refman/ 5.6/en/create-table-foreign-keys.html W3schools. (2020). W3schools. Available from: https://www.w3schools.com/ sql/sql_join.asp Web-development. (2010). Web-development. Available from: https:// www.brighthub.com/internet/web-development/articles/69872/ Techopedia. (2020). Techopedia. Available from: https:// www.techopedia.com/definition/29841/database-security