मराठी
तामिळनाडू बोर्ड ऑफ सेकेंडरी एज्युकेशनएचएससी विज्ञान इयत्ता १२

The hat is the use of the HAVING clause. Give an example python script. - Computer Science

Advertisements
Advertisements

प्रश्न

The hat is the use of the HAVING clause. Give an example python script.

थोडक्यात उत्तर
Advertisements

उत्तर

Having a clause is used to filter data based on the group functions. This is similar to the WHERE condition but can be used only with group functions. Group functions cannot be used in the WHERE Clause but can be used in the HAVING clause.

Example
import sqlite3
connection= sqlite3.connect(“Academy.db”)
cursor = connection. cursor( )
cursor.execute(“SELECT GENDER,COUNT(GENDER) FROM Student GROUP BY GENDER HAVING COUNT(GENDER)>3 “)
result = cursor. fetchall( )
co= [i[0] for i in cursor, description]
print(co)
print( result)

OUTPUT
[‘gender’, ‘COUNT(GENDER)’]
[(‘M’, 5)]

shaalaa.com
  या प्रश्नात किंवा उत्तरात काही त्रुटी आहे का?
पाठ 15: Data manipulation through SQL - Evaluation [पृष्ठ ३१९]

APPEARS IN

सामाचीर कलवी Computer Science [English] Class 12 TN Board
पाठ 15 Data manipulation through SQL
Evaluation | Q 3. | पृष्ठ ३१९
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×