English
Tamil Nadu Board of Secondary EducationHSC Science Class 12

Give a python statement Using the where clause. - Computer Science

Advertisements
Advertisements

Question

Give a python statement Using the where clause.

Short Note

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
SQL Query Using Python
  Is there an error in this question or solution?
Chapter 15: Data manipulation through SQL - Evaluation [Page 318]

APPEARS IN

Samacheer Kalvi Computer Science [English] Class 12 TN Board
Chapter 15 Data manipulation through SQL
Evaluation | Q 3. b. | Page 318
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×