Scala is a programming language which aims to provide best of both object-oriented programming and functional programming world. It not only allows you to construct elegant class hierarchies for maximum code reuse and extensibility but also allows you to implement their behavior using higher-order functions and other functional programming technique. It is touted as one of the languages which can probably take over Java, though it didn't happen especially after Java 8 release which also provides some functional programming tools to Java e.g. lambda expression and stream. Nevertheless, Scala is a good language and created by following best practices from several other programming languages including Java. Scala is an acronym for “Scalable Language”. This means it is designed by keeping scalability in mind. Many companies e.g. Twitter, LinkedIn, and Intel uses it for their mission-critical application.
Today, we are going to see another common and interesting SQL interview question, what is the difference between SQL, T-SQL and PL/SQL? It is also one of the most common doubt among SQL beginners. It's common for programmers to think that why there are many types of SQL languages, why not just single SQL across DB? etc. Well, let's first understand the difference between SQL, T-SQL and PL/SQL and then we will understand the need of these dialects. SQL is standard for querying, inserting and modifying data in relational database. It is categorized into DDL and DML and powerful enough to create a database objects e.g. table, view, stored procedure and can perform CRUD operation (SELECT, INSERT, UPDATE, and DELETE) query.
If you have used Hibernate in past then you know that one of the strongest points of Hibernate framework is caching, which can drastically improve the performance of Java application's persistence layer if configured and used correctly. Hibernate provides caching at many levels e.g. first level cache at Session level, second level cache at the SessionFactory level, and query cache to cache frequently executed SQL queries. The first level cache minimizes database access for the same object. For example, if you call the get() method to access Employee object with id = 1 from one session, it will go the database and load the object into memory, but it will also cache the object in the first level cache.