06 RIO ANSI SQL Clauses Hands-On Exercise 1
06 RIO ANSI SQL Clauses Hands-On Exercise 1
Table of Contents
ANSI SQL 06: ANSI SQL CLAUSES.................................................................................3
Exercise.1......................................................................................................................3
Page 2
Page 2
Cognizant Technology Solutions, All Rights Reserved
C3: Protected
Hands-on Exercise – ANSI SQL Operators - 04
Exercise.1
Estimated Completion Time: 60 Minutes Marks
: xx
Problem Statement:
Problem 1: Develop a SQL query which would retrieve the number of associates enrolled
for modules on a specific date grouped by start date and display start date and total
number of associates.
Problem 2: Develop a SQL query which would retrieve the number of associates enrolled
for modules where trainer id is ‘F001’ grouped by start date and display start date and total
number of associates.
Problem 3: Develop a SQL query which would retrieve the number of associates enrolled
for modules where trainer id is ‘F001’ grouped by module start date and display module
start date and total number of associates where the total number of associates > 2.
Problem 4: Develop a SQL query which displays all the modules in increasing order of
module duration.
Problem 5: Develop a SQL query which would retrieve and display the associates name,
their module enrolled (module name and module id), base fees. Display the records
ordering the base fees in descending order.
Deliverables Expected:
Solution Queries
order by module_duration;
5)select ar.associate_name,m.module_id,m.module_name,m.base_fees from
associate_status a inner join module_info m inner join associate_info ar
on a.module_id=m.module_id and
ar.associate_id=a.associate_id
order by base_fees desc;
Tips:
http://dev.mysql.com/doc/refman/5.0/en/group-by-functions-and-modifiers.html
http://dev.mysql.com/doc/refman/5.0/en/select.html
Page 4
Page 4
Cognizant Technology Solutions, All Rights Reserved
C3: Protected