Advertisements
Advertisements
Question
Give a python statement Using the where clause.
Short/Brief Note
Advertisements
Solution
import sqlite3
connection = sqlite3.
connect(“Academy, db”)
cursor = connection. cursor()
cursor, execute (“SELECT DISTINCT (Grade) FROM student where gender=’M'”)
result = cursor. fetchall()
print(*result, sep=”\n”)
OUTPUT:
(‘B’,)
(‘A’,)
(‘C’,)
(‘D’,)
shaalaa.com
Is there an error in this question or solution?
