Category "sql"

I was trying to implement per tenant one database using ABP framework but couldn't succeed with that approach

I was trying to implement per tenant one database using ABP framework but couldn't succeed with that approach. In the documentation, it says to configure using

BigQuery Search which results in Error: Scalar subquery produced more than one element

Running this query on BigQuery but resulting in this error: Error: Scalar subquery produced more than one element select * from CRM.organizations where name L

Creating tables in SQL with the corresponding attributes, from an ER model

If I have an ERD: https://i.stack..com/gj3Sn.png Which I'm trying to type up in postgres SQL. How could this be done? So far i've got:

SQL insert into table with values selected from other tables where an external value matches

I have the following tables: Table1: id rarity 1 Common 2 Uncommon 3 Rare Table2: id Type 1 Air 2 Earth 3 Fire 4 Water The output table already exists and t

Django SQL Server studio backend doesn't support altering from/to AutoField

Please help me I tried to connect to the database The connection was successful and the rules were lifted, but I have this problem raise NotImplementedError("t

Pythonic way to write OR SQL condition to extract information schema data from Snowflake

I am connecting to Snowflake using python (Below code). As you can see I am trying to get Row Count,Date table was created and altered from Information Schema t

Is there a way to get the EntityManagerFactory on a project that uses Java Spring JPA but doesn't have a "persistence.xml" file?

I want to use the EMF to do queries constructed at runtime on a String. If there is a way I would appreciate it if someone could tell me how and give a small ex

EF6 Entity framework sometimes slow query on SQL Server

We have started a new project in .NET Core. We are just starting out and we are hitting a Web API endpoint to get some reference data of 8 records. We noticed

Percentile rank over multiple partitions averages

Assume I have a table like this id cnt tier 1 100 gold 2 200 silver 3 300 bronze 4 400 bronze 5 500 bronze 6 600 gold 7 700 silver 8 800 silver 9 900 silver 10

Sql: hackerrank aggregation

Samantha was tasked with calculating the average monthly salaries for all employees in the EMPLOYEES table, but did not realize her keyboard's key was broken un

Get a path from manager to an employee in mysql 8

I have a question in term of my database courses, hope that you can help me. The table bellow is an exemple: +------------------------------------+ |ID_EMPLOYEE

sql conditional sum statement

The sql conditional sum statement below keeps throwing me an error and I'm not sure why. The logic should create a flag when any of the underlying flags are 1,

Initializing an sql query as a dataclass

The goal is to achieve the selected columns in SQL based on the some manual classification of the fields, e.g. from dataclasses import dataclass @dataclass cl

Create a Trigger with merge to monitor tables

I need to create a Trigger to monitor this table : CREATE TABLE "REFERENCE" ( "NUM_CONTRACT" VARCHAR2(20 CHAR), "NATURE" VARCHAR2(20 CHAR),

How can we assign a field of user table say id that is primary key, to another table as a primary key? using hibernate

See I dont want any mapping but what I want is just a simple thing that is.... I have two Entity Tasks(taskid,taskname.....,userId) User_Credentials(userId,pass

SQL FOREIGN KEY ERROR (errno: 150 "Foreign key constraint is incorrectly formed")

Hi I have this three very simple tables but I can't fix it to get the right format of foreign key. CREATE TABLE company( company_name varchar(30) UNIQUE NOT NUL

SQL referrals view

I have a table with users: id referred_by_user_id ----------------------------------- 1 null 2 1 3 1 4

How do I loop through alll columns using Jinja in DBT?

I want to iterate over all the columns using dbt.

Can SQL be injected when the input is hashed?

The passwords and my SQL database are hashed. If the input is hashed, can the field be injected? The hash is SHA256. My command is to be: SELECT true FROM acc

How to search tree structure with multiple types with TypeORM

thanks for reading and provide any suggestions or any keyword I can do more research. Quite new to TypeORM and have an issue on searching the tree structure wit