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

I have two SQL questions. 1: How many people follow Joey? 2: How many people doe

ID: 3798141 • Letter: I

Question

I have two SQL questions.

1: How many people follow Joey?

2: How many people does Joey follow?

Attached are images that can help you solve this.

sql DROP TABLE IF EXISTS users; DROP TABLE IF EXISTS follows; CREATE TABLE users NOT NULL, USERID INT NAME VARCHAR 256) NOT NULL, YEAR FLOAT NOT NULL, PRIMARY KEY (USERID) CREATE TABLE follows NOT NULL, USERID INT NOT NULL, FOLLOWID INT PRIMARY KEY USERID FOLLOWID) Done. Done. Done. Done. capture count 0 users Ian Daniel "Sarah "Kelly Sam "Alison", "Henry", "Joey", "Mark", "Joyce", "Natalie", "John" years [1, 3, 4, 3, 4, 2, 5, 2, 1, 3, 4, 21 for username 1 year in zip (users years count sql INSERT INTO users VALUES Count $username year

Explanation / Answer

1)

select count(*)

where FOLLOWID = (select USERID

from users

where u.NAME = "Joey")

2)

select count(*)

where USERID = (select USERID

from users

where u.NAME = "Joey")