I am currently trying to create a database where the user will complete a series of activities, and their score from each activity will be stored in an ‘ActivityLog’ table, here is the current format: …
Tag: database
SQL Server – convert date to weekday and count each instance of weekday in second column
Wondering how to select from a table: I’d like to get a result table of two columns: weekday and the number of purchases of each weekday. So far, I have something like this: But this returns two Thursday rows and two weekend rows, because they are different weeks. How can I get it to only return 1 row for each
SQL – Join with keys separated by pipe
TABLE_A TABLE_B How can I join table A and B to get all those who helped in the cargo? Will I need to write a function? I did not develop the program. I’m creating a dashboard and need that info. Using ORACLE 11g DB CONCLUSION — SOLVED After a bit of research and help of friends I was able to
Retrieve Total Chapters in each books
I have got the database which has id,chapter_name,chapter_num,verse_num,verse_text,testament as columns. I would like to retrieve chapterName and the total number of chapters in each book. I’m using the following query to do so, Unfortunately, it lists a very big count of chapter names and duplicate chapter names as well. How can I fix this? This is the sample input id,chapter_name,chapter_num,verse_num,verse_text,testament
INSERT INTO a table comparing two other tables using Not EXISTS
I have 3 tables: Server_db_relation DatabaseList DatabaseList_Archive The goal is to compare table Server_db_relation and DatabaseList based on the values in column ServerName and DatabaseName. If the values do not exists in the table Server_db_relation, but do exist in DatabaseList, then it should insert the entire row from DatabaseList into DataList_Archive (those two tables are identical in structure). In addition,
How do I include an additional non-aggregated column for each of my in my PIVOT values?
I have the following code fragment which gives me the current results below. I’m attempting to add an additional column for each of my pivoted values in order to include the lastview data for each of …
Problems with insertions after adding new tables to database
UPDATE: override fun onUpgrade(db: SQLiteDatabase?, oldVersion: Int, newVersion: Int) { if (oldVersion < 3) { db?.execSQL(ARTIGO_TABLE_NAME); } if (oldVersion < 3) { ...
Using CURSOR expression in WITH Clause in query Oracle 12.1
I have a strange issue where the data showing up in Cursor is incorrect. Below is the table and the query. But when I replace the CURSOR (Select * from H) with CURSOR( actual query of H ) , it works Output of above query give Cnt = 3 and cursor has data as below which is incorrect. But when
SQL SERVER – GRAB RECORD FROM THE TABLE BASED ON COLUMN ID
I have a db with records like the following structure in the table; I have and entire db set up like this where the fid in some cases matches the id of another record. In that case id like to return one record with 2 different dates such as ; I was thinking a self join but got hung up
How to modify database schema on production
When I start a project with an agile process where I don’t have a complete DER for my database, how I make changes in tables that already have data in production. For example: Have table costumers products and sales, in the beginning sales table only have the columns id, costumerId, productId and quantity. But in the future we need to