0% found this document useful (0 votes)
27 views34 pages

Added Please Check Nowgdgd

This document provides recommendations for database management and modeling for MaxRos Group. It discusses relational database models and normalization. Entity-relationship diagrams and UML class diagrams are recommended for data modeling. An open-source DBMS is suggested. Logical data modeling techniques are applied to MaxRos' portfolio of games. UML diagrams demonstrate modeling character, world, and gamer data. The report also covers data security, privacy, performance testing, and risk evaluation. Continual improvement, governance, backup, training, and user feedback are advised.

Uploaded by

firemmt
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
27 views34 pages

Added Please Check Nowgdgd

This document provides recommendations for database management and modeling for MaxRos Group. It discusses relational database models and normalization. Entity-relationship diagrams and UML class diagrams are recommended for data modeling. An open-source DBMS is suggested. Logical data modeling techniques are applied to MaxRos' portfolio of games. UML diagrams demonstrate modeling character, world, and gamer data. The report also covers data security, privacy, performance testing, and risk evaluation. Continual improvement, governance, backup, training, and user feedback are advised.

Uploaded by

firemmt
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 34

Title: Database Management Systems

and Modeling for MaxRos Group

Student Name:
Date:

0
Contents
Task 1................................................................................................................................................... 4
Executive Summary:.............................................................................................................................4
1. Introduction..................................................................................................................................... 4
1.1 Background:............................................................................................................................... 4
1.2 Purpose of the Report:...............................................................................................................4
2. Relational Database Models and Normalization..............................................................................4
2.1 Relational Database Models:......................................................................................................4
2.2 Importance of Normalization:....................................................................................................4
2.3 Benefits of Relational Models and Normalization:.....................................................................4
2.4 Implementation in MaxRos Group:............................................................................................5
3. Comparison of Database Modeling Languages................................................................................5
3.1 Entity-Relationship Diagram (ERD):............................................................................................5
3.2 UML Class Diagram:....................................................................................................................5
3.3 Data Definition Language (DDL):................................................................................................5
3.4 Critique and Comparison:...........................................................................................................5
3.5 Recommended Modelling Language for MaxRos Group:...........................................................5
4. Evaluation of Database Management Systems................................................................................5
4.1 Open Source vs. Vendor-Specific:...............................................................................................5
4.2 Recommended DBMS for MaxRos Group:.................................................................................6
5. Data Modelling Techniques..............................................................................................................6
5.1 Conceptual Data Modeming:......................................................................................................6
5.2 Logical Data Modeming:.............................................................................................................7
5.3 Normalization and Refinement:................................................................................................. 7
5.4 Application to MaxRos Group's Portfolio:..................................................................................7
5.4.2 Real-Time Strategy (RTS):....................................................................................................7
5.4.3 Massively Multiplayer Online (MMO) Games:....................................................................7
5.4.4 Cross-Game Data Integration:.............................................................................................7
5.4.5 Version Control and Data Migration:...................................................................................7
6. UML Notation for Logical Data Requirements..................................................................................8
6.1 Importance of UML in Data Modelling:......................................................................................8
6.2 UML Diagram Types:.................................................................................................................. 8
6.3 Example UML Diagrams for MaxRos Group...............................................................................8
6.3.1 UML Class Diagram - RPG Character Data:..........................................................................8

1
6.3.2 UML Class Diagram - RPG World Data:................................................................................9
6.3.3 UML Class Diagram for the gamer database:....................................................................10
7. Data Security and Privacy Considerations......................................................................................14
7.1 Data Encryption:.......................................................................................................................14
7.2 User Authentication and Authorization:...................................................................................15
7.3 Compliance with Data Regulations:..........................................................................................15
7.4 Data Auditing and Monitoring:.................................................................................................15
8. Conclusion...................................................................................................................................... 15
8.1 Recommendations for MaxRos Group.....................................................................................15
8.1.1 Continuous Improvement:................................................................................................ 15
8.1.2 Data Governance:..............................................................................................................16
8.1.3 Disaster Recovery and Backup:......................................................................................... 16
8.1.4 Training and Skill Development:........................................................................................16
8.1.5 User Feedback:..................................................................................................................16
Task 2................................................................................................................................................. 17
a. Database structure.....................................................................................................................17
b. Extracting data from table..............................................................................................................23
c Table and field level security........................................................................................................... 25
d. Functionality and performance test...............................................................................................27
e. Security Risk Evaluation..................................................................................................................30
References:........................................................................................................................................ 33

Figure 1................................................................................................................................................ 8
Figure 2................................................................................................................................................ 9
Figure 3.............................................................................................................................................. 10
Figure 4.............................................................................................................................................. 14
Figure 5.............................................................................................................................................. 14
Figure 6.............................................................................................................................................. 17
Figure 7.............................................................................................................................................. 21
Figure 8.............................................................................................................................................. 24
Figure 9.............................................................................................................................................. 24
Figure 10............................................................................................................................................ 25
Figure 11............................................................................................................................................ 25
Figure 12............................................................................................................................................ 26
Figure 13............................................................................................................................................ 26
Figure 14............................................................................................................................................ 27
Figure 15............................................................................................................................................ 27
2
Figure 16............................................................................................................................................ 28
Figure 17............................................................................................................................................ 28
Figure 18............................................................................................................................................ 29
Figure 19............................................................................................................................................ 29
Figure 20............................................................................................................................................ 30
Figure 21............................................................................................................................................ 31
Figure 22............................................................................................................................................ 31
Figure 23............................................................................................................................................ 32

Task 1

Executive Summary:
This report provides an overview detail about the database management systems (DBMS)
and modelling techniques which are important for managing the MaxRos Group's extensive
3
gaming portfolio in an efficient manner. It contains the importance of relational database
models and normalization process for providing reliability and efficiency features. It
compares different database modelling languages. It compares various DBMS options in
relation to open source and vendor-specific platforms. It uses the data modelling techniques
to create the logical data requirements, and uses the Unified Modelling Language (UML)
notation to find these requirements.

1. Introduction
1.1 Background:
MaxRos Group is very popular in the UK's gaming company. It provides different verities of
gaming experiences for all the audiences in the world. For managing their bigger gaming
portfolio, a robust database management systems and accurate data modelling techniques
need to be included. This report provides details about the importance of the database
management.

1.2 Purpose of the Report:


The goal of this report is to find how to use any specific computer system type for storing
the data. It is also called as relational database. It can manage the information using
normalization process. Normalization process ensures that the data is correct and the
system runs correctly.

2. Relational Database Models and Normalization


2.1 Relational Database Models:
Relational databases are the basic for the modern data management systems. They can
manage the data into tables which are structed called relations which consists of rows or
tuples and columns or attributes. Each table is a unique entity, and relationships between
the entities are created using the keys called foreign keys which refers the primary keys.
2.2 Importance of Normalization:
Normalization is the process for reducing the data redundancy and makes sure that there is
data integrity by managing the tables correctly. Normalization can be performed by
breaking the complex or bigger tables into smaller tables. This reduces anomalies like
insertion anomaly, update anomaly and deletion anomalies. Normalization will improve the
quality of data.
2.3 Benefits of Relational Models and Normalization:
Data Integrity: Data Integrity makes sure that the data is accuracy and data is consistent.
Reduced Data Redundancy: Data Redundancy reduces the storage space and reduces the
update anomalies.
Efficient Querying: It reduces the complex queries.
Scalability: It allows the addition of new data without any big changes.
Interoperability: Relational models are mostly used by different DBMS.
4
2.4 Implementation in MaxRos Group:
MaxRos Group should use a relational database model with correct normalization method
to make sure that there is reliability and efficiency of its gaming portfolio databases. Review
and maintenance of these databases are important for better performance.

3. Comparison of Database Modeling Languages


3.1 Entity-Relationship Diagram (ERD):
Entity-Relationship Diagram is a diagrammatic expression of the entities, their attributes and
the relationships between the attributes. It is generally used for conceptual and high-level
modeling.
3.2 UML Class Diagram:
UML class diagrams is the part of the Unified Modeling Language (UML). UML class diagram
provides a diagrammatic representation of the classes, attributes, methods and associations
between the classes. They can be used for both high-level and detailed modeling.
3.3 Data Definition Language (DDL):
DDL is not an SQL language which can be used for defining the database structures. It cab be
used for creating, modifying and managing the database objects like tables, indexes and
constraints.
3.4 Critique and Comparison:
ERDs are user friendly structural representation of the database but it may not have deep
knowledge on the complex databases.
UML class diagrams provides more comprehensive representation of the data structures.
DDL is important for using the models in the database.
3.5 Recommended Modelling Language for MaxRos Group:
UML class diagrams can be used for MaxRos Group's gaming portfolio because it has
versatility and represents the data structures.

4. Evaluation of Database Management Systems


4.1 Open Source vs. Vendor-Specific:

Open Source Vendor Specific:

Cost: Open-source DBMS like MySQL, Cost: Vendor-specific DBMS are Oracle
PostgreSQL and MongoDB can be used Database or Microsoft SQL Server which
freely which will be cost-effective for has cost for licensing. These costs
companies with budget constraints. cannot be paid by small or budget-
constrained companies.

5
Community Support: Open-source Support: Vendors provides
databases are active and passionate comprehensive support packages like
user communities. regular updates, patches, and technical
assistance. This can be important for
mission-critical applications where
downtime is not acceptable.

4.2 Recommended DBMS for MaxRos Group:


MySQL is popular open-source Relational Database Management System which is used in
various industries like the gaming sector. MySQL is considered a suitable choice due to
below reasons:
Extensibility: MySQL supports many user-defined functions, operators, and data types.
MySQL extensibility can be used for customizing the database to meet specific gaming-
related requirements.
Advanced Data Types: MySQL provides different data types. MySQL is used for storing and
querying complex data structures like gaming, character inventories and user preferences.
Complex Queries: MySQL has robust SQL capabilities which will be used for handling
complex queries, joins, aggregations and geospatial operations. MySQL provides spatial data
to support the Spatial Extensions.
Scalability and High Availability: MySQL can handle data loads and provides various options
for performing scaling and high availability. Software tools like MySQL Cluster and solutions
can provide scalability and fault tolerance.
Security: MySQL has security features like role-based access control, encryption and
authentication techniques. These features can provide security to the sensitive user data,
which is important in the gaming industry.
Cost Considerations: MySQL is an open-source DBMS and is cost effective in terms of
licensing.

5. Data Modelling Techniques


5.1 Conceptual Data Modeming:
Conceptual data modelling contains the high-level entities and relationships between the
entities without focusing on the database specifics.
5.2 Logical Data Modeming:
Logical data modelling converts the conceptual models into detailed and structured
representations. It contains the tables, columns, keys and relationships between the tables
by following the normalization principles.
5.3 Normalization and Refinement:
Normalization removes the redundancy in the logical data models and also ensuring the
data integrity. It transforms the tables to the highest normal form.

6
5.4 Application to MaxRos Group's Portfolio:
The data modelling techniques need to be applied to consider the data requirements of
different game types like the RPGs, RTS, and MMOs.
Each genre should have distinct data structures and relationships need to be considered in
the logical data model.
5.4.1 Role-Playing Games (RPGs):
In the Role-Playing Games the important elements are character progression, inventory
management and quest tracking. The data model should have entities like the Characters,
Inventory Items, Quests and Skills. Relationships between these entities need to be defined
to enable many gameplay techniques. For instance, a Character can have many Inventory
Items, and a Quest can be used with many Characters.
5.4.2 Real-Time Strategy (RTS):
Real-Time Strategy games mostly contains complex interactions between units, resources
and terrain. The data model should contain entities like Units, Resources, and Terrain.
Relationships should contain unit movements, resource gathering and terrain effects on the
gameplay. If the entities are correctly normalized then it can data from data anomalies
while managing these complex relationships.
5.4.3 Massively Multiplayer Online (MMO) Games:
Massively Multiplayer Online Games contains many players who plays at same time in a
shared virtual world. The data model should contain the player interactions, guilds, chat
systems and in-game economies. Entities like "Players," "Guilds," "Chat Messages," and
"Market Transactions" need to be included. Correct normalization contains efficient data
storage and retrieval process in the high traffic environments.
5.4.4 Cross-Game Data Integration:
MaxRos Group's portfolio contains more than 5,000 combinations of the game types. Data
interrogation is important to provide a good experience for users who engage with multiple
games. Higher level abstraction for the player accounts, achievements and virtual currency
needs to be included in the logical data model which is available across games. This needs
flexible relationships between the entities. Data structures is also required to accommodate
different game specific attributes (Greant & Newman, 2006).
5.4.5 Version Control and Data Migration:
It the games develops and if the game is released, data models need to be updated. MaxRos
Group should use version control techniques for their data models and should have a well-
defined process for moving the data from one version to another version. This makes sure
that the player's progress and the player's data are preserved during the updates and during
the modifications.

6. UML Notation for Logical Data Requirements


6.1 Importance of UML in Data Modelling:
UML diagram provides a standardized notation for documenting the requirements of the
data. It contains different diagram types like the class diagrams, activity diagrams and
sequence diagrams to represent different data systems.

7
6.2 UML Diagram Types:
Class Diagrams: It can be used for the data structures.
Use Case Diagrams: It depicts the system functionalities.
Activity Diagrams: It represents the flow of the data.
Sequence Diagrams: It illustrate the interactions between the data.
6.3 Example UML Diagrams for MaxRos Group
To identify the uses of UML notation for logical data requirements, below example for the
UML class diagrams can be used for the gaming portfolio of MaxRos Group. We can focus on
a simplified representation of RPG game data structures:
6.3.1 UML Class Diagram - RPG Character Data:

Figure 1

Diagram explanation:
The "Character" class identifies the player characters in RPGs.
"InventoryItem" identifies the items that the characters carry.
"Quest" represents the in-game quests that characters can use.
"Skill" represents the skills or abilities that the characters can gain.
The relationships between these classes are mentioned clearly by indicating that a character
can have multiple inventory items (DuBois, 2013).
Explanation:
UML Class Diagrams are used in the software development to represent the structure and
relationships between the components The model is designed to provide the clarity to how
the RPG character data is maintained in the gaming platform. It provides a diagrammatic
representation of the key components of the RPG character management.
Logical Data Modeling: It helps both the developers and stakeholders to understand about
the entities and their relationships in the RPG character system.

8
Component Identification: Each class in the diagram is an key component or entity inside
the RPG character system. For example, the "Character" class denotes the player characters,
"InventoryItem" denotes the items they carry, "Quest" denotes the in-game quests, and
"Skill" depends on the character abilities. This clear identification of components are
important for designing the database schema and application logic.
Relationships: The arrows and lines which connects the classes represents the relationships
between the classes. For example, the diagram shows that a character can have multiple
inventory items. This helps to understand how the RPG character data is structured.

6.3.2 UML Class Diagram - RPG World Data:

Figure 2

In this diagram:
The "World" class is the game world. The game world class contains different regions.
"Region" class represents the specific areas inside the game world.
"NPC" can be abbreviated as non-player characters. In NPC the characters can communicate
with each other.
"Creature" identified the creature’s character or enemies’ characters.
These diagrams provide a diagrammatic representation of key entities and their
relationships within the RPG games (Van Der Lans, 2007).

9
6.3.3 UML Class Diagram for the gamer database:

Figure 3

Implementation of the UML diagram in MySQL:


CREATE TABLE Gamers (
GamerID INT AUTO_INCREMENT PRIMARY KEY,
Username VARCHAR(255) NOT NULL,
Email VARCHAR(255) NOT NULL UNIQUE,
PasswordHash VARCHAR(64) NOT NULL,
RegistrationDate DATE,
LastLoginDate DATE,
AccountStatus ENUM('Active', 'Suspended', 'Banned') NOT NULL
);

-- Games table to store information about different games


CREATE TABLE Games (
GameID INT AUTO_INCREMENT PRIMARY KEY,
GameName VARCHAR(255) NOT NULL,
ReleaseDate DATE,
Genre VARCHAR(100),
Description TEXT
);

10
-- Achievements table to track in-game achievements
CREATE TABLE Achievements (
AchievementID INT AUTO_INCREMENT PRIMARY KEY,
GameID INT,
AchievementName VARCHAR(255) NOT NULL,
Description TEXT,
FOREIGN KEY (GameID) REFERENCES Games(GameID)
);

-- Transactions table to manage financial transactions


CREATE TABLE Transactions (
TransactionID INT AUTO_INCREMENT PRIMARY KEY,
GamerID INT,
GameID INT,
TransactionDate DATE,
Amount DECIMAL(10, 2) NOT NULL,
TransactionType ENUM('Purchase', 'Refund') NOT NULL,
FOREIGN KEY (GamerID) REFERENCES Gamers(GamerID),
FOREIGN KEY (GameID) REFERENCES Games(GameID)
);

-- Items table to manage in-game items


CREATE TABLE Items (
ItemID INT AUTO_INCREMENT PRIMARY KEY,
ItemName VARCHAR(255) NOT NULL,
ItemType VARCHAR(50),
Description TEXT
);

-- Inventory table to track gamer inventory


CREATE TABLE Inventory (
InventoryID INT AUTO_INCREMENT PRIMARY KEY,
GamerID INT,
ItemID INT,
Quantity INT NOT NULL,
FOREIGN KEY (GamerID) REFERENCES Gamers(GamerID),

11
FOREIGN KEY (ItemID) REFERENCES Items(ItemID)
);

-- Friends table to store gamer friendships


CREATE TABLE Friends (
FriendID INT AUTO_INCREMENT PRIMARY KEY,
GamerID1 INT,
GamerID2 INT,
FriendshipDate DATE,
FOREIGN KEY (GamerID1) REFERENCES Gamers(GamerID),
FOREIGN KEY (GamerID2) REFERENCES Gamers(GamerID)
);

CREATE TABLE Leaderboards (


LeaderboardID INT AUTO_INCREMENT PRIMARY KEY,
GameID INT,
GamerID INT,
Score INT,
Ranks INT,
LastUpdated datetime,
FOREIGN KEY (GameID) REFERENCES Games(GameID),
FOREIGN KEY (GamerID) REFERENCES Gamers(GamerID)
);

-- Chat Messages table to store messages


CREATE TABLE ChatMessages (
MessageID INT AUTO_INCREMENT PRIMARY KEY,
SenderID INT,
ReceiverID INT,
MessageContent TEXT,
Timestamp TIMESTAMP,
FOREIGN KEY (SenderID) REFERENCES Gamers(GamerID),
FOREIGN KEY (ReceiverID) REFERENCES Gamers(GamerID)
);

-- Notifications table to manage notifications


CREATE TABLE Notifications (
NotificationID INT AUTO_INCREMENT PRIMARY KEY,

12
GamerID INT,
NotificationText TEXT,
Timestamp TIMESTAMP,
IsRead BOOLEAN,
FOREIGN KEY (GamerID) REFERENCES Gamers(GamerID)
);

-- User Preferences table to store user settings


CREATE TABLE UserPreferences (
PreferenceID INT AUTO_INCREMENT PRIMARY KEY,
GamerID INT,
SettingName VARCHAR(255),
SettingValue VARCHAR(255),
FOREIGN KEY (GamerID) REFERENCES Gamers(GamerID)
);
CREATE TABLE GameSessions (
SessionID INT AUTO_INCREMENT PRIMARY KEY,
GamerID INT,
GameID INT,
StartTime TIMESTAMP,
EndTime TIMESTAMP,
FOREIGN KEY (GamerID) REFERENCES Gamers(GamerID),
FOREIGN KEY (GameID) REFERENCES Games(GameID)
);
CREATE TABLE PaymentTransactions (
TransactionID INT AUTO_INCREMENT PRIMARY KEY,
GamerID INT,
GameID INT,
TransactionDate TIMESTAMP,
Amount DECIMAL(10, 2) NOT NULL,
TransactionType ENUM('Purchase', 'Refund') NOT NULL,
PaymentGateway VARCHAR(255),
BillingInformation TEXT,
FOREIGN KEY (GamerID) REFERENCES Gamers(GamerID),
FOREIGN KEY (GameID) REFERENCES Games(GameID)
);

13
Figure 4

Figure 5

7. Data Security and Privacy Considerations


Effective data management also requires protecting the user data and user's data need to
be protected. MaxRos Group must prioritize the data security and privacy to gain gamer's
trust level.
7.1 Data Encryption:
Sensitive user information like the personal details and payment data need to be encrypted
using the transmission and storage techniques. Using the SSL/TLS protocols for the data in
transit and encryption makes sure that data is confidential and secure (Siahaan & Sianipar,
2019).

14
Rational: Data encryption is an important security technique which makes sure that the
sensitive data is confidential and secure. Hashing technique can encrypt the data which
cannot be read by the users easily. Only if the text is decrypted then a text can be read by
the users.
7.2 User Authentication and Authorization:
Strong user authentication techniques need to be included to prevent the unauthorized
access or hackers to access the database. Role-based access control makes sure that only
the authorized persons can perform certain actions on the data. Review and update should
be made regularly on the user access permissions to maintain the principle of least privilege.
Rational: Strong user authentication and role-based access control are important for
maintaining the system's security. User authentication techniques can be used to make sure
that the user is an authenticated user. Role-based access will limit the data access to specific
user's roles. This can prevent the data from the unauthorized users.
7.3 Compliance with Data Regulations:
The gaming industry should have data protection rules like the General Data Protection
Regulation (GDPR) in the European Union. MaxRos Group must make sure that they follow
these regulations, which contains the user consent for processing the data, by providing the
techniques for data deletion and maintaining the records of data processing activities.
Rational: GDPR is important to maintain the user's trust and avoid the legal consequences.
By using this regulations, MaxRos Group can protect the user's data. User consent for
processing the data. Compliance not only imporves the user's trust but also avoid the the
penalty risk.
7.4 Data Auditing and Monitoring:
A comprehensive auditing and monitoring tools need to be included to track the database
activity. This helps to identify and respond to the security breaches or suspicious activities.
Rational: Comprehensive auditing and monitoring tools are important for maintaining the
security of the system. These tools can identify the security breaches or suspicious activities.
The system can identify the security issues and tracks the data access and usage.

8. Conclusion
8.1 Recommendations for MaxRos Group
It is important for MaxRos Group to use an approach for the database management and
data modelling techniques along with the specific recommendations which is provided
throughout this report
8.1.1 Continuous Improvement:
MaxRos Group should use a culture to improve continuously in the database management
practices. Review and update data models should be made continuously to reflect the
changing requirements and game modifications. Database performance need to be
monitored and queries need to be monitored for more efficiency.
8.1.2 Data Governance:
Data governance practices need to be implemented to make sure the data quality and
compliance with regulations like the GDPR for user data and data security. Data stewards
need to be assigned and data ownership roles need to be defined.
15
8.1.3 Disaster Recovery and Backup:
Robust disaster recovery and backup plans need to be developed to protect against the data
loss. Backups and failover techniques (Gilmore, 1999) need to be considered to make sure
about the continuity of the business.
8.1.4 Training and Skill Development:
Investment should be made in the training and development of the skills for the database
administrators and developers. Development team should be updated with the latest trends
and best practices in the database management.
8.1.5 User Feedback:
Feedback needs to be collected from the game players to understand their preferences
about the data. User feedback can contain the data model refinements and system
improvements.
Finally, the MaxRos Group's extensive gaming portfolio's success depends on a combination
of the correct DBMS (PostgreSQL), effective data modelling techniques and a commitment
to continuous improvement and data governance. By following the recommendations in this
report, MaxRos Group can navigate to the complexities of the gaming industry and delivers
the exceptional gaming experiences to its global audience.

Task 2

16
a. Database structure

Figure 6

-- Gamers table to store gamer information


CREATE TABLE Gamers (
GamerID INT AUTO_INCREMENT PRIMARY KEY,
Username VARCHAR(255) NOT NULL,
Email VARCHAR(255) NOT NULL UNIQUE,
PasswordHash VARCHAR(64) NOT NULL,
RegistrationDate DATE,
LastLoginDate DATE,
AccountStatus ENUM('Active', 'Suspended', 'Banned') NOT NULL
);

-- Games table to store information about different games


CREATE TABLE Games (
GameID INT AUTO_INCREMENT PRIMARY KEY,
GameName VARCHAR(255) NOT NULL,

17
ReleaseDate DATE,
Genre VARCHAR(100),
Description TEXT
);

-- Achievements table to track in-game achievements


CREATE TABLE Achievements (
AchievementID INT AUTO_INCREMENT PRIMARY KEY,
GameID INT,
AchievementName VARCHAR(255) NOT NULL,
Description TEXT,
FOREIGN KEY (GameID) REFERENCES Games(GameID)
);

-- Transactions table to manage financial transactions


CREATE TABLE Transactions (
TransactionID INT AUTO_INCREMENT PRIMARY KEY,
GamerID INT,
GameID INT,
TransactionDate DATE,
Amount DECIMAL(10, 2) NOT NULL,
TransactionType ENUM('Purchase', 'Refund') NOT NULL,
FOREIGN KEY (GamerID) REFERENCES Gamers(GamerID),
FOREIGN KEY (GameID) REFERENCES Games(GameID)
);

-- Items table to manage in-game items


CREATE TABLE Items (
ItemID INT AUTO_INCREMENT PRIMARY KEY,
ItemName VARCHAR(255) NOT NULL,
ItemType VARCHAR(50),
Description TEXT
);

-- Inventory table to track gamer inventory


CREATE TABLE Inventory (
InventoryID INT AUTO_INCREMENT PRIMARY KEY,

18
GamerID INT,
ItemID INT,
Quantity INT NOT NULL,
FOREIGN KEY (GamerID) REFERENCES Gamers(GamerID),
FOREIGN KEY (ItemID) REFERENCES Items(ItemID)
);

-- Friends table to store gamer friendships


CREATE TABLE Friends (
FriendID INT AUTO_INCREMENT PRIMARY KEY,
GamerID1 INT,
GamerID2 INT,
FriendshipDate DATE,
FOREIGN KEY (GamerID1) REFERENCES Gamers(GamerID),
FOREIGN KEY (GamerID2) REFERENCES Gamers(GamerID)
);

CREATE TABLE Leaderboards (


LeaderboardID INT AUTO_INCREMENT PRIMARY KEY,
GameID INT,
GamerID INT,
Score INT,
Ranks INT,
LastUpdated datetime,
FOREIGN KEY (GameID) REFERENCES Games(GameID),
FOREIGN KEY (GamerID) REFERENCES Gamers(GamerID)
);

-- Chat Messages table to store messages


CREATE TABLE ChatMessages (
MessageID INT AUTO_INCREMENT PRIMARY KEY,
SenderID INT,
ReceiverID INT,
MessageContent TEXT,
Timestamp TIMESTAMP,
FOREIGN KEY (SenderID) REFERENCES Gamers(GamerID),
FOREIGN KEY (ReceiverID) REFERENCES Gamers(GamerID)
);

19
-- Notifications table to manage notifications
CREATE TABLE Notifications (
NotificationID INT AUTO_INCREMENT PRIMARY KEY,
GamerID INT,
NotificationText TEXT,
Timestamp TIMESTAMP,
IsRead BOOLEAN,
FOREIGN KEY (GamerID) REFERENCES Gamers(GamerID)
);

-- User Preferences table to store user settings


CREATE TABLE UserPreferences (
PreferenceID INT AUTO_INCREMENT PRIMARY KEY,
GamerID INT,
SettingName VARCHAR(255),
SettingValue VARCHAR(255),
FOREIGN KEY (GamerID) REFERENCES Gamers(GamerID)
);
CREATE TABLE GameSessions (
SessionID INT AUTO_INCREMENT PRIMARY KEY,
GamerID INT,
GameID INT,
StartTime TIMESTAMP,
EndTime TIMESTAMP,
FOREIGN KEY (GamerID) REFERENCES Gamers(GamerID),
FOREIGN KEY (GameID) REFERENCES Games(GameID)
);
CREATE TABLE PaymentTransactions (
TransactionID INT AUTO_INCREMENT PRIMARY KEY,
GamerID INT,
GameID INT,
TransactionDate TIMESTAMP,
Amount DECIMAL(10, 2) NOT NULL,
TransactionType ENUM('Purchase', 'Refund') NOT NULL,
PaymentGateway VARCHAR(255),
BillingInformation TEXT,
FOREIGN KEY (GamerID) REFERENCES Gamers(GamerID),
FOREIGN KEY (GameID) REFERENCES Games(GameID)
);

20
Figure 7

Insertion of sample rows:


-- Inserting data into the Gamers table
INSERT INTO Gamers (Username, Email, PasswordHash, RegistrationDate, LastLoginDate,
AccountStatus)
VALUES
('Player1', '[email protected]', 'hash123', '2023-01-01', '2023-01-10', 'Active'),
('Player2', '[email protected]', 'hash456', '2023-02-15', '2023-02-20', 'Suspended');

-- Inserting data into the Games table


INSERT INTO Games (GameName, ReleaseDate, Genre, Description)
VALUES
('Game A', '2022-11-15', 'Action', 'Description of Game A'),
('Game B', '2023-03-20', 'Adventure', 'Description of Game B');

-- Inserting data into the Achievements table


INSERT INTO Achievements (GameID, AchievementName, Description)
VALUES
(1, 'Achievement 1', 'Description of Achievement 1'),
(1, 'Achievement 2', 'Description of Achievement 2');

-- Inserting data into the Transactions table


INSERT INTO Transactions (GamerID, GameID, TransactionDate, Amount, TransactionType)

21
VALUES
(1, 1, '2023-03-01', 19.99, 'Purchase'),
(2, 2, '2023-03-05', 9.99, 'Purchase');

-- Inserting data into the Items table


INSERT INTO Items (ItemName, ItemType, Description)
VALUES
('Item 1', 'Weapon', 'Description of Item 1'),
('Item 2', 'Armor', 'Description of Item 2');

-- Inserting data into the Inventory table


INSERT INTO Inventory (GamerID, ItemID, Quantity)
VALUES
(1, 1, 5),
(2, 2, 3);

-- Inserting data into the Friends table


INSERT INTO Friends (GamerID1, GamerID2, FriendshipDate)
VALUES
(1, 2, '2023-02-01'),
(2, 1, '2023-02-01');

-- Inserting data into the Leaderboards table


INSERT INTO Leaderboards (GameID, GamerID, Score, Ranks, LastUpdated)
VALUES
(1, 1, 1000, 1, '2023-03-10 10:00:00'),
(1, 2, 900, 2, '2023-03-10 10:00:00');

-- Inserting data into the ChatMessages table


INSERT INTO ChatMessages (SenderID, ReceiverID, MessageContent, Timestamp)
VALUES
(1, 2, 'Hello, how are you?', '2023-03-12 15:30:00'),
(2, 1, 'Im good, thanks!', '2023-03-12 15:35:00');

-- Inserting data into the Notifications table


INSERT INTO Notifications (GamerID, NotificationText, Timestamp, IsRead)
VALUES
(1, 'New message received.', '2023-03-12 16:00:00', 0),
(2, 'Your achievement unlocked!', '2023-03-13 09:45:00', 1);

22
-- Inserting data into the UserPreferences table
INSERT INTO UserPreferences (GamerID, SettingName, SettingValue)
VALUES
(1, 'SoundVolume', '80%'),
(2, 'Language', 'English');

-- Inserting data into the GameSessions table


INSERT INTO GameSessions (GamerID, GameID, StartTime, EndTime)
VALUES
(1, 1, '2023-03-15 18:00:00', '2023-03-15 19:30:00'),
(2, 2, '2023-03-16 20:00:00', '2023-03-16 21:45:00');

-- Inserting data into the PaymentTransactions table


INSERT INTO PaymentTransactions (GamerID, GameID, TransactionDate, Amount, TransactionType,
PaymentGateway, BillingInformation)
VALUES
(1, 1, '2023-03-01 10:15:00', 19.99, 'Purchase', 'PayPal', 'Transaction ID: ABC123'),
(2, 2, '2023-03-05 11:30:00', 9.99, 'Purchase', 'Credit Card', 'Transaction ID: XYZ456');

b. Extracting data from table


-- Retrieve gamer profiles
SELECT * FROM Gamers;

Figure 8

23
-- Get game statistics for a specific gamer
SELECT * FROM Games WHERE GameID = 1;

Figure 9

-- List all achievements for a game


SELECT * FROM Achievements WHERE GameID = 1;

Figure 10

-- Retrieve transaction history for a gamer


SELECT * FROM Transactions WHERE GamerID = 1;

24
Figure 11

c Table and field level security


Table-Level Security: Based on the Database Management System table-level security can be
implemented using the user roles and permissions. Only authorized users can access and modify
specific tables.

Field-Level Security: Sensitive data should have field-level security to restrict the access to specific
fields inside the tables.

-- Create a role for sensitive data access


CREATE ROLE SensitiveDataAccess;

Figure 12

-- Grant SELECT permission on non-sensitive columns of the Gamers table to the


SensitiveDataAccess role
GRANT SELECT (GamerID, Username, RegistrationDate, LastLoginDate, AccountStatus) ON Gamers
TO SensitiveDataAccess;

25
Figure 13

-- Create a view to hide sensitive columns from non-privileged users


CREATE VIEW GamersView AS
SELECT GamerID, Username, RegistrationDate, LastLoginDate, AccountStatus
FROM Gamers;

Figure 14

d. Functionality and performance test


Functionality Testing: the database needs to be tested to make sure that the functions work as
expected. Data integrity, accuracy and consistency need to be verified. Various scenarios like the
user registration, score updates and transaction processing need to be tested.

Performance Testing: A heavy load of concurrent users and transactions can be simulated to assess
the performance of the database. Response time, query execution speed and resource utilization
can be tested. Indexes and queries need to be used for better efficiency.

1.

26
Basic Data Retrieval: To check whether the selection of the data from your tables run successfully,
run simple SELECT queries for various entities.
-- Example: Retrieve a list of gamers
SELECT * FROM Gamers;

Figure 15

2.
Data Insertion: Test data insertion by adding new rows to the tables.
-- Example: Insert a new gamer
INSERT INTO Gamers (Username, Email, PasswordHash, RegistrationDate, AccountStatus)
VALUES ('SampleUser', '[email protected]', 'hashedpassword', '2023-01-01', 'Active');

Figure 16

3.
Data Update: Verification is made to check whether updation of existing records works successfully.
-- Example: Update a gamer's account status
UPDATE Gamers
SET AccountStatus = 'Suspended'
WHERE GamerID = 1;

27
Figure 17

4.
Data Deletion: Verification is made to check whether data is deleted successfully.
-- Example: Delete a gamer
DELETE FROM Gamers
WHERE GamerID = 4;

Figure 18

5.
Transaction Testing: Financial transactions are tested.
-- Example: Record a purchase transaction
INSERT INTO Transactions (GamerID, GameID, TransactionDate, Amount, TransactionType)
VALUES (2, 1, '2023-02-15', 19.99, 'Purchase');

28
Figure 19

Performance Testing:
Query Performance: The execution time on the complex queries need to be measured using the
reports or joins, to make sure they meet performance requirements.
-- Example: Measure execution time of a complex query
SET STATISTICS TIME ON;
SELECT * FROM Gamers
JOIN Transactions ON Gamers.GamerID = Transactions.GamerID;
SET STATISTICS TIME OFF;

e. Security Risk Evaluation


Security Auditing: Regularly audit should be performed on the database to check the vulnerabilities
and potential threats. Intrusion detection and prevention systems need to be included to monitor
the unauthorized access.
Data Encryption: Encryption techniques need to be implemented for sensitive data to protect data
from any breaches.
Regular Backups: A backup database and disaster recovery plan need to include to prevent the data
loss.
Access Control: Continuously review is required to reduce the security risks.

1. Check if any unwanted privileges are available:


-- List users and their granted privileges
SELECT user, host, db, table_name, privilege_type
FROM information_schema.user_privileges;

2. Identify if any Open Ports and Network Configuration are available:


-- List open ports and network configuration
SHOW VARIABLES LIKE 'port';
SHOW VARIABLES LIKE 'bind_address';

29
Figure 20

3. Review the User Passwords:


-- List users and their password settings
SELECT user, host, authentication_string
FROM mysql.user;

Figure 21

4. Check if any Unsecured Tables and Views are available:


-- List tables and views with open access
SELECT table_name
FROM information_schema.tables
WHERE table_schema = 'your_database_name' AND table_privileges = '';

30
Figure 22

5. Review theFirewall Rules:


-- List firewall rules
SELECT host, db, user, command_type, argument
FROM mysql.user
WHERE host NOT LIKE 'localhost';

6. Audit Login Attempts:


-- Review recent failed login attempts
SELECT user, host, count(*) AS failed_attempts
FROM mysql.user
WHERE password_expired = 'Y'
GROUP BY user, host;

31
Figure 23

7. Check for SQL Injection Vulnerabilities:


-- Search for potential SQL injection vulnerabilities
SELECT *
FROM your_table
WHERE column_name LIKE '%''%';

References:
1. DuBois, P. (2013). "MySQL." Addison-Wesley. Retrieved from
https://books.google.co.in/books?
hl=en&lr=&id=JgFTUsIC0bUC&oi=fnd&pg=PT13&dq=mysql+tutorial&ots=Dt_IBMHDIf&si
g=naFoiomasY2P8RlCDkeEv2gU8X4&redir_esc=y#v=onepage&q=mysql%20tutorial&f=false

2. Gilmore, W. J. (1999). "Beginning MySQL Tutorial." Retrieved March 31, 2007, from
http://underpop.free.fr/m/mysql/intro/intro.pdf

32
3. Greant, Z., & Newman, C. (2006). "MySQL Phrasebook." Sams Publishing. Retrieved from
https://books.google.co.in/books?
hl=en&lr=&id=ZcDr7OU8AJYC&oi=fnd&pg=PR3&dq=mysql+tutorial&ots=nFkQc19tMi&si
g=-feFilS-dcuQ2lHhg73OVsGn4_Q&redir_esc=y#v=onepage&q=mysql%20tutorial&f=false

4. Merrall, G. (2005). "PHP/MySQL Tutorial." Retrieved January 14, from


http://www.dotnetspider.com/attachments/forum/273414-10558-PHP-My-SQL-
Tutorial.pdf31.pdf

5. Siahaan, V., & Sianipar, R. H. (2019). "LEARNING PyQt5: A Step by Step Tutorial to Develop
MySQL-Based Applications." Sparta Publishing. Retrieved from
https://books.google.co.in/books?
hl=en&lr=&id=hnmtDwAAQBAJ&oi=fnd&pg=PA1&dq=mysql+tutorial&ots=cN9u_auzfF&si
g=lViLI7C6jXUPgwnMN8ZEs8vbBqU&redir_esc=y#v=onepage&q=mysql%20tutorial&f=false

6. Van Der Lans, R. F. (2007). "SQL for MySQL Developers: A Comprehensive Tutorial and
Reference: A Comprehensive Tutorial and Reference." Pearson Education. Retrieved from
https://books.google.co.in/books?
hl=en&lr=&id=c5G42OHT96cC&oi=fnd&pg=PT34&dq=mysql+tutorial&ots=6ebEeC9OUW
&sig=XHHAnos23uYHZfuCgDz3Aw5yW9U&redir_esc=y#v=onepage&q=mysql
%20tutorial&f=false

33

You might also like