All Tracks Problem

Little Shino And Swaps
Tag(s):

Very-Easy

Problem
Editorial
Analytics

Teachers of ByteSchool created a table of score of students in two exams. Since the data is manually created, the teachers of the school have accidentally swapped the marks of some students. Swapping means score of exam 1 is written in score of exam 2 and vice versa. Teachers don't want to correct it manually again so they ask for your help.

You are given two tables.

Marks: Contains the student ids and scores of students in two exams.
Students: Contains the student ids whose entries are swapped ( all the student ids are unique ).

Using these two tables you have to correct the entries of Marks.

The output table should be in increasing order of StudentId.

Input Format:

Table : Marks

Field Type
StudentId integer
Score1 integer
Score2 integer

Table : Students

Field Type
StudentId integer

Output Format:

Field Type
StudentId integer
Score1 integer
Score2 integer

Sample Input:

Sample Marks Table:

StudentId Score1 Score2
1 99 76
2 88 27
3 31 58
4 24 45
5 64 57

Sample Students Table:

StudentId
1
2

Sample Output:

StudentId Score1 Score2
1 76 99
2 27 88
3 31 58
4 24 45
5 64 57
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_Db

CODE EDITOR

Initializing Code Editor...
Your Rating:

Contributor

Notifications
View All Notifications