Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Given below is the schema for the data. There are a total of 12 tables, thus 12 CSV files, each corresponding to a relational table.

Given below is the schema for the data. There are a total of 12 tables, thus 12 CSV

files, each corresponding to a relational table.

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)

constraint confidence >= 0 and confidence <=10

constraint sentiment >= -5 and sentiment <=5

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))

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.

writing in SQL

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

The Temple Of Django Database Performance

Authors: Andrew Brookins

1st Edition

1734303700, 978-1734303704

More Books

Students also viewed these Databases questions