MS SQL Server

What is SQL Server ?
  • SQL Server is software (A Relational Database Management System) developed by Microsoft. It is also called MS SQL Server.
  • It is implemented from the specification of RDBMS.
  • Microsoft SQL Server is a highly scalable product that can be run on anything from a single laptop, to a network of high-powered cloud servers, and anything in between.

Features of MS SQL Server :
  • MS SQL Server is implemented from the specification of RDBMS.
  • MS SQL Server is platform independent.
  • MS SQL Server is both a GUI and command based software.
  • MS SQL Server supports SQL (SEQUEL) language which is an IBM product, non-procedural, common database and case insensitive language.

How to install MS SQL Server ?
  • Search ms sql server in google. Go to the official website.


  • Download latest sql server click on download now.
      

  • Fill the basic details and click on download now.
                        

  • Select the server installation type.
                      

How to install SSMS (SQL Server Management Studio) ?
  • Search for sql server management studio.
                  

  • Go to the official website and click on the download link.
             
    
  • Double click on setup file and click on install.
                                        

  • From ssms we can connect to sql server in various ways in that by using windows authentication and sql server authentication.     


CRUD Operations in MS SQL Server :
  • MS SQL Server is both a GUI and command based software. So, we can do in both ways here i've used gui method to create database. By right click on the databases option, click on new database. 


  • We can also create database by using query.


  • We can change database name by using alter query.
                             

  • We can delete the database by using drop statement.
                                   

  • We can create the table by using create statement.
                      


  • We can insert the values into the table by using gui or using statements here i've used gui. Right click on the table click on edit top 200 rows and write the values.
                                   

  • Here i've applied database integrity using a foreign key constraint. With this it'll verify the GenderId values from tbGender.ID.
                   

  • Here i've inserted the values using statements. 
               
                   
  • A Column default can be specified using default constraint. It is used to insert a default value into a column. The default value will be added to all new records if no other value is specified including NULL.
         

  • Here i've inserted the row with ID=5 but i didn't specified GenderId but it has written the value 3 because of default constraint.
                      

  • But in this case i've inserted Null. If we supply a value even if it is a null the default will not be executed.
                  

  • Update statement is used to update the row using primary key.