Home » Tag Archives: Databases (page 5)

Tag Archives: Databases

Database primary key flavors

software-development-2-logo

Types of primary keys All database tables must have one primary key column. The primary key uniquely identifies a row within a table therefore it’s bound by the following constraints: UNIQUE NOT NULL IMMUTABLE When choosing a primary key we must take into consideration the following aspects:   the primary key may be used for joining other tables through a ...

Read More »

MySQL error: Can’t connect to MySQL server

mysql-logo

You may have stumbled on this MySQL error. If you have already seen this before, then it’s really easy to recognize this and fix it. But if you haven’t seen this error before, then it takes a little longer to troubleshoot the issue. I am listing down the steps to troubleshoot this issue.               ...

Read More »

Yet Another 10 Common Mistakes Java Developers Make When Writing SQL (You Won’t BELIEVE the Last One)

software-development-2-logo

(Sorry for that click-bait heading. Couldn’t resist!) We’re on a mission. To teach you SQL. But mostly, we want to teach you how to appreciate SQL. You’ll love it! Getting SQL right or wrong shouldn’t be about that You’re-Doing-It-Wrong™ attitude that can be encountered often when evangelists promote their object of evangelism. Getting SQL right should be about the fun ...

Read More »

MySQL Transaction Isolation Levels and Locks

mysql-logo

Recently, an application that my team was working on encountered problems with a MySQL deadlock situation and it took us some time to figure out the reasons behind it. This application that we deployed was running on a 2-node cluster and they both are connected to an AWS MySQL database. The MySQL db tables are mostly based on InnoDB which ...

Read More »

Seven Databases in Seven Weeks – Hbase Day 2

apache-hbase-logo

This post is a recap of the second day of Hbase from the Seven Databases in Seven Weeks book. Most of the commands and scripts can be found at GitHub: https://github.com/eyalgo/seven-dbs-in-seven-weeks/tree/master/hbase/day_2 Streaming Script The first thing in day 2 was to download lots of data (big data) and stream it into Hbase. There’s a JRuby script, which I had to ...

Read More »

SQL Server Trick: Circumvent Missing ORDER BY Clause

software-development-2-logo

SQL Server is known to have a very strict interpretation of the SQL standard. For instance, the following expressions or statements are not possible in SQL Server:                   -- Get arbitrarily numbered row_numbers SELECT ROW_NUMBER() OVER () -- Skip arbitrary rows SELECT a FROM (VALUES (1), (2), (3), (4)) t(a) OFFSET 3 ...

Read More »

The Index You’ve Added is Useless. Why?

software-development-2-logo

Recently, at the office: Bob: I’ve looked into that slow query you’ve told me about yesterday, Alice. I’ve added the indexes you wanted. Everything should be fine now Alice: Thanks Bob. I’ll quickly check … Nope Bob, still slow, it didn’t seem to work Bob: You’re right Alice! It looks like Oracle isn’t picking up the index, for your query ...

Read More »

How to import CSV data into PostgreSQL

postgresql-logo

Introduction Many database servers support CSV data transfers and this post will show one way you can import CSV files to PostgreSQL. SQL aggregation rocks! My previous post demonstrated FlexyPool metrics capabilities and all connection related statistics were exported in CSV format. When it comes to aggregation tabular data SQL is at its best. If your database engine supports SQL:2003 ...

Read More »

How to Implement Sort Indirection in SQL

software-development-2-logo

I’ve recently stumbled upon this interesting Stack Overflow question, where the user essentially wanted to ensure that resulting records are delivered in a well-defined order. They wrote             SELECT name FROM product WHERE name IN ('CE367FAACDHCANPH-151556', 'CE367FAACEX9ANPH-153877', 'NI564FAACJSFANPH-162605', 'GE526OTACCD3ANPH-149839') They got CE367FAACDHCANPH-151556 CE367FAACEX9ANPH-153877 GE526OTACCD3ANPH-149839 NI564FAACJSFANPH-162605 They wanted CE367FAACDHCANPH-151556 CE367FAACEX9ANPH-153877 NI564FAACJSFANPH-162605 GE526OTACCD3ANPH-149839 Very often, according to ...

Read More »

NoSQL? No, SQL! – How to Calculate Running Totals

software-development-2-logo

If anything at all, our jOOQ talks at various JUGs and conferences have revealed mostly one thing: Java developers don’t know SQL. And it isn’t even necessarily our fault. We’re just not exposed to SQL nowadays. But consider this: We developers (or our customers) are paying millions of dollars every year to Oracle, Microsoft, IBM, SAP for their excellent RDBMS, ...

Read More »
Do you want to know how to develop your skillset and become a ...

Subscribe to our newsletter to start Rocking right now!

To get you started we give you our best selling eBooks for FREE!
Get ready to Rock!
To download the books, please verify your email address by following the instructions found on the email we just sent you.

THANK YOU!

Close