Header Ads Widget

Responsive Advertisement

Ticker

6/recent/ticker-posts

Delete Record python MySQL (python class part 👉 37 ) in Hindi language

 


DELETE record Python MySql

Database में table में record को delete करने के लिए DELETE FROM SQL स्टेटमेंट का उपयोग करना होता है।

जब भी Record DELETE करे तो where clause(condition) का उपयोग करे नहीं तो सभी record delete हो जायेंगे।

DELETE FROM employee WHERE id=1

import mysql.connector

db = mysql.connector.connect(
  host="localhost", user="username", passwd="password", database="dbname"
)

crsr = = mydb.cursor()

crsr.execute("DELETE FROM employee WHERE id=1")
db.commit()

print(crsr.rowcount, "record(s) deleted")
db.close()


ENGLISH me padhne ke liye 👇👇

DELETErecord Python MySql

 The DELETE FROM SQL statement has to be used to delete the records in the table in the database.

 Whenever record DELETE, use all where clause (condition) or else all records will be deleted.

 DELETE FROM employee WHERE id = 1

 import mysql.connector db = mysql.connector.connect (host = "localhost", user = "username", passwd = "password", database = "dbname") crsr = = mydb.cursor () crsr.execute ("DELETE"  FROM employee WHERE id = 1 ") db.commit () print (crsr.rowcount," record (s) deleted ") db.close ()

 for more videos Comments now .... All students of Python

 Ye topic kaisa lega ye bhi zaroori bataye agla video kis program ke upar chahiye ye bhi bataye

एक टिप्पणी भेजें

0 टिप्पणियाँ