Icode |
Item Name |
Rate |
1003 |
Scanner |
10500 |
1004 |
Speaker |
3000 |
1005 |
Printer |
8000 |
1008 |
Monitor |
15000 |
1010 |
Mouse |
700 |
import sqlite3
connectoin = sqlite3.connect(“company.db”) cursor = connection.cursor() cursor.execute(“Select * from product”)
print(“Displaying Records”) result = cursor.fetchmany(5)
print(*result, Sep = “\n”)
Output:
Displaying records (1003, ‘Scanner’ , 10500)
(1004, ’Speaker’ , 3000)
(1005, ‘Printer’ , 8000)
(1008, ’Monitor’ , 15000)
(1010, ‘Mouse’ , 700)