Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write the following SQL SELECT statements for the twitter database a) List the followers of the user with the ID 123. [5 points] b) How

image text in transcribed

Write the following SQL SELECT statements for the twitter database a) List the followers of the user with the ID 123. [5 points]

b) How many followers does the user with the user name HillaryClinton have? [10 points]

c) Find the user with the largest number of followers. [5 points]

d) How many tweets does each user have in the data base? [10 points]

5

e) Find the users who do not write any tweets. [5 points]

f) Create a list of all users with the number of Tweets and the number of followers. [5 points]

g) BONUS: You decide that an appropriate importance score for users is the number of tweets times the number of followers. Who are the 10 most important users in the database? [Additional 10 points]

h) How do foreign keys prevent deletion anomalies? [5 points]

3) Given is a twitter database with tables created by the following statements: CREATE TABLE Tweet ( ID integer PRIMARY KEY, userlD integer, content text, FOREIGN KEY (userlD) REFERENCES User CREATE TABLE User (ID integer PRIMARY KEY, age integer, username text) nteger, usename tex CREATE TABLE Follows ( followerlD integer, followingID integer, PRIMARY KEY (followerID, followingID) FOREIGN Key (followerID) REFERENCES User, FOREIGN Key (followingID) REFERENCES User Draw the ER Model implemented in this data base. [10 points]

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

Step: 3

blur-text-image

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

Automating Access Databases With Macros

Authors: Fish Davis

1st Edition

1797816349, 978-1797816340

More Books

Students also viewed these Databases questions

Question

7. How might you go about testing these assumptions?

Answered: 1 week ago

Question

What are Decision Trees?

Answered: 1 week ago

Question

What is meant by the Term Glass Ceiling?

Answered: 1 week ago