Solution :
map (k, student) {
// here we can add the where clause condition
if (student.gender == 'male') {
// here we can get the data in map
stud1 = <student.year, student.gpa>
// here we can collect all the data
collect (student.year , stud1)
}
}
// Here each yr that reduce gets corresponds to a unique value in
student.year field.
// Group by is implicitly done using the shuffling phase between
map and reduce functions.
reduce(yr, studentList<stud1>) {
avg := 0
// for loop iterate upto the length of studentList
for each student in studentList {
// sum the gpa of all student
avg += student.gpa
}
// calculate the gpa avg of all students
avg := avg / size(studentList)
// assign map to stud2 variable
stud2 = <student.year, avg>
// store the data
store (yr, stud2)
}
gender) in HDFS, write a MapReduce Given a 10TB table Student (name, year, program to compute the following query. gpa, SELECTyear, AVG (gpa) FROM WHERE GROUP BY year Student gender'Male' Ans...
Course: Fundamentals of Databases Write a Query for the Following Table. Table Name: Student Stu_ID Name Age Address Phone 1452364 Alla 22 Riyadh 7772223310 1452365 Ahamed 25 Jeddah 7772223311 a) Write a Query for Create Table: b) Write a Query for insert filed in above Given Table. c) Write a Query for Replace Age = 25 Replace by 26 the above given Table. d) Write a Query for Remove Student ID =1452364 one Row above given Table. e) Drop Student...
12.8 GPA reports using files This program is to compute and write to a file the GPA for student scores read from an input file. As in Lab 7.5, the point values of the grades are 4 for A, 3 for B, 2 for C, 1 for D, and 0 for F. Except for the grade A, where + has no effect, a + after the letter increases the point value by 0.3, and except for F, where a -...
In C: Write a program that will compute and print a table of the factorials from 1 to 12. The program should define a function called fact to compute the factorial, use loops where appropriate, and produce the following output: 1 1 2 2 3 6 4 24 5 120 6 720 7 5040 8 40320 9 362880 10 3628800 11 39916800 12 479001600
2- Write a program that has a Person class, a Student class, that is derived from Person, and a Faculty class, derived from Person as well, with the following specifications: The Person class has the following members: a. An integer private member variable named SSN. b. Two string protected member variables named firstName and lastName. C. An integer protected member variable named age. d. A constructor that takes SSN, first name, last name, and age as parameters. e. A constructor...
Problem Specification:Write a C++ program to calculate student’s GPA for the semester in your class. For each student,the program should accept a student’s name, ID number and the number of courses he/she istaking, then for each course the following data is needed the course number a string e.g. BU 101 course credits “an integer” grade received for the course “a character”.The program should display each student’s information and their courses information. It shouldalso display the GPA for the semester. The...
Write a query in SQL to list the following information of the artists in movie industry. Limit this information to only 5 artists. Sort the information by age descending order. Full name : first name and last name separated by space Age: Current age Address: State that he resides Contact number: Phone number This is from an artist table, where first_name, last_name, contact_no, address, birth_date are the fields in the table. Birth date in the table...
Create a java project and create Student class. This class should have the following attributes, name : String age : int id : String gender : String gpa : double and toString() method that returns the Student's detail. Your project should contain a TestStudent class where you get the student's info from user , create student's objects and save them in an arralist. You should save at least 10 student objects in this arraylist using loop statement. Then iterate through...
In this homework, you will design a program to perform the following task: Write a program that would allow a user to enter student names and Final grades (e.g. A,B,C,D,F) from their courses. You do not know how many students need to be entered. You also do not know how many courses each of the students completed. Design your program to calculate the Grade Point Average (GPA) for each student based on each of their final grades. The program should...
Name the DCL ( table. idently given permissions to delete records from the Customer table. Write control language) statement such that Bob cannot delete records from Customer Data A university has two tables, Student and Alumni, ALUMNI Table Attribute DENT Table ibute ntiD Data Type INTEGER(8,0 VARCU ntName
Here is the description of the client and server programs that you need to develop in C using TCP: Suppose we have a simple student query system, where the server keeps student's info in an array of struct student_info ( char abc123171 char name [101 double GPA; To simplify the tasks, the server should create a static array of 10 students with random abc123, name, and GPA in the server program. Then the server waits for clients. When a client...