Peter has created a table named Account in MySQL database, SCHOOL, having following structure:
Stud_id – integer
Sname – string
Class – string
Fees – float
Help him in writing a Python program to display records of those students whose fees is less than 5000.
Note the following to establish connectivity between Python and MySQL: Username – admin, Password – root, Host – localhost
import mysql.connector as mc
con = mc.connect(host='localhost', user='admin', password='root', database='SCHOOL')
cur = con.cursor()
cur.execute('SELECT * FROM Account WHERE Fees < 5000')
data = cur.fetchall()
for row in data:
print(row)
con.close() The SELECT statement when combined with \(\_\_\_\_\_\_\) clause, returns records without repetition.
print(16 * 5 / 4 * 2 / 5 - 8)
myStr[:4] extracts the first 4 characters, which are "MISS".myStr[-5:] extracts the last 5 characters, which are "SIPPI"."#" in between, resulting in "MISS#SIPPI".In SQL, the aggregate function which will display the cardinality of the table is \(\_\_\_\_\_\).