A Python Code To Sort A List in Ascending Order Using Bubble Sort
A Python Code To Sort A List in Ascending Order Using Bubble Sort
def bubble_sort(arr):
n = len(arr)
for i in range(n):
# Example Usage:
bubble_sort(my_list)
output:
contents = file.read()
print("Contents of 'test.txt':")
print(contents)
OUTPUT:
Contents of 'test.txt':
Output: NAME
-----
RAKESH
AMARJIT
LOREN
ROGER
JOHN
(e)Display the total stipend of male students:
SELECT SUM(STIPEND) AS TotalStipend FROM STUDENT WHERE SEX = 'M';
output: TotalStipend
-------------
14700
(f) List all the students in descending order of their stipend:
SELECT * FROM STUDENT ORDER BY STIPEND DESC;
Output:
MedicalStudentsCount
---------------------
4
(h) To insert a new row in the table with the values. 11, "JOHN", "SCIENCE",
2700, 24, "M":
INSERT INTO STUDENT (SL_no, NAME, STREAM, STIPEND, AGE, SEX) VALUES (11, 'JOHN', 'SCIENCE', 2700, 24,
'M');