using count query in sql

How could I write an SQL that will display authors and a total number of their publications with a sub query included in my SELECT STATEMENT but this is what I have ...
more »

2017-03-17 19:03 (1) Answers

Best way to map JAXB to a database table

I have an inbound xml which I am mapping to JAXB objects using the xjc tool (to build the pojos) I am wondering what the best approach is to map these objects to various tables. An Object / Xml can map to multiple tables which rules hibernate out ...
more »

2017-03-17 17:03 (5) Answers

Yaml to database

For my c++ program, I use jobs.yml which contains information about jobs in yaml format like: 141647523: JobType: Turbo LocalJobID: 16773779.0 Status: Done SystemPriority: 0.0 UserPriority: 8.0 Then I use yaml-cpp library for parsing fil...
more »

2017-03-17 15:03 (1) Answers

Google Cloud Spanner database pricing when idle

After reading the pricing of the new google relational database Spanner, it states that the cost is based on storage and use. They charge $0.9 by hour per node. The question is: if I create the database for development, and only use it 6 hours a day...
more »

2017-03-16 19:03 (2) Answers

Output value from table in view

I've got a problem in Laravel. I have passed my whole table to my view like this from my controller: $usersTable = DB::table('users')->get(); return view('users')->with('users', $usersTable); In a foreach loop I can perfectly get each of the...
more »

2017-03-16 15:03 (4) Answers

Database multiple choice and comments structure

I've read a lot of pages but didn't find what I was looking for. I am trying to figure out which is the most appropriate solution for my problem here. I currently got a multiple choice form with 23 questions and 23 comments section (650 characters ea...
more »

2017-03-15 23:03 (1) Answers

PHP Multiupload images and insert to one field

I trying to create multiupload images and enter them all into one field in the database (mysql) but the problem is because each image is entered as a separate record, and I want all the photos in one record, field. How it is: How must to be: ...
more »

2017-03-15 17:03 (0) Answers

How to find first in JPQL

I have a query to find if a value already exists within the database. I am using it to validate a resource before it is inserted onto the database. it looks like this: @NamedQuery(name = "findByName", query = "SELECT g FROM Group g where g.value= ...
more »

2017-03-15 16:03 (3) Answers

Specify my own execution plan for query

Lets say I know a lot about the distribution of my data, and therefore know the optimal execution plan for a query. Is there a way to specify my own execution plan, fully circumventing table statistics and the optimizer? ...
more »

2017-03-15 11:03 (1) Answers

MySQL seems to be overwriting records

I have a brand new table in MySQL that can be described as such: +-----------+----------+-------+------+-----+-------+ | Team | Match | Auto | Gear | Kpa | Climb | +-----------+----------+-------+------+-----+-------+ | 1721 | 1 ...
more »

2017-03-14 21:03 (0) Answers

How to best save data which overlaps?

Say I have a text which is comprised of multiple chapters, which are comprised of multiple paragraphs, which are comprised of multiple sentences. In a JSON, I would maybe save this as follows: // Pseudo Code chapter { paragraphs { sen...
more »

2017-03-14 13:03 (2) Answers

Adding two count(*) results together

I have these two queries and I want to add them SELECT count(*) FROM table2 GROUP BY table1_id SELECT count(*) FROM table3 GROUP BY table1_id I tried something similar to the accepted answer in this question. The difference is that I have a group ...
more »

2017-03-13 20:03 (3) Answers

mysql Database creation with dot

I want to create a database using following syntax mysql -u<uname> -p<password> -e "create database <name>" but whenever I try to use dot (.) in database name, it giving me error. [root@aee9a1889c3f wpg.master]# mysql -uroot -pr...
more »

2017-03-13 17:03 (2) Answers

jpa spring boot - hibernate insert slow

I have three lists of entities that i'm trying to save to the database. in total it's about 1000 entites it have to persist.; However this takes 4-5 minutes to complete. - And i noticed its doing some selects before t...
more »

2017-03-13 14:03 (2) Answers

Show duplicate row in single row mysql

I have two tables. One is TblPeople(ID(PK),firstname,lastname,Embo.. ) and other is TBLembolization(EmbolizationID(PK),PeopleID(FK),EmbolizationDate,. Here is my query to search people with embolization date by using name... SELECT tblpeop...
more »

2017-03-13 13:03 (1) Answers

Laravel, how to save DomDocument to database?

I'm stuck with my project and i need your help! I'm trying to save domdocument variable to my database. I'm using Laravel 5.4 How do i save the following variable? $title = $dom->getElementsByTagName('title'); My Controller: TemporaryScan::c...
more »

2017-03-13 10:03 (1) Answers

Need help understanding AUTOINCREMENT from SQLite

I'm learning SQLite from this webiste: SQLite Tutorial. I was reading the article they had on the AUTOINCREMENT command. My question had to do with their explanation of why this feature is useful: The main purpose of using AUTOINCREMENT attribu...
more »

2017-03-12 22:03 (2) Answers

Make a Dictionary in Batch

I am attempting to make a Batch program that, when a word (eg. "coding") is inputted, its corresponding definition is outputted. What I have tried: 1) Downloading lists of all accepting English words, but I can't find any lists that include definit...
more »

2017-03-12 16:03 (1) Answers