Skip to content

Tag: sql

Get range of columns with specific value in Oracle

I wasn’t sure how to title this question, but I’ve got an Oracle table that has a column for each day of the week. These represent the days a business is open. The values in these columns is either ‘Y’ or ‘N’. This is how the table was setup years ago and I am unable to cha…

Set character set in sqlite [closed]

Closed. This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed 1 year ago. Improve this question how to do character set in sqlite query.enter image description here Answer You have to use t…

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 …

postgresql subtract between row while column shift

I have a simple table like this I would like to subtract row of yesterday on day(i+1) to row of today on day(i). For example, if today is 2020-01-02 the expected results should be the 0 (day0) was obtained by 2 (from 2020-01-01 day1) – 2 (from 2020-01-02 day0) the -2 (day1) was obtained by 1 (from 2020-…