PW Akshay

Generation

generate functionFri, 02 Dec 2022

Create a student table and insert data. Implement the following SQL commands on the student table: o ALTER table to add new attributes / modify data type / drop attribute o UPDATE table to modify data o ORDER By to display data in ascending / descending order o DELETE to remove tuple(s) o GROUP BY and find the min, max, sum, count and averag

class Student: def __init__(self, name, age, grade): self.name = name self.age = age self.grade = grade # 0 - 100 def get_grade(self): return self.grade class Course: def __init__(self): self.students = [] def add_student(self, student): if len(self.students) < 30: self.students.append(student) def get_average_grade(self): value = 0 for student in self.students: value = value + student.get_grade() return value / len(self.students) s1 = Student("Tim", 19, 95) s2 = Student("Bill", 19, 75) s3 = Student("Jill", 19, 65) course = Course() course.add_student(s1) course.add_student(s2) course.add_student(s3) course.

Questions about programming?Chat with your personal AI assistant