I need to create a database which is a top 5 leaderboard, however, what I tried didn’t work – it brought up many different errors (code below): Problems: The 4th line beginning “db = ” comes up with an error on the brackets. I initially thought it had to do with the fact that I am tryi…
Tag: sql
How to access a local, pre-populated sqlite database using Kotlin in Android Studio?
For a personal project, I am creating a quiz app written in Kotlin. To store information about a given question (four choices, the question itself, a category, and the correct answer), I have created a database using SQLite that stores said information. However, I am not unsure of a couple of things. One is w…
How do I count and sum from different tables (SQL)
I am trying to write an SQL statement that does this: For each customer that has an order, I need to list the customer’s number, the number of orders that customer has, the total quantity of items on those orders and the total price for those items. I then to need sort the result by the customer number.…
Querying for users who have NOT completed a survey today and Receiving an error
I have a feature I am working on and I need my PostgreSQL db to return all the users that have not completed a survey today. I am using a left join to join on my survey results table and filtering by customer_id and where the survey_results.created < today but I am using a date part and extract to get
How to find Max value in a column in SQL Server 2012
I want to find the max value in a column Above is my table structure. I just want to find the max total value only from the table. In that four row ID 1 and 2 have same value in CName but total val and PName has different values. What I am expecting is have to find the max value
MySql Partitioning questions for very segmented data
There are a number of partitioning questions out here and a lot of the time people caution that it often does not help performance. I want to see if my use case is one of the few that does and also clarify something. In my use case, every user is going to be assigned to a bucket. Every user in
How can i use sum ? with more then 2 key
This is my table structure. I want to use SUM for Ingredients.Recipe_Ingredient_Gr and Ingredients.Recipe_Ingredient_Piece for each Recipe in selected order. My english is not enough to tell u exactly what i mean but i’ll try to tell u with example. in my program user will create stock data and after th…
How to auto generate data types for a SQL table
I have many denormalize tables with 200+ columns. These tables are in SQL Server and they often, if not always, have varchar(100) or nvarchar(100) (string) data types. However, most columns are either ints, floats or other data types. It is not possible for me to go through every table & col and pick and …
How to retrieve data from other Excel using VBA and SQL?
I have a problem with my code. I tried retrieving data from other Excel file. My code works but I received full data in one cell (A1). I’m sorry but I’m just beginner, believe that’s the problem related to output, but I’m not find out why: Answer No need to wrap recordset values wtih s…
Best way to improve (fuzzy) search results for similarities?
This question may like a duplicate question but I’m giving it back because I couldn’t perfect a solution. Sorry for that. Now I’m working on a drug search engine. The user cannot always enter the exact drug name. Depending on the characters entered by the user, I need to get a better result for them. Bu…