SQL Management Studio Tutorials

Share This

SQL Management Studio Tutorials

This article is about SQL Managment Studio  Tutorials after installation of MS SQL Management Studio open SQL studio and then click on new query after clicking on new query a new tab open  for writing codes in this tutorial of sql management studio we learn some basic queries of sql lets start first of all we need to creat a database so for this we write following code

How to creat database in SQL Management Studio

for creating a database you write simply the following code and then click on execute

How To create tables in SQL management studio

after that database is created and now time to create tables, for example, creating a table named Client  you write the following code 

you can change the column names in this table what you want this for just an example, table is empty now its time to insert some values in this table now we use   INSERT   query ,  INSERT query is very simple to understand

INSERT INTO  table_name  (column1, column2, column3, …)
VALUES (value1, value2, value3, …);

columns name are tha fields/columns that we make in table and values are the values that we want to enter in that columns;

  NOTE::  columns should be in the same case that is used in table

insert query  for table Client that we created above will be like

Now its time to fetch data from table client for this we use SELECT Query

How to Fetch Data from table in sql using sql management studio

simple we use select query like   ” SELECT * FROM tablename ”  fetching data from above table we created SQL Code will be

 

Customer_IDFirstNameLastNameAddressCity
212nickjohnsonxyzNewYork

now its time to update data

How to Update Specific Data in SQL

UPDATE table_name
SET column1 = value1, column2 = value2, …
WHERE condition;

for example we are going to update data we insert in above table the code will be 

 

in this query we use where condition  for targeting specific row which has customer_ID of  ‘212’

 

Be careful when updating records. If you dont use the WHERE clause, ALL records will be updated!

We can delete the data from table 

How to Delete Data from table in SQL

DELTE query will Be

DELETE FROM  table_name WHERE condition;

For deleting data from above table code will be

Be careful when Deleting records. If you don’t use the WHERE clause, ALL records will be deleted!

These are the some baisc queries in sql for a making a simple database in SQL Management studio 2017 i hope you like , for advance tutorials click here

Share This

Facebook Comments