You are on page 1of 24

VIDEOGAME DATABASE SYSTEM

CHAPTER 1
INTRODUCTION
1.1 Overview of the project

With the increase in interaction with the 2D world, videogames have become a common
thing among adults and youngsters. This project allows users to view games and information
regarding them based on their liking. Whether it is a PC, XBOX, PS game or a Racing,
Arcade game, the database is a one stop for details regarding them.
Videogame database is a platform that allows users to add games, developers and
publisher information. It is a simple UI (user interface) system, there is a requirement to
maintain all the customers detail records to achieve that there is a need to use a system which
will store and process all this data. The user should register or maintain his/her profile in
order to access the website.
After registration the user will be provided by his/her own account feed in database with
a unique username and password. The website is simple to use and it is a user-friendly
application the role of the application is to maintain data and process it whenever it is needed.

The database consists of six tables with its specific attributes:-


1. UserCred
2. Game
3. GameGenre
4. Publisher
5. Developer
6. Sys
7. PlatCount

Each table as unique key attribute named as primary keys, a relationship between the
tables/entities are drawn using a foreign key and resolved into a tables/entities.

Department of CSE, SJBIT 2019-20 1


VIDEOGAME DATABASE SYSTEM

1.2 DBMS
A database-management system (DBMS) is a computer-software application that interacts
with end-users, other applications, and the database itself to capture and analyse data. A
general-purpose DBMS allows the definition, creation, querying, update, and administration
of database. A database is not generally portable across different DBMSs, but different
DBMSs can Inter-operate by using standards such as SQL and ODBC or JDBC to allow a
single application to work with more than one DBMS.

The DBMS essentially serves as an interface between the database and end users or
application programs, ensuring the data is consistently organized and remains easily
accessible. A DBMS provides concurrency, security, data integrity, consistency, controls
redundancy and data independence. In this project the Relational DBMS (RDBMS) used in
MySQL. It is open source software which uses SQL (Structural Query Language) which is a
standard language for storing, manipulating and retrieving data in databases.

1.3 JSP and Java Servlets

 JSP stands for Java Server Pages.


 It is a server side technology.
 It is used for creating web application.
 It is used to create dynamic web content.
 In this JSP tags are used to insert JAVA code into HTML pages.
 It is an advanced version of Servlet Technology.
 It is a Web based technology helps us to create dynamic and platform independent web
pages.
 In this, Java code can be inserted in HTML/ XML pages or both.
 JSP is first converted into servlet by JSP container before processing the client’s
request.
 They are easy to maintain.
 No recompilation or redeployment is required.
 JSP has access to entire API of JAVA.
 JSP are extended version of Servlet.

Department of CSE, SJBIT 2019-20 2


VIDEOGAME DATABASE SYSTEM

CHAPTER 2
DESIGN
2.1 REQUIREMENTS AND CONSTRAINT
 Feature to view games based on platform or genre
 Feature to sign up
 Feature to login
 Feature to add publisher details
 Feature to add developer details
 Feature to add game details
 Feature to view details of games, publishers or developers

2.2 ENTITIES

Entity Description

UserCred Contains user information and credentials.

Game Contains details on games.

GameGenre Contains genres for each game.


(Multivalued attribute)

Developer Contains developer information.

Publisher Contains publisher information.

Sys Contains System information on which the


game runs.

PlatCount Contains count of platform games.


(Handled using triggers)

Department of CSE, SJBIT 2019-20 3


VIDEOGAME DATABASE SYSTEM

2.3 REQUIREMENTS SPECIFICATION

2.3.1 Hardware Requirements


Hardware components needed:

• Processor: Pentium IV or above


• RAM - 2GB or more
• Hard Disk - 2 GB or more

2.3.2 Software Requirements


Softwares used:

• Operating System : Windows OS,


• Text Editor : Sublime Text
• Server : Apache Tomcat
• DBMS : My SQLI 7.1
• IDE : Eclipse

Technologies used:

• Front End - HTML, CSS, JAVASCRIPT, BOOTSTRAP


• Back End - JAVA, MYSQL

Department of CSE, SJBIT 2019-20 4


VIDEOGAME DATABASE SYSTEM

2.4 ER DIAGRAM

This relationship diagram shows how the tables in the database are connected to each
other and how the controls flows from one table to another when some action triggered by the
user. It also shows the constraints on the database such as primary key constraints, foreign
key constraints and procedures and trigger. Entity Relationship Diagram also called as ER
Diagram.When documenting a system or process, looking at the system in multiple ways
increases the understanding of that system. ERD diagrams are commonly used in conjunction
with a data flow diagram to display the contents of a data store. They help us to visualize how
data is connected in a general way, and are particularly useful for constructing a relational
database.The database is normalized up to 3rd normal form. That is the tables in the database
has multimedia fields (attributes) and there will be one primary key in each table that
uniquely identifies the each tuple in the table.

Figure 2.1: ER Diagram for Videogame Database

Department of CSE, SJBIT 2019-20 5


VIDEOGAME DATABASE SYSTEM

2.5 SCHEMA DIAGRAM

The Schema Diagram gives us the information about the attributes in the table of the
database and how the given tables are related to each other. The term schema refers to the
organization of data as a blueprint of how the database is constructed (divided into database
tables in the case of relational databases). The formal definition of the database scheme is set
of formulas (sentences) called integrity constraints is imposed on the database.. Relational
schema shows references among fields in the databases. When a primary key is referenced in
another table in the database, it is called the foreign key. This is denoted by an arrow with the
head pointing at the referenced key attributes. A schema diagram helps organize values in the
database. It also gives an idea of what order the table should be created in. the following
diagram shows the schema diagram for the database.

Figure 2.2: Schema Diagram for Videogame Database

Department of CSE, SJBIT 2019-20 6


VIDEOGAME DATABASE SYSTEM

CHAPTER 3
IMPLEMENTATION
3.1 TECHNOLOGIES USED
FRONT END
HTML: Hypertext Mark-up Language (HTML) is the standard mark-up language for
creating web pages and web applications. With Cascading Style Sheets (CSS)
and JavaScript it forms a triad of cornerstone technologies for the World Wide Web. Web
browsers receive HTML documents from a web server or from local storage and render them
into multimedia web pages. HTML describes the structure of a web page semantically and
originally included cues for the appearance of the document.HTML elements are the building
blocks of HTML pages. With HTML constructs, images and other objects, such as forms,
may be embedded into the rendered page. It provides a means to create structured
documents by denoting structural semantics for text such as headings, paragraphs, lists, links,
quotes and other items. HTML elements are delineated by tags, written using angle brackets.
Tags such as <img/> and <input /> introduce content into the page directly. Others such
as <p>...</p> surround and provide information about document text and may include other
tags as sub-elements. Browsers do not display the HTML tags, but use them to interpret the
content of the page.

JSP: Java Server Page is a server-side scripting language designed primarily for web
development. Features of JSP:

 Coding in JSP is easy: - As it is just adding JAVA code to HTML/XML.


 Connection to Database is easier:-It is easier to connect website to database and
allows to read or write data easily to the database.
 Make Interactive websites: - In this we can create dynamic web pages which helps
user to interact in real time environment.

 Extension to Servlet :- as it has all features of servlets, implicit objects and custom
tags

Department of CSE, SJBIT 2019-20 7


VIDEOGAME DATABASE SYSTEM

BOOTSTRAP: Bootstrap is a front-end web framework that was created by Twitter for
faster creation of device responsive web applications. Bootstrap can also be understood
mostly as a collection of CSS classes that are defined in it which can simply be used directly.
It makes use of CSS, Javascript, jQuery etc. in the background to create style, effects and
actions for Bootstrap elements.

You might know that we use CSS for styling webpage elements and create classes and assign
classes to webpage elements to apply style on them. Bootstrap here makes the designing
simpler since we only have to include Bootstrap files and mention Bootstrap’s predefined
class names for our webpage elements and they will be styled automatically through
Bootstrap. Through this we get rid of writing our own CSS classes to style web page
elements. Most importantly Bootstrap is designed in such a way that it makes your website
device responsive. You can also use foundation framework for the same purpose. Bootstrap
make you free from writing lot of CSS code and it also saves your time that you spend for
designing the webpages.

CSS: Cascading Style Sheets is a style sheet language used for describing
the presentation of a document written in a markup language. Although most often used to set
the visual style of web pages and user interfaces written in HTML and XHTML, the language
can be applied to any XML document, including plain XML, SVG and XUL, and is
applicable to rendering in speech, or on other media. Along with HTML and JavaScript, CSS
is a cornerstone technology used by most websites to create visually engaging web pages,
user interfaces for web applications, and user interfaces for many mobile applications.

CSS is designed primarily to enable the separation of presentation and content, including
aspects such as the layout, colors, and fonts. This separation can improve
content accessibility, provide more flexibility and control in the specification of presentation
characteristics, enable multiple HTML pages to share formatting by specifying the relevant
CSS in a separate .CSS file, and reduce complexity and repetition in the structural content.

Department of CSE, SJBIT 2019-20 8


VIDEOGAME DATABASE SYSTEM

BACK END

APACHE: Apache Tomcat (sometimes simply "Tomcat") is an open source implementation


of the Java Servlet, JavaServer Pages and Java Expression
Language and WebSocket technologies. Tomcat provides a "pure Java" HTTP web
server environment in which Java code can run.

Tomcat is developed and maintained by an open community of developers under the auspices
of the Apache Software Foundation, released under the Apache License 2.0 license.

MYSQL: MySQL is an open-source relational database management system(RDBMS).Its


name is a combination of "My", the name of co-founder Michael Widenius's daughter, and
"SQL", the abbreviation for Structured Query Language. The MySQL development project
has made its source code available under the terms of the GNU General Public License, as
well as under a variety of proprietary agreements. MySQL was owned and sponsored by a
single for-profit firm, the Swedish company MySQL AB, now owned by Corporation. For
proprietary use, several paid editions are available, and offer additional functionality. MySQL
is written in C and C++. Its SQL parser is written in yacc, but it uses a home-
brewed analyzer. MySQL works on many system platforms.It including
Linux, MacOS, Microsoft Windows, Symbian, SunOS and A port of MySQL
to OpenVMS also exists

ECLIPSE: Eclipse is an IDE tool that helps us to develop software. An integrated


development environment (IDE) is a software application that provides comprehensive
facilities to computer programmers for software development. You can also write code in a
text editor and compile and execute from command line; but compared to a text editor,
eclipse provides many additional useful features to make the development of software easier
and faster. IDE normally consists of a source code editor, build automation tools and a
debugger. Most modern IDEs like eclipse also offer intelligent code completion features.

Eclipse contains a base workspace and an extensible plug-in system for customizing the
development environment. Eclipse is thus also a framework in addition to an IDE and can be
extended to have more features and functionalities through the use of plugins.

Department of CSE, SJBIT 2019-20 9


VIDEOGAME DATABASE SYSTEM

3.2 COMPONENT MODULES

 Module 1: UserCred
Register.html: Consists of HTML form to register user and store information and
credentials in Usercred table.

Login.html: Consists of HTML form that takes in user credentials to authorize login.

The usercred table is created using the code:


create table usercred(un varchar(30) primary key,
email varchar(30),
pw varchar(30) not null );
Description of attributes of usercred table:
 un - Username: is the user id for the user.
 email - Email id: is email address of the user.
 pw - Password: is the password associated with the user name.

Figure 3.1: Description of usercred table.

 Module 2 : Publisher
AddPublisher.jsp: Consists of a form to input publisher details that is going to be
stored in the publisher table.
The publisher table is created using the following code:
create table publisher(pname varchar(30) primary key,
padd varchar(50));
Description of attributes of publisher table:
 pname - Publisher name: is the name of publishing company.
 padd - Publisher address: is the location of publishing company.

Figure 3.2: Description of publisher table.

Department of CSE, SJBIT 2019-20 10


VIDEOGAME DATABASE SYSTEM

 Module 3 : Game
AddGame.jsp: Consists of form to insert game details.
The game table is created using the code:
create table game(title varchar(30) primary key,
year decimal(4),
pname varchar(30) references publisher(pname));
Description of attributes of game table:
 Title - is the name of the game.
 year - is the year in which the game was released.
 pname - name of the publishing company.

Figure 3.3: Description of game table.

 Module 4: GameGenre
AddGame.jsp: Contains form with checkbox for multivalued attribute genre.
The GameGenre table is created using the code:
create table gamegenre(gname varchar(30) references game(title),
genre varchar(15),
primary key(gname,genre));
Description of attributes of gamegenre table:
 gname - name of the game or the title.
 genre - the genre or category of the game (multivalued attribute).

Figure 3.4: Description of gamegenre table.

Department of CSE, SJBIT 2019-20 11


VIDEOGAME DATABASE SYSTEM

 Module 5: Sys
AddGame.jsp: Consists of form to add systems on which the game runs.
The sys table is created using the code:
create table sys(gname varchar(30) references game(title),
plat varchar(10),
primary key(gname,plat),
arch cahr(3),
price decimal(5));
Description of attributes of sys table:
 gname - is the game name or title.
 plat - is the plat form on which the game runs like PC, Android etc.
 arch - is the architecture of the system like x32 or x64.
 price - is the price of the game for that platform.

Figure 3.5: Description of sys table.

 Module 6: PlatCount
The PlatCount table is created using the code:
create table platcount(plat varchar(10) primary key,
num int);
Description of attributes of platcount table:
 plat - the platform name.
 num - the number of games in that platform.(Triggered update)

Figure 3.6: Description of platcount table.

Department of CSE, SJBIT 2019-20 12


VIDEOGAME DATABASE SYSTEM

 Module 7: Developer
AddDeveloper.jsp: Consists of a form to add developer details.
The developer table is created using the code:
create table developer(did int not null auto_increment primary key,
dname varchar(30),
pname varchar(30) references publisher(pname) on delete
cascade,
gname varchar(30) references game(title) on delete cascade);
Description of attributes of developer table:
 did - Developer id.
 dname - Developer name.
 pname - Name of the publisher the developer works for.
 gname – The game the developer is working on.

Figure 3.7: Description of developer table.

 Stored Procedure
A procedure (often called a stored procedure) is a subroutine like a subprogram in a
regular computing language, stored in database. There are many useful applications of
SQL procedures within a database or database application architecture. SQL
procedures can be used to create simple scripts for quickly querying transforming,
updating data, generating basic reports, improve application performance,
modularizing applications, and improve overall database design, and database
security.
The following stored procedure is used to retrieve all games that are of platform as
inputted into the procedure as a parameter. The procedure joins tables game and sys
and retrieves information regarding those of the selected platform.

Department of CSE, SJBIT 2019-20 13


VIDEOGAME DATABASE SYSTEM

Figure 3.8: Stored procedure platgame.

 Trigger
Triggers are stored programs, which are automatically executed or fired when some
event occurs. Triggers are written to be executed in response to any of the following
events. A database manipulation (DML) statement (DELETE, INSERT, or UPDATE)
or a database definition (DDL) statement (CREATE, ALTER, or DROP).
The following two triggers are those implemented in the database:
 t1 - To increase the count of platform game after insertion on sys table:
create trigger t1 after insert on sys
for each row
update platcount
set num=num+1
where platcount.plat=new.plat;
 t2 - To decrease the count of platform game before deletetion on sys table:
create trigger t2 before delete on sys
for each row
update platcount
set num=num-1
where platcount.plat=old.plat;

Figure 3.9: List of triggers in database.

Department of CSE, SJBIT 2019-20 14


VIDEOGAME DATABASE SYSTEM

3.3 Connection to database:

The database is connected to the front end html using jsp, the code for database connection is
shown below.

Class.forName("com.mysql.jdbc.Driver");
Connection con =DriverManager.getConnection(url, u, p);
PreparedStatement st1=con.prepareStatement("insert into usercred values(?,?,?);”);
st1.setString(1, un);
st1.setString(2, email);
st1.setString(3, pw);
st1.executeQuery();
PreparedStatement st2=con.prepareStatement("select * from usercred;”);
ResultSet rs = st2.executeQuery();

Department of CSE, SJBIT 2019-20 15


VIDEOGAME DATABASE SYSTEM

CHAPTER 4
TESTING

System testing of software or hardware is testing conducted on a complete, integrated system


to evaluate the system's compliance with its specified requirements. Testing is the process
used to help identify correctness, completeness, security and quality of developed software.
This includes executing the program with the intent of finding errors. It is important to
distinguish between faults and failures. Software testing can provide objective, independent
information about the quality of software and risk of its failure to users or sponsors. It can be
conducted as soon as executable software (even if partially complete) exists. Most testing
occurs after system requirements have been defined and then implemented in testable
programs. System testing falls within the scope of black-box testing, and as such, should
require no knowledge of the inner design of the code or logic.

Department of CSE, SJBIT 2019-20 16


VIDEOGAME DATABASE SYSTEM

CHAPTER 5
SNAPSHOTS

Figure 5.1: Login Page.

Figure 5.2: Registration Page.

Department of CSE, SJBIT 2019-20 17


VIDEOGAME DATABASE SYSTEM

Figure 5.3: Home.jsp – View games by platform or genre.

Figure 5.4: Home Page. (Before Login)

Figure 5.5: Home Page. (After Login)

Figure 5.6: Home Page. (After Login)

Department of CSE, SJBIT 2019-20 18


VIDEOGAME DATABASE SYSTEM

Figure 5.7: AddPublisher.jsp – To add publishers.

Figure 5.8:Retrieve.jsp for displaying Publisher table.

Department of CSE, SJBIT 2019-20 19


VIDEOGAME DATABASE SYSTEM

Figure 5.9: AddGame.jsp – To add games, genre and system details.

Figure 5.10:Retrieve.jsp for displaying game table.

Department of CSE, SJBIT 2019-20 20


VIDEOGAME DATABASE SYSTEM

Figure 5.11: AddDeveloper.jsp – To add developer details.

Figure 5.12:Retrieve.jsp for displaying developer table.

Department of CSE, SJBIT 2019-20 21


VIDEOGAME DATABASE SYSTEM

Figure 5.13: Details.jsp – To display all information regarding a game.

Figure 5.14: RetrievePlatform.jsp – To display games of platform type PS4

Department of CSE, SJBIT 2019-20 22


VIDEOGAME DATABASE SYSTEM

CHAPTER 6
CONCLUSION

Our project is only a humble venture to satisfy the needs to manage their project
work. Several user friendly coding also have adopted. This package shall prove to be a
powerful package in satisfying all the requirements of the videogame database. The objective
of a software planning is to provide a framework that enables the manager to make
reasonable estimates made within a limited time frame at the beginning of the software
project and should be updated regularly as the project progresses.
The website Videogame Database provides an organized system to add games,
publishers and developer details. This reduces the time taken for the person to add them
manually.

Department of CSE, SJBIT 2019-20 23


VIDEOGAME DATABASE SYSTEM

BIBLIOGRAPHY
[1]. Fundamentals of Database systems, Ramez Elmasri and Shamkant B.Navathe, 7th edition,
2017, Pearson.
[2]. Database Management System, Ramakrishnan, Gehrke, 3rd edition, 2017, McGraw Hill.
[3]. Silberschatz Korth and Sudarshan, Database Sysetm concepts, 6th edition, McGraw Hill,
2013.
[4]. Apache Tutorials
http://httpd.apache.org/docs/2.0/misc/tutorials.html
[5]. W3Schools
https://www.w3schools.com/
[6]. Stack OverFlow
http://stackoverflow.com
[7]. MySQL Tutorial
www.mysqltutorial.org

Department of CSE, SJBIT 2019-20 24

You might also like