Query Java doesn’t execute

I’m trying to execute a query on eclipse at my Java program, but it always exit with a exception and don’t execute the query, I read a lot of posts here but no one of them could help me with this. …

Oracle 10g sql query

I have some data like this ↓ T_ID T_PERIOD T_COUNT T_SUM T_UPDATE_COUNT 1 2013-2014 3436 20118043 0 2 2014-2015 4298 27101356 0 3 2015-…

Django complex partitioning & ordering for tree Table

I’m using Django with PostgreSQL as my Backend-Stack for an application of which the main feature is a complex, multilevel table displaying annotated time-series-data for different products. So …

Should the column used to order results be included in the index of a postgresql table?

I am creating indexes for a PostgreSQL database. I would like to know whether the column(s) used to order results in a PostgreSQL statement should be included in the index. Assume I have created a …

Return decimal value in SQL query

Example of script ,sum(BREAKS)/3600 as Breaks but it comes back as a whole number, how can I get decimals?

SQL: How to check if group of rows already exist in a table

I have a simple chat functionality in my application where signed up users are able to create chat groups with other users. To store the information which user is a member in which chat I am using a …

Is it possible to COUNT if one value occured more than the other value in a column using SQL

I have this table called task_status which has the following structure: CREATE TABLE `task_status` ( `task_status_id` int(11) NOT NULL, `status_id` int(11) NOT NULL, `task_id` int(11) NOT NULL, …

ERROR 1452: Cannot add or update a child row: a foreign key constraint fails, Can anybody assist

I was wondering if anybody would be so kind as to try help me figure out th problem with my code. I have an extremially limited knowledge of sql I am a student and this is my first year doing sql. …

How to use a for loop to insert multiple records in a database table

I have simplified my problem into the following code: $sql_abc = “CREATE TABLE $tbl_abc( x INTEGER(255) ) “; echo “About to execute $sql_abc”; if (mysqli_query($conn, $sql_abc)…

When inserting multiple record into a SQL table it does not follow the order

When using a single insert statement to add multiple records into a table as shown below, it does not follow the same order when selecting. I understand that it does not affect anything but may I know …