Tuesday, January 31, 2023

How to Create Auto Incremented Identity Column in SQL Server, MySQL, and Oracle? Example

Automatic incremented ID, Sequence, or Identity columns are those columns in any table whose value is automatically incremented by database based upon predefined rule. Almost all databases e.g. Microsoft SQL Server, MySQL, Oracle or Sybase supports auto-incremented identity columns but in different ways like Oracle provides a SEQUENCE object which can be used to generate automatic numbers, Microsoft SQL Server up to 2008 version provides IDENTITY() functions for a similar purpose. Sybase also has IDENTITY function but little different than SQL Server and MySQL uses auto_incremented keyword to make any numeric column auto-incremented.

Top 10 Oracle Interview Question and Answer - Database and SQL

These are some interview questions and answers asked during my recent interview. Oracle interview questions are very important during any programming job interview. The interviewer always wants to check how comfortable we are with any database either we go for the Java developer position or C, C++  programmer position. So here I have discussed some basic questions related to the oracle database. Apart from these questions which are very specific to the Oracle database, you may find some general questions related to database fundamentals and SQL like Difference between correlated and noncorrelated subquery in database or truncate vs delete in SQL, etc.

Thursday, January 26, 2023

Difference between SubStr vs SubString function in JavaScript - Tutorial Example

Hello guys, if you are wondering what is difference between SubStr() and SubString() function in JavaScript then you have come to the right place. JavaScript provides two similar-looking String manipulation functions, substr and substring, though both are used to get a substring from a String, there is a subtle difference between substring and substr method in JavaScript. If you look at their signature, both substr(to, length) and substring(to, from) both take two parameters, but substr takes the length of the substring to be returned, while substring takes end index (excluding) for substring. This main difference will be more clear when we will see a couple of examples of using substr and substring in JavaScript code.

Monday, January 23, 2023

What is a Functional interface in Java 8? @FunctionalInterface Annotation Examples Tutorial

Hello Java programmers, if you are wondering what is a functional interface and what is the role of @Functional annotation in Java then you have come to the right place. Earlier, I have shared the best Lambda and Stream courses and books, and in this article, I will explain and teach you how to create a functional interface in Java. A functional interface is nothing but an interface with just one abstract method like Runnable, Callable, Supplier, Predicate, etc. You can use @Functional annotation to mark that this is a functional interface. If a function expects a functional interface then you can also pass a lambda expression to it and that's the main benefit of a Functional interface in Java. This is also a popular Lambda Expression Interview question so, knowing this topic in depth is also better for interviews. 

Friday, January 20, 2023

Strategy Design Pattern in Java using Enum - Tutorial Example

Hello guys, how are you doing? I hope you all are fine and doing good in your life and career. Today, I am going to talk about the Strategy pattern, one of the useful design and coding pattern which will help you to write flexible code. The code which can withstand the test of time in Production. I'll also teach you how you can use Enum to implement the Strategy design pattern and Open Closed design principle better in Java. I have said this before that Java Enum is very versatile and can do a lot more than you normally expect from it. We have seen a lot of examples of Enum in my earlier posts like writing thread-safe Singleton using Enum and 10 ways to use Enum in Java.