Quantcast
Channel: CodeFari
Browsing all 265 articles
Browse latest View live

Image may be NSFW.
Clik here to view.

PostgreSQL: How to select last record of each user

Before writing a PostgreSQL query, we will create a scenario, suppose we have two tables first are Customer, and Second is its Orders. First, we will create tables through the following query then we...

View Article


Image may be NSFW.
Clik here to view.

Insert text with single quotes in PostgreSQL

I faced an issue when tried to insert apostrophe word into the table, seeing the issue I become panic, how would I resolve this issue, so I did google surfing and found a lot of solutions, and I want...

View Article


PostgreSQL: How to reset primary key sequence if it falls out of sync?

Once I was working with PostgreSQL 9.4, I got an error of primary key constraint while I was using the sequence that generates the next serial number. But the sequence implied in the serial data type...

View Article

PostgreSQL: Generated column computed from jsonb column

Problem: I am using PostgreSQL 12 new feature Generated Column, but computing column is jsonb type that containing json as "active":true or "active":false. I have tried to create the table using the...

View Article

Image may be NSFW.
Clik here to view.

PostgreSQL: Sort result by DateTime, but the null value should be first or last

I want to sort my result by date time column in ascending order but null values ​​should come first or vice versa. Suppose I have a table employee and it has the column appraisal_date if I sorted the...

View Article


PostgreSQL: How to check if a table exists in a given schema?

There are several ways to check the table exist in the particular schema, some solutions are described below.First, I'll create an "Employee" table and give examples on it. Create the table using the...

View Article

Image may be NSFW.
Clik here to view.

PostgreSQL: Online Test 1

.scp-quizzes-main{ width:100%; font-family:Verdana, Arial, Helvetica, sans-serif;} .scp-quizzes-data{ box-shadow: 0px 1px 3px -1px #DCDCDC; padding:10px; margin-top:15px; } pre{ border:2px solid...

View Article

Image may be NSFW.
Clik here to view.

PostgreSQL: Online Test 2

.scp-quizzes-main{ width:100%; font-family:Verdana, Arial, Helvetica, sans-serif;} .scp-quizzes-data{ box-shadow: 0px 1px 3px -1px #DCDCDC; padding:10px; margin-top:15px; } pre{ border:2px solid...

View Article


Image may be NSFW.
Clik here to view.

PostgreSQL: Online Test 3

.scp-quizzes-main{ width:100%; font-family:Verdana, Arial, Helvetica, sans-serif;} .scp-quizzes-data{ box-shadow: 0px 1px 3px -1px #DCDCDC; padding:10px; margin-top:15px; } pre{ border:2px solid...

View Article


Image may be NSFW.
Clik here to view.

PostgreSQL: Online Test 4

.scp-quizzes-main{ width:100%; font-family:Verdana, Arial, Helvetica, sans-serif;} .scp-quizzes-data{ box-shadow: 0px 1px 3px -1px #DCDCDC; padding:10px; margin-top:15px; } pre{ border:2px solid...

View Article

Image may be NSFW.
Clik here to view.

How to import CSV file data into a PostgreSQL table?

My first task was to import CSV data to PostgreSQL after finishing the schema/table design. It was very challenging for me because I was new on PostgreSQL, but I was familiar with SQL Server. I...

View Article

Image may be NSFW.
Clik here to view.

How to select the nth row of the table in PostgreSQL?

Here we will discuss the technique to fetch nth row of the table in PostgreSQL. I will use the concept of the LIMIT and OFFSET Clause.Syntax to fetch nth row of the table in PostgreSQL  SELECT col_1,...

View Article

Image may be NSFW.
Clik here to view.

MongoDB Online Test 1

.scp-quizzes-main{ width:100%; font-family:Verdana, Arial, Helvetica, sans-serif;} .scp-quizzes-data{ box-shadow: 0px 1px 3px -1px #DCDCDC; padding:10px; margin-top:15px; } pre{ border:2px solid...

View Article


Image may be NSFW.
Clik here to view.

MongoDB Online Test 2

.scp-quizzes-main{ width:100%; font-family:Verdana, Arial, Helvetica, sans-serif;} .scp-quizzes-data{ box-shadow: 0px 1px 3px -1px #DCDCDC; padding:10px; margin-top:15px; } pre{ border:2px solid...

View Article

Image may be NSFW.
Clik here to view.

MongoDB Online Test 3

.scp-quizzes-main{ width:100%; font-family:Verdana, Arial, Helvetica, sans-serif;} .scp-quizzes-data{ box-shadow: 0px 1px 3px -1px #DCDCDC; padding:10px; margin-top:15px; } pre{ border:2px solid...

View Article


Image may be NSFW.
Clik here to view.

MongoDB Online Test 4

.scp-quizzes-main{ width:100%; font-family:Verdana, Arial, Helvetica, sans-serif;} .scp-quizzes-data{ box-shadow: 0px 1px 3px -1px #DCDCDC; padding:10px; margin-top:15px; } pre{ border:2px solid...

View Article

Image may be NSFW.
Clik here to view.

MongoDB Online Test 5

.scp-quizzes-main{ width:100%; font-family:Verdana, Arial, Helvetica, sans-serif;} .scp-quizzes-data{ box-shadow: 0px 1px 3px -1px #DCDCDC; padding:10px; margin-top:15px; } pre{ border:2px solid...

View Article


NUnit : Introduction

There are several unit test tools in the market, but one of them is NUnit, the most popular tool for doing unit testing. So in this tutorial, we will learn the Unit Testing using the NUnit tool and...

View Article

Image may be NSFW.
Clik here to view.

How to List columns with indexes in PostgreSQL?

Problem: I have a table of the customer below, and I want to list column with indexes in PostgreSQL, Basically purpose of this question is an analysis of the performance.   CREATETABLECustomer(...

View Article

Fatal Error: Peer authentication failed for user "postgres", when trying to...

Problem: Sometimes, we get the following error when trying to make a connection in Rails. FATAL ERROR: Peer authentication failed for user "postgres" Solution: There are a lot of solutions described...

View Article
Browsing all 265 articles
Browse latest View live