Category : python-sql

The problem is occuring in the ModifyRecords class I have commented at the line where button is connected to a function but does not call the function. import mysql.connector from PyQt5 import QtCore, QtGui, QtWidgets class Ui_MainWindow(object): def setupUi(self, MainWindow): MainWindow.setObjectName("MainWindow") MainWindow.resize(800, 600) self.centralwidget = QtWidgets.QWidget(MainWindow) self.centralwidget.setObjectName("centralwidget") self.b1 = QtWidgets.QPushButton(self.centralwidget) self.b1.setGeometry(QtCore.QRect(210, 30, 321, 31)) font ..

Read more

You have a Folder. Inside that folder Having Multiple text files. Example: 1.txt, 2.txt,3.txt….. That Three Text files having 2 Columns—> No, Name…. You have to give Folder path during the output. You have to write a code to read all Text files Inside that folder and Store in a Single SQL Table. Source: Python ..

Read more

I’m getting error while I’m trying to run below sqlite query. Everything seems right to me. Can anyone help please? c.execute("select x.*,row_number() over(partition by yr_mnth order by avg_rtng desc) as mv_rnk from(SELECT item,avg(rating) avg_rtng, strftime(‘%Y%m’,date(ROUND(timestamp / 1000), ‘unixepoch’)) as yr_mnth FROM reviews m GROUP BY m.item,strftime(‘%Y%m’,date(ROUND(timestamp / 1000), ‘unixepoch’))) x") I tried to search and ..

Read more

I try to print the 3 columns: 1) Artists.artist, 2)Songs.Song, and 3) Songs.views conn = sqlite3.connect(‘utube.db’) conn.row_factory = lambda cursor, row: row[0] c = conn.cursor() c.execute("""Select Artists.artist, Songs.Song ,Songs.views FROM Songs INNER JOIN Artists ON Artists.Artist_Id = Songs.Artist_Id """) allsong = c.fetchall() a= allsong print(a) conn.commit() conn.close() But the output returns me only Artists.artist. [‘Blackpink’, ..

Read more

When i run the code i get this error I could not solve the error pymysql.err.ProgrammingError (1064, "You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ‘=’efe’ and password=’2” at line 1") enter image description here sql server xampp ..

Read more