हिंदी
तमिलनाडु बोर्ड ऑफ सेकेंडरी एज्युकेशनएचएससी विज्ञान कक्षा १२

Which method is used to connect a database? Give an example. - Computer Science

Advertisements
Advertisements

प्रश्न

Which method is used to connect a database? Give an example.

टिप्पणी लिखिए

उत्तर

  • Connect()method is used to connect a database
  • Connecting to a database means passing the name of the database to be accessed.
  • If the database already exists the connection will open the same. Otherwise, Python will open a new database file with the specified name.

Example:
import sqlite3
# connecting to the database
connection = sqlite3.connect (“Academy.db”)
# cursor
cursor = connection. cursor()

shaalaa.com
Database
  क्या इस प्रश्न या उत्तर में कोई त्रुटि है?
अध्याय 15: Data manipulation through SQL - Evaluation [पृष्ठ ३१८]

APPEARS IN

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

Englishहिंदीमराठी


      Forgot password?
Use app×