Thursday, May 20, 2021

SQL server and SSMD installation.



In this blog, we are going to understand the installation steps of SQL server and SSMS.


                                    

SQL Server :

  • Structured Query Language (SQL) is a programming language used to manage relational databases system developed by Microsoft.
  • It is an application that stores the database data and executes the SQL commands and queries to manipulate the relational database.
  • You can download SQL server 2019 version from here download
  • Their are some editions in SQL :
            



  1. Developer : This edition used in development, non-production and test systems. Microsoft made this edition free.
  2. Express : This edition used in development and production on desktop. Also for web and small applications. This is free for some period of time.


Installation steps :

1. Run the installed application from download.
2. Select custom option and allow application to download and install all packages. Also specify path where you are going to download application.
3. After this you see new page as SQL server installation center choose installation from menu.
4. Now choose the "New SQL server stand-alone installation".


                                
 


5. Choose the edition "Developer" then accept the license terms.
6. Click on the windows update radio button and check the windows firewall setting also for successful installation.
7. Choose features you need and specify instance.
8. Click on all next button and lastly finish the installation by clicking install and close. 


SSMS installation :

                                      

  • SSMS is used to access, configure, manage and develop all components of SQL Server.
  • SQL Server Management Studio Express is a management tool that provides a graphic interface for working with SQL Server database servers.
  • You can download SSMS from here download




  
  • You can also download SSMS from SQL Server, in installation when you click on SQL server management tools it shows the supported SSMS version to download.
  • After downloading, choose the directory and install. 
  • After installation finished you need to restart.


For more understanding watch below video :

Thank you!!!!


SQL Concept-Part 2


 In this blog we are going to understand the important and basic concepts of SQL...


 1.How can we create composite key?

  • The PRIMARY KEY constraint uniquely identifies each record in a table.
  • The combination of two or more columns that are used for unique identification of row in table.
  • composite key specifies multiple columns for a primary-key.
 








2.How to write simple SQL with where clause?
  • Firstly type the select query required column name,table name and where clause.
  • In this, where clause is used to put condition and get specific records.
  • The WHERE clause is used to filter records.


Example:

   





Output:





3.How to select specific column name in select query?
  • To select required column or we can say specific column we have to declare column name and from which table do you need it

Example:







Output:


         



4.What is an ALIAS in SQL Server?
        ALIAS  are used to give a table, or a column in a table, a temporary name. Aliases are often used to make column names more readable. 

Example:





5.What is difference between Inner join vs Left join vs Right join?

Inner Join:
     INNER JOIN keyword selects all rows from both the tables as long as the condition satisfies. Inner join displays the matching records from two or more tables.

Example:

   




Output:
                  
    
                                                                                                             


Left Join:
   This join returns all the rows from left table combine with the matching rows of the right table. If you get no matching in the right table it returns NULL values.

Example:

                                                                                                            



                                  

Output:

    


Right Join:
     this join returns all the rows from right table are combined with the matching rows of left table .If you get no column matching in the left table .it returns null value.


Example:

  
  




Output:

  



 

For more understanding watch below video :




thank you!!!!



 





SQL Concept- Part 1

 

In this blog we are going to understand the important and basic concepts of SQL...


1.How to cretate a SQL Server database connection and new database?


firstly open SSMS and connect with server also ensure SQL server is in running mode.





create a new database:


                                        

create a table:


                                          


2.What is Primary key in SQL Server?

  • The PRIMARY KEY constraint uniquely identifies each record in a table.
  • Primary key always has unique data.
  • A primary key cannot have null value.
  • There can be no duplicate value for a primary key.

   

  



3.What is an identify column in SQL Server?
  
  • Identity column of a table is a column whose value increases automatically. 
  • The value in an identity column is created by the server. 
  • A user generally cannot insert a value into an identity column. 


 




4.How we can create primary key and foreign key relationship?

  • Choose the primary key of table tblCustomer and make relationship with another tablet tblAddress1.
  • To make so goto table tblAddress1 design ->right click on it->Choose an option called relationship->Click on Add We will get dialog box as below. 
  • Choose your foreign key which is primary key of another table called tblCustomer.

                                          


5.Are nulls allowed in foreign key?
    
             Yes, it can be NULL or duplicate. 

Example:

                                               

Output:


        

For more understanding watch below video :

Thank you!!!!


Thursday, May 6, 2021

ASP.NET Session Management

 ASP.NET Session Management


1.Why is http protocol stateless ?
  • Http is called as a stateless protocol because each request sends without any knowledge of that request. 
  • means once the request sends to the server after responding to that request, the server lost that connection.

In our application, I go to the HomeController and in that First, I sends the request to the index. So let's see:



Here I create a variable that is i=0 and increment that as an i++. And I also put the debug point when I run this first GET request is sent. now we see:


Now the i value is incremented here i=1. After that server responds and then end-user see the application. Now If the end-user again sends the request from the same browser. This is the second request. Now see what will happen:


See here the i becomes 0 again. This is the HTTP stateless protocol.



2.What is session variable?
  • Session is used to store or save the user data. 
  • Session stores the data on the server.




3.How to enable session in MVC core?

First we need to add the session service in the Startup.cs file and after that have to use that session as shown below.




After that we need to write the code in the controller file. For now we have only one controller(i.e. HomeController.cs).


But remember if you do not add session service in Startup.cs file then you won’t be able to run the project properly.


4.What is cookies?
  • The session uses cookies. 
  • Cookies is some piece of data which is stored in the browser.
  •  We can store users related information in cookies.

inspect the cookies :





5.How to make http stateful protocol?
  • To make http protocol stateful, we can use session management techniques.
  • It uses data coming from previous request in present request.
  • It uses same connection for series of client server interaction for limited time.












For more understanding watch below video:






Thank you!!!!!!

Function in SQL -part 8

  In this blog we are going to understand  Sql function.   FUNCTION: A function is a database object in SQL Server. It accepts only input pa...