You are on page 1of 13

Data Scientist Role Play: Profiling and Analyzing the Yelp Dataset Coursera

Worksheet

This is a 2-part assignment. In the first part, you are asked a series of questions
that will help you profile and understand the data just like a data scientist
would. For this first part of the assignment, you will be assessed both on the
correctness of your findings, as well as the code you used to arrive at your
answer. You will be graded on how easy your code is to read, so remember to use
proper formatting and comments where necessary.

In the second part of the assignment, you are asked to come up with your own
inferences and analysis of the data for a particular research question you want to
answer. You will be required to prepare the dataset for the analysis you choose to
do. As with the first part, you will be graded, in part, on how easy your code is
to read, so use proper formatting and comments to illustrate and communicate your
intent as required.

For both parts of this assignment, use this "worksheet." It provides all the
questions you are being asked, and your job will be to transfer your answers and
SQL coding where indicated into this worksheet so that your peers can review your
work. You should be able to use any Text Editor (Windows Notepad, Apple TextEdit,
Notepad ++, Sublime Text, etc.) to copy and paste your answers. If you are going to
use Word or some other page layout application, just be careful to make sure your
answers and code are lined appropriately.
In this case, you may want to save as a PDF to ensure your formatting remains
intact for you reviewer.

Part 1: Yelp Dataset Profiling and Understanding

1. Profile the data by finding the total number of records for each of the tables
below:

i. Attribute table = 10000


ii. Business table = 10000
iii. Category table = 10000
iv. Checkin table = 10000
v. elite_years table = 10000
vi. friend table = 10000
vii. hours table = 10000
viii. photo table = 10000
ix. review table = 10000
x. tip table = 10000
xi. user table = 10000

2. Find the total distinct records by either the foreign key or primary key for
each table. If two foreign keys are listed in the table, please specify which
foreign key.

i. Business = 10000
ii. Hours = hours = 2052 / business_id = 1562
iii. Category = business_id = 2643
iv. Attribute = business_id = 1115
v. Review = id = 10000
vi. Checkin = business_id = 493
vii. Photo = id = 10000 / business_id = 6493
viii. Tip = user_id = 537 / business_id = 3979
ix. User = 10000
x. Friend = user_id = 10000
xi. Elite_years = 2780

Note: Primary Keys are denoted in the ER-Diagram with a yellow key icon.

3. Are there any columns with null values in the Users table? Indicate "yes," or
"no."

Answer: No

SQL code used to arrive at answer:


SELECT COUNT(*) - COUNT(id) id,
COUNT(*) - COUNT(name) name,
COUNT(*) - COUNT(review_count) review_count,
COUNT(*) - COUNT(yelping_since) yelping_since,
COUNT(*) - COUNT(funny) funny,
COUNT(*) - COUNT(useful) useful,
COUNT(*) - COUNT(fans) fans,
COUNT(*) - COUNT(average_stars) average_stars,
COUNT(*) - COUNT(compliment_hot) compliment_hot,
COUNT(*) - COUNT(compliment_more) compliment_more,
COUNT(*) - COUNT(compliment_profile) compliment_profile,
COUNT(*) - COUNT(compliment_cute) compliment_cute,
COUNT(*) - COUNT(compliment_list) compliment_list,
COUNT(*) - COUNT(compliment_note) compliment_note,
COUNT(*) - COUNT(compliment_plain) compliment_plain,
COUNT(*) - COUNT(compliment_cool) compliment_cool,
COUNT(*) - COUNT(compliment_funny) compliment_funny,
COUNT(*) - COUNT(compliment_writer) compliment_writer,
COUNT(*) - COUNT(compliment_photos) compliment_photos
FROM user

4. For each table and column listed below, display the smallest (minimum), largest
(maximum), and average (mean) value for the following fields:

i. Table: Review, Column: Stars

min: 1 max: 5 avg: 3.7082

ii. Table: Business, Column: Stars

min: 1 max: 5 avg: 3.6549

iii. Table: Tip, Column: Likes

min: 0 max: 2 avg: 0.0144

iv. Table: Checkin, Column: Count


min: 1 max: 53 avg: 1.9414

v. Table: User, Column: Review_count

min: 0 max: 2000 avg: 24.2995

5. List the cities with the most reviews in descending order:

SQL code used to arrive at answer:


SELECT sum(review_count) most_r, city
FROM business
GROUP BY city
ORDER BY most_r DESC

Copy and Paste the Result Below:


+--------+-----------------+
| most_r | city |
+--------+-----------------+
| 82854 | Las Vegas |
| 34503 | Phoenix |
| 24113 | Toronto |
| 20614 | Scottsdale |
| 12523 | Charlotte |
| 10871 | Henderson |
| 10504 | Tempe |
| 9798 | Pittsburgh |
| 9448 | Montréal |
| 8112 | Chandler |
| 6875 | Mesa |
| 6380 | Gilbert |
| 5593 | Cleveland |
| 5265 | Madison |
| 4406 | Glendale |
| 3814 | Mississauga |
| 2792 | Edinburgh |
| 2624 | Peoria |
| 2438 | North Las Vegas |
| 2352 | Markham |
| 2029 | Champaign |
| 1849 | Stuttgart |
| 1520 | Surprise |
| 1465 | Lakewood |
| 1155 | Goodyear |
+--------+-----------------+
(Output limit exceeded, 25 of 362 total rows shown)

6. Find the distribution of star ratings to the business in the following cities:

i. Avon

SQL code used to arrive at answer:

SELECT stars star_rating, count(*) count


FROM business
WHERE city = 'Avon'
GROUP BY stars

Copy and Paste the Resulting Table Below (2 columns – star rating and count):
+-------------+-------+
| star_rating | count |
+-------------+-------+
| 1.5 | 1 |
| 2.5 | 2 |
| 3.5 | 3 |
| 4.0 | 2 |
| 4.5 | 1 |
| 5.0 | 1 |
+-------------+-------+

ii. Beachwood

SQL code used to arrive at answer:

SELECT stars star_rating, count(*) count


FROM business
WHERE city = 'Beachwood'
GROUP BY stars

Copy and Paste the Resulting Table Below (2 columns – star rating and count):

+-------------+-------+
| star_rating | count |
+-------------+-------+
| 2.0 | 1 |
| 2.5 | 1 |
| 3.0 | 2 |
| 3.5 | 2 |
| 4.0 | 1 |
| 4.5 | 2 |
| 5.0 | 5 |
+-------------+-------+

7. Find the top 3 users based on their total number of reviews:

SQL code used to arrive at answer:


SELECT name,id, review_count
FROM user
ORDER BY review_count DESC limit 3

Copy and Paste the Result Below:

+--------+------------------------+--------------+
| name | id | review_count |
+--------+------------------------+--------------+
| Gerald | -G7Zkl1wIWBBmD0KRy_sCw | 2000 |
| Sara | -3s52C4zL_DHRK0ULG6qtg | 1629 |
| Yuri | -8lbUNlXVSoXqaRRiHiSNg | 1339 |
+--------+------------------------+--------------+

8. Does posing more reviews correlate with more fans?

Please explain your findings and interpretation of the results:


Through the observation of the averages in different ranges we can see that
there is a good correlation,
between the amount of reviews and the amount of reviews, although it is also
pretty apparent that having
more reviews is not the only way of having more fans, which is visible since
the users which are in the
higher amount of reviews are not necessarily the ones with the most fans.

9. Are there more reviews with the word "love" or with the word "hate" in them?

Answer: There are more with love.

SQL code used to arrive at answer:

SELECT sum(CASE WHEN text like '%love%' then 1 else 0 end) love,
sum(CASE WHEN text like '%hate%' then 1 else 0 end) hate
FROM review

10. Find the top 10 users with the most fans:

SQL code used to arrive at answer:

SELECT name, id, fans


FROM user
ORDER BY fans DESC limit 10

Copy and Paste the Result Below:


+-----------+------------------------+------+
| name | id | fans |
+-----------+------------------------+------+
| Amy | -9I98YbNQnLdAmcYfb324Q | 503 |
| Mimi | -8EnCioUmDygAbsYZmTeRQ | 497 |
| Harald | --2vR0DIsmQ6WfcSzKWigw | 311 |
| Gerald | -G7Zkl1wIWBBmD0KRy_sCw | 253 |
| Christine | -0IiMAZI2SsQ7VmyzJjokQ | 173 |
| Lisa | -g3XIcCb2b-BD0QBCcq2Sw | 159 |
| Cat | -9bbDysuiWeo2VShFJJtcw | 133 |
| William | -FZBTkAZEXoP7CYvRV2ZwQ | 126 |
| Fran | -9da1xk7zgnnfO1uTVYGkA | 124 |
| Lissa | -lh59ko3dxChBSZ9U7LfUw | 120 |
+-----------+------------------------+------+

Part 2: Inferences and Analysis

1. Pick one city and category of your choice and group the businesses in that city
or category by their overall star rating. Compare the businesses with 2-3 stars to
the businesses with 4-5 stars and answer the following questions. Include your
code.

i. Do the two groups you chose to analyze have a different distribution of hours?

we can see that the hours are really different for giher rated restaurants than for
lower stars,
we have that the ones ranged between 3-4 stars mostly open late (after 16:00) and
all close after 23:00,
this probably indicates that they appeal to a more adult audience, than the early
opening/closing (9-11 to 21-23 hrs)
restaurants wih lower rating.

We need to consider that the sampling is too small for any generalizations, so all
conclusions expressed would only
be valid if the pattern were to be repeated for a bigger sample.

ii. Do the two groups you chose to analyze have a different number of reviews?

The group with lower ratings have about 70% the amount of reviews than the higher
group, but also important is that the restaurant with the lower
amount of stars has a very low (5) amount of reviews, which may indicate less
accuracy.

iii. Are you able to infer anything from the location data provided between these
two groups? Explain.

While the amount of data is not enough to be sure, we can see that 2 of the 3
restaurants in the lower group are ubicated in the same neighborhood,
Downtown core, which may indicate that the kind of restaurants in this neighborhood
are less refined ones.

SQL code used for analysis:


--First check cities and categories, to select one with enough data
SELECT c.category, count(*) t
FROM business b LEFT join category c on b.id = c.business_id
GROUP BY category
ORDER BY t DESC;
SELECT b.city, count(*) t
FROM business b LEFT join category c on b.id = c.business_id
GROUP BY city
ORDER BY t DESC;

--I select Toronto Restaurants, then we check the hours for each:
-- First for the ones with 2-3 stars

SELECT business_id, hours


FROM hours
WHERE business_id in (SELECT id
FROM business INNER join category on id = business_id
WHERE city = 'Toronto' and category = 'Restaurants' and stars between 2.0 and 3.0);

--We have 3 restaurants, we see they all open all week, mostly during 9-11 to 21-23
hrs
--Now for 4-5 stars:

SELECT business_id, hours


FROM hours
WHERE business_id in (SELECT id
FROM business INNER join category on id = business_id
WHERE city = 'Toronto' and category = 'Restaurants' and stars between 4.0 and 5.0);

--Again we have 3 restaurants, we can see that the hours are really different that
for lower stars, we have that they mostly open late (after 16:00) and all close
after 23:00
-- This probably indicates that they appeal to a more adult audience
-- About the amount of reviews we can see how many there are for each rating:

select id, review_count


FROM business
WHERE id in (SELECT business_id
FROM hours
WHERE business_id in (SELECT DISTINCT(id)
FROM business INNER join category on id = business_id
WHERE city = 'Toronto' and category = 'Restaurants' and stars between 4.0 and 5.0))

--We can also execute the avg (omitted here to save space, but we just need to
replace the select id, by avg(reviewcount)) getting a 41.0 avg of reviews per
restaurant

select id, review_count


FROM business
WHERE id in (SELECT business_id
FROM hours
WHERE business_id in (SELECT DISTINCT(id)
FROM business INNER join category on id = business_id
WHERE city = 'Toronto' and category = 'Restaurants' and stars between 2.0 and 3.0))

--Here we get a similar distribution but the review count is lower, about 28.666...
reviews per restaurant, and more importantly we see that the one with the lower
review
-- in the group, with 2.0 stars, only has 5 reviews, the lower amount in all the
categories we are analyzing this is very important since lower reviews may mean
less
-- accurate representation

-- We can check now location data, starting with the neighborhood which may
indicate certain socioeconomic implications

select id, review_count,stars, neighborhood


FROM business
WHERE id in (SELECT business_id
FROM hours
WHERE business_id in (SELECT DISTINCT(id)
FROM business INNER join category on id = business_id
WHERE city = 'Toronto' and category = 'Restaurants' and (stars between 2.0 and 3.0
or stars between 4.0 and 5.0)))
ORDER BY stars DESC

2. Group business based on the ones that are open and the ones that are closed.
What differences can you find between the ones that are still open and the ones
that are closed? List at least two differences and the SQL code you used to arrive
at your answer.

i. Difference 1:

We can see that the amount of reviews per business is different between
the open and closed ones,
with the closed ones having 70% of the average amount of reviews than
the open ones.
ii. Difference 2:
In average the amount of reviews who mention (positively or negatively)
the word "open" is mostly in businesses that are closed,
by looking at samples this may have to do with the fact that user
typically mention the fact that they were lucky to find the place
open.

SQL code used for analysis:

--We check the amount of reviews for both group


select avg(review_count) n_op, is_open
FROM business
GROUP BY is_open
-- We check reviews and word mentions in them

select avg(CASE WHEN text like '%open%' THEN 1 ELSE 0 end) open1,
sum(CASE WHEN text like '%open%' THEN 1 ELSE 0 end) open2,
count(CASE WHEN text like '%open%' THEN 1 ELSE 0 end) open3,
is_open
FROM review r left join business b ON r.business_id = b.id
GROUP BY is_open

3. For this last part of your analysis, you are going to choose the type of
analysis you want to conduct on the Yelp dataset and are going to prepare the data
for analysis.

Ideas for analysis include: Parsing out keywords and business attributes for
sentiment analysis, clustering businesses to find commonalities or anomalies
between them, predicting the overall star rating for a business, predicting the
number of fans a user will have, and so on. These are just a few examples to get
you started, so feel free to be creative and come up with your own problem you want
to solve. Provide answers, in-line, to all of the following:

i. Indicate the type of analysis you chose to do:


I want to know the most used words, positive and negative, for describing
businesses on each category and within ranges of stars. This may
help to know which parts are important for customers in each category.
I would also like to see if there is a difference for these mentions,
between the reviews marked as useful and the rest.

ii. Write 1-2 brief paragraphs on the type of data you will need for your analysis
and why you chose that data:

The main columns I will need are: the amount of stars of each review, the
complete text of the review and the category of the business.

This way I can apply algortihms to recognize and count similar words, then
sum over grouping by the ranges of stars and, separately, by the category of the
business,
I will also want the useful indciator to see if the review is considered
useful or not by the users.

iii. Output of your finished dataset:

+-------+--------+-----------------
+----------------------------------------------------------------------------------
-----------------------------------------------------------------------------------
-----------------------------------------------------------------------------------
-----------------------------------------------------------------------------------
-------------------------------------------------------------+
| stars | useful | category | text
|
+-------+--------+-----------------
+----------------------------------------------------------------------------------
-----------------------------------------------------------------------------------
-----------------------------------------------------------------------------------
-----------------------------------------------------------------------------------
-------------------------------------------------------------+
| 4 | 6 | Taiwanese | My brother was in town and wanted to get a
quick lunch before I had to go into work. Wanted to go into Monta but it was 11 and
they weren't open yet, so we stopped in at the Big Wong.
|
| | | |
|
| | | | Beef Ramen - for 5 you can get a bowl of ramen
(same noodles as used at Monta) and it comes with big chunks of beef. They'll ask
you for tendons too and I don't remember if they charge you extra, but I don't
think so. Came with chili oil, scallions, and siracha on the side. It was good, and
it's exactly what you expect to get, ramen and beef. Great flavor and the broth was
well seasoned. |
| 5 | 0 | Taiwanese | This restaurant has great service. Their foods
are very delicious and not expensive. Thank you!!
|
| 5 | 1 | Specialty Food | If you have the chance to go to the West Side
market - do it! Even if you aren't there to grocery shop there are plenty of made-
to-order items. If you have time be sure to get a gyro from Steve's or a crepe from
Crepes de Luxe. This place is truly unique! Even if you don't buy anything, it is a
sight to see.
|
| 4 | 0 | Specialty Food | I love this market, crowded, fresh and cheap
veggies! Nice collection of bread, cheese and butter.
|
| | | | The only thing about it is the close early!
|
| 4 | 6 | Soup | My brother was in town and wanted to get a
quick lunch before I had to go into work. Wanted to go into Monta but it was 11 and
they weren't open yet, so we stopped in at the Big Wong.
|
| | | |
|
| | | | Beef Ramen - for 5 you can get a bowl of ramen
(same noodles as used at Monta) and it comes with big chunks of beef. They'll ask
you for tendons too and I don't remember if they charge you extra, but I don't
think so. Came with chili oil, scallions, and siracha on the side. It was good, and
it's exactly what you expect to get, ramen and beef. Great flavor and the broth was
well seasoned. |
| 5 | 0 | Soup | This restaurant has great service. Their foods
are very delicious and not expensive. Thank you!!
|
| 4 | 1 | Smokehouse | My husband and I decided to come here for a
Saturday date night. When considering our options, we were sold when we saw the
bacon board on the menu. It did not disappoint! It was an excellent and delicious
start to our nice (giant) dinner.
|
| | | |
|
| | | | For our main course we had the BBQ sampler for
two, as well as the shrimp and grits appetizer because I just couldn't help myself!
The shrimp and grits were simply glorious. I may have preferred grilled or sautéed
shrimp, rather than fried, but the other ingredients did a great job of balancing
the richness of the fried shrimp and bacon. Marvelous.
|
| | | |
|
| | | | The sampler was very good, but not amazing. I
had been particularly looking forward to the turkey, but they had run out
(something we weren't told until after the food was delivered and I inquired about
it). The hot links were our least favorite - just not our thing, I guess. The
pulled pork was pretty good, but the ribs and brisket were definitely the stars,
and our favorites by a mile. |
| | | |
|
| | | | Since we brought up the missing turkey, we
were given a cobbler desert for free. That's about as much as I would pay for that
dessert - $0 - as it tasted like hot, vaguely-fruity mush with a layer of raw flour
on top. Whatever... they don't claim to be dessert experts, so what did I expect? I
just know better for next time. ;)
|
| | | |
|
| | | | Atmosphere is great - cozy, clean and modern.
Just hipster enough to feel cool, but not so much to make you feel uncomfortable if
you didn't show up with facial hair or a vintage t-shirt. Service is not as
attentive as I would prefer, but most likely due to having too much to do, as
opposed to a lack of effort. Everyone was very nice.
|
| 5 | 0 | Smokehouse | This place is awesome! The service was great
and quick; we literally could've gotten out of there in 30 minutes, but the vibe
was so fresh that we decided to stay for a couple more drinks! Love it!!
|
| 5 | 0 | Smokehouse | This restaurant has the absolute best
atmosphere. It starts from the moment you get out of your car and smell the aroma
from the smokehouse. From there, it is dark inside which creates a calm homey
feeling. The decor is perfect. The food is out of this world! Apple pie moonshine?
Just say yes!
|
| 5 | 1 | Shopping | If you have the chance to go to the West Side
market - do it! Even if you aren't there to grocery shop there are plenty of made-
to-order items. If you have time be sure to get a gyro from Steve's or a crepe from
Crepes de Luxe. This place is truly unique! Even if you don't buy anything, it is a
sight to see.
|
| 4 | 0 | Shopping | I love this market, crowded, fresh and cheap
veggies! Nice collection of bread, cheese and butter.
|
| | | | The only thing about it is the close early!
|
| 5 | 1 | Seafood Markets | If you have the chance to go to the West Side
market - do it! Even if you aren't there to grocery shop there are plenty of made-
to-order items. If you have time be sure to get a gyro from Steve's or a crepe from
Crepes de Luxe. This place is truly unique! Even if you don't buy anything, it is a
sight to see.
|
| 4 | 0 | Seafood Markets | I love this market, crowded, fresh and cheap
veggies! Nice collection of bread, cheese and butter.
|
| | | | The only thing about it is the close early!
|
| 5 | 0 | Sandwiches | One of the best places I've ever gone for
breakfast. Unassuming and positively delightful. Old school breakfast of two eggs
over easy with hash browns.
|
| | | | Couldn't have been better. I would never go
anywhere else in Cleveland.
|
| 4 | 1 | Restaurants | My husband and I decided to come here for a
Saturday date night. When considering our options, we were sold when we saw the
bacon board on the menu. It did not disappoint! It was an excellent and delicious
start to our nice (giant) dinner.
|
| | | |
|
| | | | For our main course we had the BBQ sampler for
two, as well as the shrimp and grits appetizer because I just couldn't help myself!
The shrimp and grits were simply glorious. I may have preferred grilled or sautéed
shrimp, rather than fried, but the other ingredients did a great job of balancing
the richness of the fried shrimp and bacon. Marvelous.
|
| | | |
|
| | | | The sampler was very good, but not amazing. I
had been particularly looking forward to the turkey, but they had run out
(something we weren't told until after the food was delivered and I inquired about
it). The hot links were our least favorite - just not our thing, I guess. The
pulled pork was pretty good, but the ribs and brisket were definitely the stars,
and our favorites by a mile. |
| | | |
|
| | | | Since we brought up the missing turkey, we
were given a cobbler desert for free. That's about as much as I would pay for that
dessert - $0 - as it tasted like hot, vaguely-fruity mush with a layer of raw flour
on top. Whatever... they don't claim to be dessert experts, so what did I expect? I
just know better for next time. ;)
|
| | | |
|
| | | | Atmosphere is great - cozy, clean and modern.
Just hipster enough to feel cool, but not so much to make you feel uncomfortable if
you didn't show up with facial hair or a vintage t-shirt. Service is not as
attentive as I would prefer, but most likely due to having too much to do, as
opposed to a lack of effort. Everyone was very nice.
|
| 4 | 1 | Restaurants | Been eating at Matt's Big Breakfast since they
were at their original location downtown.
|
| | | |
|
| | | | Always busy with a line to get in but great
places are like that so if you want to eat quickly go to Dennys so you don't have
to wait so long.
|
| | | |
|
| | | | Everything is made from scratch and fresh. The
Waffles are outstanding as are the Griddlecakes.
|
| | | |
|
| | | | I am a really big fan of the Big Butter Burger
also. The burger is just plain good and when they bring it to you, you will be
happy.
|
| | | |
|
| | | | If you can, make sure you get some bacon here
which is very good.
|
| | | |
|
| | | | Service is good and the new location is
spacious compared to the original restaurant.
|
| | | |
|
| | | | What is nice is that the small feel still
transferred to the current location.
|
| | | |
|
| | | | Would recommend going there either early in
the morning or later prior to closing to minimize your wait.
|
| | | |
|
| | | | Can't wait to go back!
|
| 5 | 0 | Restaurants | This place is awesome! The service was great
and quick; we literally could've gotten out of there in 30 minutes, but the vibe
was so fresh that we decided to stay for a couple more drinks! Love it!!
|
| 5 | 0 | Restaurants | One of the best places I've ever gone for
breakfast. Unassuming and positively delightful. Old school breakfast of two eggs
over easy with hash browns.
|
| | | | Couldn't have been better. I would never go
anywhere else in Cleveland.
|
| 4 | 6 | Restaurants | My brother was in town and wanted to get a
quick lunch before I had to go into work. Wanted to go into Monta but it was 11 and
they weren't open yet, so we stopped in at the Big Wong.
|
| | | |
|
| | | | Beef Ramen - for 5 you can get a bowl of ramen
(same noodles as used at Monta) and it comes with big chunks of beef. They'll ask
you for tendons too and I don't remember if they charge you extra, but I don't
think so. Came with chili oil, scallions, and siracha on the side. It was good, and
it's exactly what you expect to get, ramen and beef. Great flavor and the broth was
well seasoned. |
| 5 | 0 | Restaurants | I thought the bacon couldn't be topped until I
had the jelly that came with my toast. This place is the sh*t. Need to go back when
I am hungover to get the best experience. My new favorite breakfast spot.
|
| 5 | 0 | Restaurants | This restaurant has the absolute best
atmosphere. It starts from the moment you get out of your car and smell the aroma
from the smokehouse. From there, it is dark inside which creates a calm homey
feeling. The decor is perfect. The food is out of this world! Apple pie moonshine?
Just say yes!
|
| 5 | 0 | Restaurants | This restaurant has great service. Their foods
are very delicious and not expensive. Thank you!!
|
| 4 | 0 | Restaurants | The restaurant has a nice atmosphere with
great food, and good service.
|
| | | |
|
| | | | I ordered a lamb biryani. There was a mistake
in my order, so I told the manager about it. He apologized for the mistake and
offered me another order for free as a compensation, which I gladly accepted.
|
| | | | The manager handle the situation
professionally, which I appreciate.
|
| 5 | 1 | Public Markets | If you have the chance to go to the West Side
market - do it! Even if you aren't there to grocery shop there are plenty of made-
to-order items. If you have time be sure to get a gyro from Steve's or a crepe from
Crepes de Luxe. This place is truly unique! Even if you don't buy anything, it is a
sight to see.
|
| 4 | 0 | Public Markets | I love this market, crowded, fresh and cheap
veggies! Nice collection of bread, cheese and butter.
|
| | | | The only thing about it is the close early!
|
+-------+--------+-----------------
+----------------------------------------------------------------------------------
-----------------------------------------------------------------------------------
-----------------------------------------------------------------------------------
-----------------------------------------------------------------------------------
-------------------------------------------------------------+
(Output limit exceeded, 25 of 695 total rows shown)

iv. Provide the SQL code you used to create your final dataset:

select r.stars,r.useful, c.category, TRIM(r.text) text


FROM (review r inner join business b ON r.business_id = b.id) left join category c
ON r.business_id = c.business_id;

You might also like