Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Please help me to write the following SQL queries in Big Query(SQL) List how man

ID: 3805302 • Letter: P

Question

Please help me to write the following SQL queries in Big Query(SQL)

List how many stories were posted by each author on nytimes.com and wired.com. (those two web sites are in the filed of url)

Schema:

id

Unique story ID

Username of submitter

Story score

Unix time

Human readable time in UTC (format: YYYY-MM-DD hh:mm:ss)

Story title

Story url

Story text

Is deleted?

Is dead?

Number of story descendants

Username of author

id

INTEGER NULLABLE

Unique story ID

by STRING NULLABLE

Username of submitter

score INTEGER NULLABLE

Story score

time INTEGER NULLABLE

Unix time

time_ts TIMESTAMP NULLABLE

Human readable time in UTC (format: YYYY-MM-DD hh:mm:ss)

title STRING NULLABLE

Story title

url STRING NULLABLE

Story url

text STRING NULLABLE

Story text

deleted BOOLEAN NULLABLE

Is deleted?

dead BOOLEAN NULLABLE

Is dead?

descendants INTEGER NULLABLE

Number of story descendants

author STRING NULLABLE

Username of author

Explanation / Answer

First query for List how many stories were posted by each author on nytimes.com:

SELECT

title,
COUNT(descendants)
FROM Schema
WHERE author='xyz' AND url="nytimes.com";

Second query for List how many stories were posted by each author on wired.com:

SELECT

title,
COUNT(descendants)
FROM Schema
WHERE author='xyz' AND url="wired.com";