Question: Refer to given table and insert into the file the implementations of the following queries as SELECT statements of SQL The queries listed below must

Refer to given table and insert into the file the implementations of the following queries as SELECT statements of SQL

The queries listed below must be implemented as SELECT statements

SQL 1.

CREATE TABLE Students ( StudentCode varchar(10) NOT NULL, StudentName varchar(80) NOT NULL, EmailAddress varchar(80) NOT NULL, ContactNumber varchar(80) NOT NULL, ProgramEnrolled varchar(80) NOT NULL, Position varchar(3) NOT NULL, YearJoined varchar(3) NOT NULL, Studentclub varchar(10) NOT NULL, Student2ndclub varchar(10) NOT NULL, PRIMARY KEY (StudentCode) );

SQL2.

CREATE TABLE Events ( Eventcode varchar(3) NOT NULL, Eventname varchar(80) NOT NULL, EventstartD varchar(10) NOT NULL, EventendD varchar(10) NOT NULL, Eventyear varchar(10) NOT NULL, EventstartT varchar(10) NOT NULL, EventendT varchar(10) NOT NULL, Eventhost varchar(10) NOT NULL, Eventatt varchar(10) NOT NULL, Eventlocation varchar(30) NOT NULL, Eventclubhost varchar(10) NOT NULL, PRIMARY KEY (Eventcode) );

SQL3.

CREATE TABLE Clubs ( Clubcode varchar(80) NOT NULL, Clubname varchar(80) NOT NULL, Clubtype varchar(10) NOT NULL, Clubyear varchar(10) NOT NULL, PRIMARY KEY (Clubcode) );

Question 1. - List down all students who joined more than one club

:SELECT Studentname FROM Students WHERE Student2ndclub IN ('C01', 'C02', 'C03', 'C04', 'C05') ORDER BY Studentcode

- this is what I came with, please let me know if anything to revise.

Question 2.- Develop a query to list down member of one club containing the members details like name, email, program and position in the club (label as member if the student is not part of the committee). This query should allow user to enter which club they want to generate the list using club code.

: I'm not sure what to do with this question.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!