All Tracks Problem

Count the Matches
Tag(s):

Easy

Problem
Editorial
Analytics

Fredo has recently joined the statistical section of a cricket broadcasting channel. He is given a table which consists of three fields as described below:
1. MatchId: Id of the cricket match.
2. U1: Name of the first on field umpire.
3. U2: Name of the second on field umpire.

His task is to count the number of matches in which one of the on field umpires is 'Bowden' or 'Taufel' and the other umpire is not 'Buckner'. Help him with the task.

Note: Cricket is a game in which there are two on field umpires in every match.

Input Format:

Table : UmpireInfo

Field Type
MatchId int
U1 text
U2 text

Output Format:

Field Type
Ans int

Sample Input:

Sample logs Table:

MatchId U1 U2
1 Bowden Buckner
2 Bowden Taufel
3 Buckner Taufel
4 Taufel Bowden
5 Taufel Bowden
6 Buckner Bowden
7 Buckner Taufel
8 Taufel Buckner

Sample Output:

Ans
3

Explanation:

The matches 2,4 and 5 satisfy the given condition. Hence, answer is 3.

Time Limit: 5 sec(s) for each input file.
Memory Limit: 256 MB
Source Limit: 1024 KB
Marking Scheme: Marks are awarded when all the testcases pass.
Allowed Languages: MySQL, PostgreSQL, MSSQL, Oracle Database

CODE EDITOR

Initializing Code Editor...
Your Rating:

Contributor

Notifications
View All Notifications