SuperTutor

(15)

$15/per page/Negotiable

About SuperTutor

Levels Tought:
Elementary,Middle School,High School,College,University,PHD

Expertise:
Accounting,Business & Finance See all
Accounting,Business & Finance,Economics,Engineering,HR Management,Math Hide all
Teaching Since: Apr 2017
Last Sign in: 234 Weeks Ago, 6 Days Ago
Questions Answered: 12843
Tutorials Posted: 12834

Education

  • MBA, Ph.D in Management
    Harvard university
    Feb-1997 - Aug-2003

Experience

  • Professor
    Strayer University
    Jan-2007 - Present

Category > Programming Posted 18 May 2017 My Price 11.00

define the term "advertisement-gap"

I need some MySQL help. 

 

Here is a reference table I have already set up : 

user (email, password, name, date_of_birth, address, type)
primary key(email)

celebrity (email, website, kind)
primary key(email)

blurt (blurtid, email, text, location, time)
primary key(blurtid,email)
foreign key(email) references user(email)

hobby (email, hobby)
primary key(email,hobby)
foreign key(email) references user(email))

follow (follower,followee)
primary key(follower,followee)
foreign key(follower) references user(email)
foreign key(followee) references user(email))

vendor (id, name)
primary key(id)

vendor_ambassador (vendorid, email)
primary key(vendorid)
foreign key(email) references user(email)
foreign key(vendorid) references vendor(id))

topic (id, description)
primary key(id)

vendor_topics (vendorid,topicid)
primary key(vendorid, topicid)
foreign key(vendorid) references vendor(id)
foreign key(topicid) references topic(id))

blurt_analysis (email,blurtid,topicid,confidence,sentiment)
primary key(email, blurtid, topicid)
foreign key(email,blurtid) references blurt(email,blurtid)
foreign key(topicid) references topic(id)

advertisement (id, content, vendorid)
primary key(id)
foreign key(vendorid) references vendor(id))

user_ad (email,adid)
primary key(email,adid)
foreign key(email) references user(email)
foreign key(adid) references advertisement(id))   

These are the questions I need answered written in SQL 

Mini Project - Database Practice

2) For each celebrity user, find the total number of followers. Your SQL query should print the name of the celebrity and the corresponding number of followers.
3) For each celebrity, find the number of blurts. Order the result in decreasing order of the number of blurts. Your query should print the name of the celebrity and the associated count in decreasing order of the count.
4) Write an SQL query to print names of all celebrities who are not following anyone! 5) Write an SQL query that gives the email of its brand ambassador and the number users who are following the brand ambassador for each vendor. Your SQL query should print vendor name, email and the total number of users who are following it.

 

6) Let us define the term "advertisement-gap" as the number of users who have blurted about a topic that is of interest to a vendor but are not being shown any advertisements from the vendor. Write an SQL query that gives the vendor name and the corresponding "advertisement-gap" in decreasing order of the advertisement_gap. 7) Write an SQL query to find all pairs of users (A,B) such that both A and B have blurted on a common topic but A is not following B. Your query should print the names of A and B in that order.

8) You need to help users connect with other users. There could be there different users A,B and C such that A follows B, B follows C but A does not follow C. Write an SQL query to find all such triplets of A,B, and C. Your query should print the emails of users A,B and C in that order.

9) For each topic, find the states (ex: California) where “the average sentiment associated with the blurts related to the topic” is negative. Your query should print the topic id, topic name, state, total # of blurts and average sentiment for each topic.

 

 

Answers

(15)
Status NEW Posted 18 May 2017 02:05 AM My Price 11.00

-----------

Not Rated(0)