Many To Many Relation Solved:
- Query 1. Write an SQL statement that correctly uses the ‘LIKE’ symbol on an alphanumeric field to select a subset of data. Explain the purpose of your query for your database solution.
- select clubID, clubName, address, state from club where Services LIKE '%Swimming%' order by clubID DESC
Reason behind writing this query is to know which club is proving swimming services.
- Query 2. Write an SQL statement that correctly implements a JOIN statement over two or more entities to select a subset of data. Explain the purpose of your query for your database solution.
- select t.type, m.firstName,m.state,c.clubName from traineemember t inner join member m On t.memberID = m.memberID and FirstName = 'Olivia' inner join club c On c.clubID = m.clubID;
Reason behind writing this query is to know the member name olivia joined which gym.
- Query 3. Write an SQL statement that correctly uses the ‘>’ operator to select a subset of data for a single entity. Explain the purpose of your query for your database solution.
- select c.clubName,m.firstName as memberName,m.state, c.Services,p.PerHour as Fees from trainer tr inner join personaltrained p
on tr.TrainerID = p.TrainerID and perhour > 150 inner join traineemember t on t.traineeID =p.traineeID inner join member m on m.memberID =t.traineeID inner join club c on c.clubID = m.clubID;
Read More
Get Assignment Help from Me