I'm trying to create a relational database and this is the error i get SQLSTATE[HY000]: General error: 1005 Can't create table somedumbtable.meals (errno: 150
I have this sample table +--------+-------------+ | DBName | Description | +--------+-------------+ | A | Car | | A | Boat | | B
I have a query I'm using: people = Person.objects.all().annotate(num_pets=Count('pets')) for p in people: print(p.name, p.num_pets == 0) (Pet is ManyToO
I'm attempting to create an SQL query that retrieves the total_cost for every row in a table. Alongside that, I also need to collect the most dominant value for
I am wondering what's the best way to check whether a number is prime or not using sql. I was able to generate the sequence of numbers from 1 to 1000 but I woul
Good afternoon all, This is my first time using SQL, so forgive me for being new. I have three different tables that I've created: CREATE TABLE employee (ID int
I have a table that records all the different statuses for a list of Jobs with timestamps. So the ID column has many Ids that appear several times as their stat
Hi All trying to figure out a way to transpose data in columns dynamically. In the data the distinct number of Traits will increase/decrease. I know I can hardc
I have these two SQL tables: Bills (BillId, Folio, Date, ProductId) BillsRows (BillRowId, BillId, ProductId, Lot, Quantity, Price) ProductId is optional in Bil
UPDATE tb FROM Table1 tb, ( SELECT oreplace(data, '.', '') AS data FROM Table2 ) tb2 SET column = 'Y' WHERE tb.column1
I am running into an issue where my .net application (C#) will not connect to SQL Server when ran by a domain user. Exception is: The underlying provider faile
I am doing a TODO list app and I'm trying to delete a list and every task which has the referencing listID.The problem is that on delete casca
I'm new to hiveSQL and I'm trying to extract a value from the column col_a from the data df which is in this format: \\\"id\\\":\\\"101_12345\\\" I only need to
I have a many to many relationship between User and Category through UserCategory as below. let user = await User.findAll({ where: { id: req.query.user
I'm using Postgres version 9.6.9 and attempting to use width_bucket() to generate a histogram with buckets consisting of equal widths. However, the query I'm us
I am trying to figure out how to extract customer ID from string that looks loke this: {"param":"success","value":"10","level":"0","error_code":"101","customer
I have 2 tables orders and product as orders has only one field (order_id) and the products have a reference to the order_id, how to get the name of product wit
I have 2 grids and 2 tables. I want the second one to display elements that are related to the selected enement of first grid. This can probably be done in 2 wa
I have a query with a few columns. I need to find the avg of a particular column and then use the average value to calculate other values. I am finding avg with
I have these 2 tables tasks and subtasks with these columns: Tasks id name description Subtasks id name description task_id I'm trying to do a query that would