ArticlePDF Available
International Journal of Computer Applications (0975 8887)
Volume 174 No. 14, January 2021
A NoSQL Database about Customer Reviews
Paolino Di Felice
Dipartimento di Ingegneria
Industriale e dell’Informazione,
Università di L’Aquila (Italy)
Martina Marinelli, Gaetanino
Paolone, Francesco Pilotti
Gruppo SI S.c.a.r.l., 64100
Teramo (Italy)
Giovanni Valenza
Comit S.r.l., 00193 Roma (Italy)
Small and medium-sized enterprises (SMEs) are the backbone
of the economy of most countries. There is large evidence in
the literature that digitalization improves the market
performance of enterprises and, as a consequence, it helps the
growth of their businesses. SMEs suffer of budget restrictions,
as a consequence within them is low R&D expenditure as well
as the number of employees with IT technical abilities. This
lack is an objective obstacle for SMEs to compete in the
online market. The aim of the present paper is to reach out a
hand to SMEs by presenting in deep details how to structure,
load and querying a NoSQL PostgreSQL database being part
of the customer service.
General Terms
Data and Information Systems, Digital Systems
Customer service, Complaint, Database, NoSQL, JSON, SME
There is large evidence in the literature that digitalization
improves the market performance of enterprises and, as a
consequence, it helps the growth of their businesses. This
claim is true in special way for Small and Medium-sized
Enterprises (SMEs). Compared with other enterprises, SMEs
are confronted with a unique set of issues when competing in
the globalised market where operate, in a manner almost
hegemonic, giants such as Amazon.
The term "IT readiness" has been introduced in the literature
as a precondition that SMEs need to meet in order to fully
exploit IT potentials (e.g., [1]). [2] defines SME readiness in
terms of enterprise's financial resource to take risks and
pressures to change processes, management's IT skills and
project support, and employee's IT skills and attitude; while
[3] suggests readiness in terms of internal IT infrastructure
and number of IT employees. So, different scholars
understand the term SME readiness differently; nonetheless,
the definitions share the fact that to exploit IT potentials,
SMEs must embed "IT-capabilities" in themselves.
Unfortunately, for most SMEs this is not true, as stressed, for
example, in a 2020 document of the European Commission:
"SMEs often must [...] overcome structural barriers such as a
lack of management and technical skills [...]" [4]. In light of
the findings of [5], a low level of IT readiness within SMEs is
a barrier for them to change and grow in the digital-based
global market.
The present paper aims at giving an help to SMEs to cover the
IT gap. In fact, the paper describes in full details how it is
possible to build a database about complaining customers. All
firms playing in the market know very well that no matter
how hard they try, they cannot please 100% of the people
100% of the time, that’s why customer complaints are
inevitable. Whatever the problem might be, the way they
address unhappy customers and handle their complaints can
have a major impact on the company’s reputation. Obviously,
ignoring complaints and failing to resolve them can make the
customers leave and spread negative word of mouth. On the
opposite, Yilmaz et al. [6] have shown that learning from
complaints influence both short- and long-term firm-level
performance measures positively. In light of considerations
above, SMEs that aim entering the online market of goods
and/or services have to adopt a database as the one described
in the present contribution.
The paper is structured as follows. Section 2 is about the
related work, while Section 3 presents the structure of the
database and the SQL scripts for its creation and loading. A
meaningful set of query patterns are also given; SMEs can use
them to carry out relevant statistics. As stated above, the
contribution of this work is the database structure and the
query patterns against it; that is the reason why the tables
were loaded with a small number of sample data and the
query results are not discussed. Section 4 concludes the paper
and describes the work in progress at present, as well as the
aim of the long term industrial project that has been launched.
No company is so perfect in the delivery of their
products/services that dissatisfaction (the source of
complaints) does not exist. In this context the well-known
saying: “No news, good news” is not always true. So, the
correct approach from SMEs that aim playing online lengthily
is handling complaints. Handling complaints includes the
following three steps: (a) collecting them; (b) analyzing them,
and (c) responding appropriately (i.e., overcoming the
underlying issue). This paper focuses on the first two steps.
Only when a complaint has been captured, the appropriate
corrective action can be taken. Nobody complains without
reason. No matter how absurd a complaint might sound, it is
important to look at the posed issue from the customer’s point
of view. What might be an effective procedure for resolving
customer complaints is a topic outside the scope of the present
paper. [7], for example, proposes a seven-step customer
complaint procedure. [8] is another interesting, and recent,
source for managers to learn about how to deal with
customers online complaints. In fact, the study collects best
practices to online complaint management from a team of
researchers with backgrounds in retailing and relationship
In [7], authors report that “for every complaint expressed,
there are over 25 unregistered complaints. Many dissatisfied
customers just quietly take their business elsewhere. […]
Furthermore, a customer with a complaint is likely to tell
others about his complaint.” Organizations that are truly
committed to delivering an effective customer service have to
providing them opportunities to complain. A mobile app or a
webpage are the easiest way to encourage customers to write
International Journal of Computer Applications (0975 8887)
Volume 174 No. 14, January 2021
their comments that, from those collecting points, can then
automatically be redirected into a firm’s database.
The implementation of an effective customer service implies
that different channels are adopted in a consistent and
coordinated way [9]. A database collecting users complaints is
one of those medium. Such a database is a precious intangible
assets for firms, since, by querying it, it is possible to extract
customers complaints and take appropriate actions to reply to
them. In addition, the availability of such kind of data allows
the implementation of quantitative methods as an alternative
to qualitative ones. In fact, by querying the database over long
periods of time it is possible to build statistics useful to get a
correct vision of what is going wrong with the offered
products and/or services.
PostgreSQL (ver.13) has been adopted as DBMS. The reasons
for such a choice are the following. PostgreSQL is an open-
source system; using a free software is a unique opportunity
for SMEs to keep the costs low. Moreover, PostgreSQL offers
a robust support to the JSON data type which, in turn, allows
to implement NoSQL databases. The features of NoSQL
databases have been reported in the literature (e.g., [10, 11]).
To implement an effective customer service it is highly
recommendable that the underlying database is able to host
unstructured data.
The customer survey the paper refers to is composed of ten
questions. It was taken from page:
3.1 The Tables
The NoSQL database is composed of five tables:
Our_Products, The_Survey_Template, Our_Customers, Sales,
The_Reviews. The PostgreSQL’s SQL/DDL scripts are listed
CREATE TABLE Our_Products (
description JSONB);
CREATE TABLE Our_Customers (C_Code serial PRIMARY KEY NOT
NULL, Description JSONB);
P_Code integer NOT NULL,
C_Code integer NOT NULL,
"When" date NOT NULL,
PRIMARY KEY (C_Code, P_Code, "When"),
FOREIGN KEY (P_Code) references Our_Products(P_Code) ON
FOREIGN KEY (C_Code) references Our_Customers(C_Code) ON
CREATE TABLE The_Survey_Template (
TheQuestions JSONB NOT NULL);
CREATE TABLE The_Reviews (
C_Code integer NOT NULL,
P_Code integer NOT NULL,
"When" Date NOT NULL,
TheQuestions JSONB NOT NULL,
FOREIGN KEY (C_Code) references Our_Customers(C_Code) ON
FOREIGN KEY (P_Code) references Our_Products(P_Code) ON
3.2 A Sample Database
The database is structured as 30 products, 20 customers, and
100 sales. Five reviews are loaded into The_Reviews table;
while the ten questions of the survey are stored into
The_Survey_Template table. The PostgreSQL’s SQL/DML
scripts are listed below. Due to space limits only the INSERT
of the first review is shown. Table 1 collects the records about
the five reviews. Overall, four different customers wrote, on
2020, five reviews mentioning two different
Table 1. The tuples in The_Reviews table
Figure 1 shows the screen dump of the created JSONB
database and the five tables.
Fig 1: Two screens about the created NoSQL database
-- Insertion of 30 products into Our_Products
INSERT INTO Our_Products(P_Code)
FROM generate_series(1,30) n;
-- Insertion of 20 customers into Our_Customers
INSERT INTO Our_Customers(C_Code)
FROM generate_series(1,20) n;
-- Loading of 100 purchasing inside table Sales
INSERT INTO Sales (P_Code, C_Code, "When")
-- Generation of a random natural in the range [1..30]
floor(random() * 30 +1)::int,
floor(random() * 20 +1)::int,
(now() - (random() * (NOW()+'365 days' - NOW())))::date
-- Generation of a random date in the last year from
FROM generate_series(1,100) n;
INSERT INTO The_Survey_Template (TheQuestions)
{"description": "Recommend it to a friend. From Not AT ALL (0)
"score": 6},
{"description": "Overall, how satisfied or dissatisfied are you
with our company?",
"field1": "Very satisfied",
"field2": "Somewhat satisfied",
"field3": "Neither satisfied nor dissatisfied",
"field4": "Somewhat dissatisfied",
International Journal of Computer Applications (0975 8887)
Volume 174 No. 14, January 2021
"field5": "Very dissatisfied"},
{"description": "Which of the following words would you use to
describe our products/services? Select all that apply.",
"field1": "Reliable",
"field2": "High quality",
"field3": "Useful",
"field4": "Unique",
"field5": "Good value for money",
"field6": "Overpriced",
"field7": "Impractical",
"field8": "Ineffective",
"field9": "Poor quality",
{"description": "How well do our product/service meet your
"field1": "Extremely well",
"field2": "Very well",
"field3": "Somewhat well",
"field4": "Not so well",
"field5": "Not at all well"},
{"description": "How would you rate the quality of the
"field1": "Very high quality",
"field2": "High quality",
"field3": "Neither high nor low quality",
"field4": "Low quality",
"field5": "Very low quality"},
{"description": "How would you rate the value for money of the
"field1": "Excellent",
"field2": "Above average",
"field3": "Average",
"field4": "Below average",
"field5": "Poor"},
{"description": "How responsive have we been to your
questions or concerns about our product/service?",
"field1": "Extremely responsive",
"field2": "Very responsive",
"field3": "Somewhat responsive",
"field4": "Not so responsive",
"field5": "Not at all responsive",
"field6": "Not applicable"},
{"description": "How long have you been a customer of our
"field1": "This is my first purchase",
"field2": "Less than six months",
"field3": "Six months to a year",
"field4": "1 - 2 years",
"field5": "3 or more years",
"field6": "I have not made a purchase yet"},
{"description": "How likely are you to purchase any of our
products/services again?",
"field1": "Extremely likely",
"field2": "Very likely",
"field3": "Somewhat likely",
"field4": "Not so likely",
"field5": "Not at all likely"},
"Do you have any other comments, questions, or concerns?"
} ');
-- Review 1
INSERT INTO The_Reviews (C_Code, P_Code, "When",
(1, 3, '2020-03-13',
'{"Q1": {"score": 6},
"Q2": {"field4": "Somewhat dissatisfied"},
"Q3": {"field6": "Overpriced"},
"Q4": {"field5": "Not at all well"},
"Q5": {"field4": "Low quality"},
"Q6": {"field5": "Poor"},
"Q7": {"field3": "Somewhat responsive"},
"Q8": {"field3": "Six months to a year"},
"Q9": {"field4": "Not so likely"}
} ');
3.3 Query Patterns
This subsection collects ten query patterns useful to build
statistics on actual data that likely covers a large time interval.
For each query the PostgreSQL’s screenshot showing the
result is also given.
Query 1
Count the number of reviews in the DB (Figure 2).
SELECT Count(*)
FROM The_Reviews;
Fig 2: Query 1 and its output
Query 2
Compute the percentage of reviews with respect to the total
number of sales (Figure 3).
(SELECT Count(*) AS Number_Of_Reviews
FROM The_Reviews)
SELECT ((c.Number_Of_Reviews::decimal /
Count(Sales)) * 100)::numeric(4,2)
FROM Sales, CTE1 AS c
GROUP BY c.Number_Of_Reviews;
Fig 3: Query 2 and its output
Query 3
Compute the number of distinct complaining customers
(Figure 4).
FROM The_Reviews
SELECT Count(*)
International Journal of Computer Applications (0975 8887)
Volume 174 No. 14, January 2021
Fig 4: Query 3 and its output
Query 4
Show the C_Code of the complaining customers (Figure 5).
SELECT C_Code AS "C_Code"
FROM The_Reviews
Fig 5: Query 4 and its output
Query 5
Show the C_Code of each complaining customer and the
number of reviews he/she wrote (Figure 6).
SELECT C_Code AS "C_Code", COUNT(*)
FROM The_Reviews
Fig 6: Query 5 and its output
Query 6
Show the overall score of the products mentioned in the
reviews (Figure 7).
SELECT P_Code AS "P_Code", TheQuestions -> 'Q1' AS "The score"
FROM The_Reviews
Fig 7: Query 6 and its output
Query 7
Show the P_Code of the products with overall score below 6
(Figure 8).
SELECT P_Code AS "P_Code", TheQuestions -> 'Q1' AS Score
FROM The_Reviews
WHERE ((TheQuestions -> 'Q1' )) < '{"score": 6}'
ORDER BY P_Code, Score;
Fig 8: Query 7 and its output
Query 8
Show the P_Code of products with overall score equal to 3 (if
any) (Figure 9).
SELECT P_Code AS "P_Code", TheQuestions -> 'Q1' AS Score
FROM The_Reviews
WHERE (TheQuestions -> 'Q1' ) @> '{"score": 3}'
ORDER BY P_Code, Score
Fig 9: Query 8 and its output
Query 9
Show all the fields of all the reviews in the DB mentioning a
given product (e.g., P_Code=10) (Figure 10).
SELECT jsonb_each(TheQuestions) AS "The answers"
FROM The_Reviews
WHERE P_Code = 10
The output of this query is composed of as many rows as the
number of questions in the survey times the number of tuples
which have P_Code=10.
SELECT to_jsonb(TheQuestions) AS p
International Journal of Computer Applications (0975 8887)
Volume 174 No. 14, January 2021
FROM The_Reviews
WHERE P_Code = 10
The output of this query is composed of as many rows as the
number of tuples which have P_Code=10. Each row contains
all the fields in the survey.
Fig 10: Query 9 and its output
Query 10
Show the P_Code mentioned in the highest number of
complaints (Figure 11).
FROM The_Reviews
SELECT P_Code AS "P_Code", c AS "Number of Negative Scores"
Fig 11: Query 10 and its output
The paper presented a NoSQL database thought to be part of
an advanced customer service of a network of collaborating
SMEs physically distributed over a territory (for instance, a
region, a province or a state), which share the objective of
selling goods or services to potential consumers through a
digital platform (therefore called Digital Network - DN). The
next step of the work will concern the implementation of a
Twitter monitoring component that scans the network for
brand mentions, captures those tweets and, then, copies them
into a dedicated NoSQL database.
The ongoing industrial research project aims at developing a
generator of DNs. The proponents of the project, recently
have completed the development and release of a tool
(xGenerator [12]) that performs the transformations across
the levels of the Model Driven Architecture up to the Java
code of business Web applications. Both projects implement
the emerging low-code paradigm. In the case of the generator
of DNs, by making recourse to the generator, interested SMEs
will be able to instantiate by themselves the DN that best
respond to the needs of their businesses.
[1] Dyerson, R. and Spinelli, R. 2011. Balancing Growth: A
Conceptual Framework for Evaluating ICT Readiness in
SMEs. International Journal of Online Marketing 1 (Apr.
2011), 43-56.
[2] Haug, A., Pedersen, S.G., and Arlbjørn, J.S. 2011. IT
readiness in small and medium-sized enterprises. Journal
of Industrial Management & Data Systems 111 (Apr.
2011), 490-508.
[3] Hajli, N., Sims, J., and Shanmugam, M. 2014. A
practical model for ecommerce adoption in Iran. Journal
of Enterprise Information Management 27 (Oct. 2014),
[4] User Guide to the SME Definition. Publications Office of
the European Union, Luxembourg 2020.
[5] Gerber, A., le Roux, P., and van der Merwe, A. 2020.
Enterprise Architecture as Explanatory Information
Systems Theory for Understanding Small- and Medium-
Sized Enterprise Growth. Sustainability 12 (Oct. 2020),
[6] Yilmaz, C., Varnali, K., and Kasnakoglu, B.T. 2016.
How do firms benefit from customer complaints? Journal
of Business Research 69 (Feb. 2016), 944-955.
[7] Farnsworth, D., Clark, J.L., Wysocki, A., Kepner, K.,
and Glasser, M.W. 2019. Customer Complaints and
Types of Customer. Report HR005, University of
[8] Stevens, J.L., Spaid, B.I., Breazeale, M., and Jones,
C.L.E. 2018. Timeliness, transparency, and trust: A
framework for managing online customer complaints.
Business Horizons 61 (May-Jun. 2018), 375-384.
[9] Stone, M., Hobbs, M., and Khaleeli, M. 2002.
Multichannel customer management: The benefits and
challenges. Journal of Database Marketing 10 (Sept.
2002), 39-52.
[10] Kumbhar, H., Kinny, E., Fernandes, K., and Maitra, S.
2019. Benefits of NoSQL Databases. In IJCA
Proceedings on Leveraging Information Technology for
Inter-Sectoral Research ICAIM 2017, no. 1.
[11] Petković, D. 2020. Implementation of JSON Update
Framework in RDBMSs. International Journal of
Computer Applications 177 (Feb. 2020), 35-39.
[12] Paolone, G., Marinelli, M., Paesani, R., and Di Felice, P.
2020. Automatic Code Generation of MVC Web
Applications. Computers 9, 56 (Jul. 2020).
ResearchGate has not been able to resolve any citations for this publication.
Full-text available
Understanding and explaining small- and medium-sized enterprise (SME) growth is important for sustainability from multiple perspectives. Research indicates that SMEs comprise more than 80% of most economies, and their cumulative impact on sustainability considerations is far from trivial. In addition, for sustainability concerns to be prioritized, an SME has to be successful over time. In most developing countries, SMEs play a major role in solving socio-economic challenges. SMEs are an active research topic within the information systems (IS) discipline, often within the enterprise architecture (EA) domain. EA fundamentally adopts a systems perspective to describe the essential elements of a socio-technical organization and their relationships to each other and to the environment in order to understand complexity and manage change. However, despite rapid adoption originally, EA research and practice often fails to deliver on expectations. In some circles, EA became synonymous with projects that are over-budget, over-time and costly without the expected return on investment. In this paper, we argue that EA remains indispensable for understanding and explaining enterprises and that we fundamentally need to revisit some of the applications of EA. We, therefore, executed a research study in two parts. In the first part, we applied IS theory perspectives and adopted the taxonomy and structural components of theory to argue that EA, as represented by the Zachman Framework for Enterprise Architecture (ZFEA), could be adopted as an explanatory IS theory. In the second part of the study, we subsequently analysed multiple case studies from this theoretical basis to investigate whether distinguishable focus patterns could be detected during SME growth. The final results provide evidence that EA, represented through an appropriate framework like the ZFEA, could serve as an explanatory theory for SMEs during start-up, growth and transformation. We identified focus patterns and from these results, it should be possible to understand and explain how SMEs grow. Positioning the ZFEA as explanatory IS theory provides insight into the role and purpose of the ZFEA (and by extension EA), and could assist researchers and practitioners with mediating the challenges experienced by SMEs, and, by extension, enhance sustainable development.
Full-text available
As Web applications become more and more complex, the development costs are increasing as well. A Model Driven Architecture (MDA) approach is proposed in this paper since it simplifies modeling, design, implementation, and integration of applications by defining software mainly at the model level. We adopt the The Unified Modeling Language (UML), as modeling language. UML provides a set of diagrams to model structural and behavioral aspects of the Web applications. Automatic translation of UML diagrams to the Object-Oriented code is highly desirable because it eliminates the chances of introducing human errors. Moreover, automatic code generation helps the software designers delivering of the software on time. In our approach, the automatic transformations across the MDA’s levels are based on meta-models for two of the most important constructs of UML, namely Use Cases and classes. A proprietary tool (called xGenerator) performs the transformations up to the Java source code. The architecture of the generated Web applications respects a variant of the well-known Model-View-Controller (MVC) pattern.
Full-text available
ABSTRACT The existing SQL/JSON standard specifies the way how queries can be performed, but in order to reach the full functionality for data representation and as a sharing format, it needs to support several additional features. One of the most important missing features is the facility to perform updates on the content of JSON documents. In this article we discuss how update operations for JSON data have been implemented in relational database systems and compare these implementations in relation to their scope and coverage of our framework, which comprises the set of primitive update operations.
Full-text available
This article discusses several practical solutions for dealing with online customer complaints. Online complaints are inevitable; how a firm responds can make the difference. There are techniques that managers can use not only to minimize the detrimental impact of online complaints, but also to produce beneficial outcomes. Herein, we introduce our 3T framework, designed to help managers and support teams respond to online complaints in a thoughtful and measured way. We build on word-of-mouth research and several theories from marketing, service marketing, journalism, and business ethics. With so many reviews posted online every second, firms must employ best practices grounded in empirical research and solid conceptualization to deal with this important component of online customer service.
Full-text available
This paper defines multichannel customer management and investigates the opportunities and problems created by multichannel customer management. It explains why multichannel customer management has become an issue for serious discussion. Its aim is to help companies determine their strategies and tactics in this area. It does not provide a complete recipe for multichannel management, but rather explores the main decisions companies need to take as they add customer management channels. It identifies the importance of understanding customer needs and defining the experience customes wants from each channel and overall. It probes issues related to technology, organisation, measurement and economics. A checklist of questions to help companies examining this area is provided at the end of the paper.Journal of Database Marketing (2002) 10, 39-52; doi:10.1057/palgrave.jdm.3240093
Full-text available
Purpose – Several studies have documented that information technology (IT) projects often do not successfully meet defined objectives regarding time, budget, and functionality. There can be multiple causes for this, and an important factor in this context is the extent to which a company is ready for an IT project. To help understand this dynamic, this paper seeks to present a framework for analyzing “IT readiness” in small- and medium-sized enterprises (SMEs). Design/methodology/approach – Based on a literature review, the paper defines a framework for assessing and changing the IT readiness of a SME. The framework is illustrated and investigated by three case studies. Findings – The case studies show that the framework of IT readiness in SMEs is useful for assessing company readiness and supporting the management of a project. Research limitations/implications – The framework and case studies provide an improved understanding of how to evaluate the readiness of a SME for an IT project. Practical implications – The framework for IT readiness provides a solid basis for SMEs who plan to engage in an IT project and help to increase the chances of success. Originality/value – The framework presented in the paper constitutes an operational model for choosing IT projects and making SMEs ready to engage in IT projects.
Purpose – Developing countries are still challenged by infrastructural and cultural issues related to the adoption of e-commerce although with the emergence of social commerce, a new stream has been introduced. Iran is a developing country, in which the adoption of e-commerce by small to medium sized enterprises (SMEs) is challenged by such barriers; it is now applying models for the adoption of new technologies by SMEs. The paper aims to discuss these issues. Design/methodology/approach – This research attempts to develop a model, based on existing models of e-commerce, which can be applied in Iranian conditions. The study uses data gathered by a survey, together with existing models in this area, in order to propose a new model, which has been empirically tested. Findings – The results of this research demonstrate that e-commerce barriers in Iran are related to a lack of awareness of the benefits of e-commerce adoption, as well as organisational issues related to its application. The paper also discusses the results and implications of this research, which can be applied to other developing countries. The paper also gives a better picture of Iranian market. Finally the paper discusses possible future directions of this research, as well as its limitations. Originality/value – This study contributes to the theoretical basis of IS and e-commerce adoption studies by proposing and testing a pre-adoption model for e-commerce. The adoption of e-commerce in SMEs in Iran has not been substantially investigated. This is despite the fact that SMEs play an important role in all economies. The results demonstrate a significant relationship between organisational readiness and the adoption of e-commerce. It also shows that there is a positive relationship between awareness of e-commerce and its adoption.
The Institute of Food and Agricultural Sciences (IFAS) is an Equal Opportunity Institution authorized to provide research, educational information and other services only to individuals and institutions that function with non-discrimination with respect to race, creed, color, religion, age, disability, sex, sexual orientation, marital status, national origin, political opinions or affiliations.