IBM INTERVIEW QUESTION | Find Activities with Medium Participation Levels!

 DROP TABLE IF EXISTS Friends

DROP TABLE IF EXISTS Activity


CREATE TABLE Friends

(

id INT,

[name] varchar(255),

activityid INT

)


CREATE TABLE Activity

(

id INT,

[name] varchar(255)

)


INSERT INTO friends

VALUES 

(1,'Jon',1),

(2,'Ravi',2),

(3,'Rahul',2),

(4,'Christie',3),

(5,'Jade',3),

(6,'Victor',1),

(7,'Dan',1),

(8,'Bob',4)



INSERT INTO Activity

VALUES

(1,'Swimming'),

(2,'Dancing'),

(3,'Running'),

(4,'Drawing')


Comments

Popular posts from this blog

50 Essential SQL Questions to Land Your Dream Job

How to find all the customers who placed orders on three consecutive days | SQL Scenario questions

ACCENTURE SQL INTERVIEW QUESTION | Change the ProductIDs