Skip to content

Tag: database

Auto-increment a primary key in MySql

During the creation of tables using mysql on phpmyadmin, I always find an issue when it comes to primary keys and their auto-increments. When I insert lines into my table. The auto_increment works perfectly adding a value of 1 to each primary key on each new line. But when I delete a line for example a line w…

How to make it into BCNF

Good morning, I wonder how I can make sure this schema is in BCNF. petition(ID, title, contents, budget, organizationID, official, resultID, applicantID) applicant(ID, name) official(ID, name, department) organization(ID, name, phoneNumber) *Each petition has an official. *Each petition should have more than …

One to One Mapping Spring boot

Hello everyone in advance I have a problem with my one to one connection when I try to log in to the “user” I get this error what i need is a one to one connection that does not have to be persistent that means a user can have a player but does not have to have it and the

SQLite – Rolling Average/Sum

I have a dataset as shown below, wondering how I can do a rolling average with its current record followed by next two records. Example: lets consider the first record whose total is 3 followed by 4 and 7 ,Now the rolling 3 day average for first record would be 4.6 and so on. Expected output: PS: Having &#822…