Introduction



In today's data-driven world, Structured Query Language (SQL) skills are in high demand. Whether you're a seasoned professional or just starting your career in data management, mastering SQL interview questions is essential for landing that dream job. In this blog post, we'll delve into some common SQL interview questions and provide detailed explanations to help you ace your next interview.

SQL is a standard database language used for accessing and manipulating data in databases. It stands for Structured Query Language and was developed by IBM Computer Scientists in the 1970s. By executing queries, SQL can create, update, delete, and retrieve data in databases like MySQL, Oracle, PostgreSQL, etc. Overall, SQL is a query language that communicates with databases.


What is SQL?

SQL stands for Structured Query Language. It is a language used to interact with the database, i.e., to create a database, to create a table in the database, to retrieve data or update a table in the database, etc. SQL is an ANSI(American National Standards Institute) standard. Using SQL, we can do many things. For example – we can execute queries, we can insert records into a table, can update records, can create a database, can create a table, can delete a table, etc.


What is a database?

A Database is defined as a structured form of data storage in a computer or a collection of data in an organized manner and can be accessed in various ways. It is also the collection of schemas, tables, queries, views, etc. Databases help us with easily storing, accessing, and manipulating data held on a computer. The Database Management System allows a user to interact with the database.


Does SQL support programming language features?

It is true that SQL is a language, but it does not support programming as it is not a programming language, it is a command language. We do not have conditional statements in SQL like for loops or if..else, we only have commands which we can use to query, update, delete, etc. data in the database. SQL allows us to manipulate data in a database.


What are the Types of SQL Commands?

There are the four main types of SQL commands: Data Definition Language (DDL), Data Manipulation Language (DML), Data Control Language (DCL), and Transaction Control Language (TCL). Offer examples of each command type to illustrate their usage.


What are Primary Key and Foreign Keys in SQL?

A Primary Key is one of the candidate keys that is selected as the most important and becomes the primary key. There cannot be more than one primary key in a table.
Foreign key is a field that can uniquely identify each row in another table. And this constraint is used to specify a field as a Foreign key. That is this field points to the primary key of another table. This usually creates a kind of link between the two tables.


What are tables and Fields in SQL?

A table has a combination of rows and columns. Rows are called records and columns are called fields. In MS SQL Server, the tables are being designated within the database and schema names.
A database field can be defined as – a single piece of information from a record.


What is DEFAULT constraint in SQL?

A DEFAULT constraint is used to fill a column with default and fixed values. The value will be added to all new records when no other value is provided.


What is Normalization?

It is a process of analyzing the given relation schemas based on their functional dependencies and primary keys to achieve the following desirable properties:

  • Minimizing Redundancy.
  • Minimizing the Insertion, Deletion, And Update Anomalies.


What is Denormalization?

Denormalization is a database optimization technique in which we add redundant data to one or more tables. This can help us avoid costly joins in a relational database. Note that denormalization does not mean not doing normalization. It is an optimization technique that is applied after normalization.


What is Query and Subquery in SQL?

An SQL query is used to retrieve the required data from the database. However, there may be multiple SQL queries that yield the same results but with different levels of efficiency. An inefficient query can drain the database resources, reduce the database speed or result in a loss of service for other users. So it is very important to optimize the query to obtain the best database performance.
In SQL a Subquery can be simply defined as a query within another query. In other words, we can say that a Subquery is a query that is embedded in the WHERE clause of another SQL query.

















Introduction 

This article will brief the basic difference between .Net Core and .Net Framework.

There are many articles has been written on this topic, but I will start the description from basic differences which will include the features of both the frameworks to advanced level which will include the difference in the architecture of both the frameworks.

Features of .Net Core that distinguish it from .Net Framework


Cross Platform

.Net core is cross platform, i.e. the application built in .net core environment can run on Windows, MacOs and Linux

Open Source 

.Net Core is open source, i.e., .Net Core source code projects are available on GitHub. There are thousands of developers are involved in development of .Net Core and improving its features and fixing bugs.


Modern 

.Net Core is modern, i.e. the application can be built using .Net Core to fulfill the needs of today’s world.

High Performance 

.Net Core is very fast as compare to .Net Framework. Due to this feature .net core is able to deliver best result than any other framework.

Multiple IDE Support 

.Net Core application can be developed using Visual Studio as well as Visual Studio Code. Developers can choose their favorite IDE/ Text Editor and start building application using .Net Core.
Differences on the basis of architecture From the above points, we understood the basic difference between .Net Core and .Net Framework, now we will understand the difference between the two on the basis of architecture.

To understand the differences easily, we will create MVC (Model View Controller) applications using .NET Core and .NET Framework


To understand the project architectures, first I will add new MVC project using .Net Core and then I will add another project of MVC using .NET Framework (Standard) in the same Solution. The solution will look like below:



In the above image, we can see that there are some differences in the folders of the two projects. We will understand it one by one.
In the .Net Application there is “References”. If we expand it, we will see that there are lot of references. We can also add reference as per our requirement.

In the .NET Core, there is no “References” but there is “Dependencies”, if we expand it we will see there are lot of dependencies in a categorized way.

Key Points

Here “Dependencies” has taken over the “References”.
In the .Net Application, the css, bootstrap, js files are placed in the “Content” folder and the favicon is placed in the main folder of the application.
In the .Net Core Application, css, bootstrap, js files including favicon are placed in the “wwwroot” folder.
In the .Net Application, Web.config is considered a most important file for the application. In this file we use to write connection string and many more which are helpful in running the application. The Type of this file is XML.
In the .Net Core application, appsettings.json plays the same role as Web.config in the .Net Application. The Type of this file is json.
In .Net Core, there are two new files, i.e. “Program.cs” and “Startup.cs” which were not available in .NET Framework (Standard). Let’s take a look inside the Program.cs file



 

In .Net Core, every (web) application is considered and run as a console application.
Whenever there is a requirement to inject the dependency, this is taken place in the “Startup.cs” file.


Summary

  • In this article, we learnt about basic difference between .NET Core and .NET Framework.
  • We learnt about features of .NET Core.
  • We learnt about differences of the two frameworks on the basis of architectures.
  • Discussed in brief about "Program.cs" and "Startup.cs" "Program.cs" and "Startup.cs", are most important files in .NET Core, we will discuss about these files in a very great detail in the next article.

C# 8 Features

C# was first introduced with .NET Framework 1.0 in 2002(stable version). Since its emergence it is enhancing with each release.

In September 2019 Microsoft has announced its 8th version, i.e. C# 8 with lot of new and important features.

In this article most frequently used features of C# 8.0 are described.

For more details, please check the below link:
https://docs.microsoft.com/en-us/dotnet/csharp/whats-new/csharp-8


Prerequisites

In this article I have used Visual Studio 2019 and .NET Core Version 3.0 to elaborate the C# 8 features.


Features of C# 8:

  • Nullable reference types

Inside a nullable annotation context, any variable of a reference type is considered to be a nonnullable reference type. If you want to indicate that a variable may be null, you must append the type name with the? to declare the variable as a nullable reference type.

To declare variable /property as Nullable, we have to add “#nullable enable “ in our code.


  • Default interface methods

We can now add members to interface and provide implementation for those members.

To use this feature of C# 8, we have to use .NET Core 3x which is available in Visual Studio 2019.



  • Switch Statement

We can initiate switch statement in a new easy way




Key points :

  • No "case" and "break" keywords.
  • colon ":" is replaced by "=>"
  • default is replaced by underscore "_"

  • Asynchronous streams

Now we can iterate using “await” over “async” collection


  • Null – coalescing assignment

C# 8.0 introduces the null-coalescing assignment operator ??=. You can use the ??= operator to assign the value of its right-hand operand to its left-hand operand only if the left-hand operand evaluates to null.