1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Svetradugi [14.3K]
4 years ago
8

You’ve been hired to work on a web site that maintains customer reviews of products. The main data is stored in the following ta

bles: Product(Product ID, Product Name, Description) Reviewer(Reviewer ID, Reviewer Name, City) Review(Reviewer ID, Product ID, Rating, Comment) The tables contain the following information:
Product: unique product id (Product ID), product name (Product Name), and product description. All strings. • Reviewer: unique reviewer id (Reviewer ID), and reviewer name (Reviewer Name) and city, also all strings. • Review: One entry for each individual review giving the reviewer and product ids, an integer rating in the range 0‐5, and the reviewer comment, which is a string.
A) Write a SQL query that returns the number of reviewers in each distinct city. The results should list the city name and the number of reviewers in that city, and should be sorted alphabetically by city name.
B) Write a SQL query that returns the average of the reviews for each reviewer and names of the reviewers for all reviewers that have an average review (of all their reviews) of less than or equal to 2.
Computers and Technology
1 answer:
olya-2409 [2.1K]4 years ago
6 0

Answer:

See explaination

Explanation:

a.

//to create product table

CREATE TABLE PRODUCT

(

PRODUCTID VARCHAR2(50) NOT NULL

, PRODUCTNAME VARCHAR2(50) NOT NULL

, DESCRIPTION VARCHAR2(50) NOT NULL

, CONSTRAINT PRODUCT_PK PRIMARY KEY

(

PRODUCTID

)

);

//to create Reviewer table

CREATE TABLE REVIEWER

(

REVIEWERID VARCHAR2(50) NOT NULL ,

REVIEWERNAME VARCHAR2(50) NOT NULL ,

CITY VARCHAR2(50) NOT NULL ,

CONSTRAINT REVIEWER_PK PRIMARY KEY ( REVIEWERID )

);

// to create Review table

CREATE TABLE REVIEW

(

REVIEWERID VARCHAR2(50) NOT NULL ,

PRODUCTID VARCHAR2(50) NOT NULL ,

RATING NUMBER(5, 0) NOT NULL ,

COMMENTS VARCHAR2(50) NOT NULL ,

CONSTRAINT REVIEW_PK PRIMARY KEY ( REVIEWERID , PRODUCTID )

);

b.

SELECT CITY,COUNT( REVIEWERID) NOOFREVIEWERS FROM REVIEWER GROUP BY CITY ORDER BY CITY ;

EXPLANATION

GROUP BY clause classifies the data in the table it avoids duplicates in the table

ORDER BY clause by default sort the table in ascending order

in the select clause city is the single column count is group function so we must need to write group by clause

otherwise we will get

SQL Error: ORA-00937: not a single-group group function

You might be interested in
Identify a true statement of a JavaScript program in a web form.
Sever21 [200]

Answer:

Option d): JavaScript intercepts the content of the form before the browser attempts to contact the CGI script and report whether the data contained in the survey form has been correctly filled out or not.

is the true statement.

Explanation:

Introduction to JavaScript:

JavaScript can be defined as the object-oriented programming language used specially for creating effective and interactive styles for web, it can update and modify the languages like HTML and CSS.

The data can be validated, calculated and manipulated using JavaScript.

JavaScript is a scripting language from the client-side. By this we mean that the source code of JavaScript is processed by the browser of client instead of the web Server.

From the server-side of scripting language, JavaScript can be added anywhere within the HTML of a webpage.

i hope it will help you!

4 0
3 years ago
What are the 3 symbols that can’t be used when saving a document? (From Microsoft Word 2016) (pls helped me!)
Charra [1.4K]

Answer:

\, /, -

Explanation:

The three symbols are forward slash, backward slash, and the hyphen. These were allowed in previous versions of the MS Word. However, since the MS Word 2016 and a little earlier, these three symbols have been banned. And you will immediately get a message if you use these, to correct, and only then the file will be saved with that new name, and that must not have the forward or backward slash or the hyphen.

6 0
4 years ago
______ are single numbers or values, which may include integers, floating-point decimals, or strings of characters.
marysya [2.9K]

Scalar Values are single numbers or values, which may include integers, floating-point decimals, or strings of characters.

A(n) array is a group of scalar or individual values that are stored in one entity.

A(n) user-defined type is a data type that is assigned a true or false value by a programmer.

A(n) abstract data type is a data type that can be assigned multiple values.

4 0
3 years ago
Systems management involves allocation of computer resources to keep all processes operating smoothly and at maximum efficiency.
olchik [2.2K]

Answer:operating system (OS), program that manages a computer's resources, especially the allocation of those resources among other programs. Typical resources include the central processing unit (CPU), computer memory, file storage, input/output (I/O) devices, and network connections.

Explanation:

8 0
3 years ago
The objectivity of a site relates to its a. Appearance c. Graphics b. Biases d. Quotes from other Internet authors Please select
FromTheMoon [43]

The objectivity of any site is related to the biases present in the content of the site because it creates an imbalance of information and it is unfair.

<h3>What is the objectivity of a site?</h3>

The content in a site represents the thoughts of a specific author. Objectivity comes to the role when there is an imbalance in the data or information available on the site.

The information available on the site represents the opinion that helps readers to understand or decide on anything. When the information is fair completely balanced then it becomes fair for the users to refer to that content. But when the data is biased or unbalanced then it becomes a problem.

Therefore, the objectivity of any site is related to the biases present in the content of the site because it creates an imbalance of information and it is unfair.

Learn more about objectivity of a site here:

brainly.com/question/2018782

5 0
3 years ago
Other questions:
  • After installation of SSL certificate website asking for username and password.
    6·1 answer
  • A dmz is a subnet of _____________ accessible servers placed outside the internal network.
    10·1 answer
  • What factors should you consider when buying a hard drive?
    8·1 answer
  • In 4-bit two's complement representation, what is the binary encoding of the number -5?
    8·1 answer
  • Which of the following is the most significant outcome of the formation of the SMPTE?
    6·2 answers
  • _____emphasizes on proper breathing and the mind-body-spirit connections.​
    6·2 answers
  • 23+ Composition refers to
    11·1 answer
  • Which of the following enables robots to do things such as understand itself, walk, talk, and develop skills?
    15·1 answer
  • Is computing gcse easy or hard
    10·2 answers
  • Kate saves her work on a secondary storage device that is fairly new, and uses flash technology instead of disks.
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!