> Code Storage: sql server

Code Storage

A Technical blog for those who want to gain knowledge about SQL,MySQL,Data Science and real time query

Responsive Ads Here

Advertisement

Showing posts with label sql server. Show all posts
Showing posts with label sql server. Show all posts

Friday, January 17, 2020

Date and Time format in SQL ?

Date and Time format in SQL

In SQL we have date and time format to show the date and time format in different ways lets see what are the date and time formats are there.

Date,Time,format,SQL
                               
                                                                                1.Date and Time format in SQL


FormateQuerySample
1select convert(varchar,getdate(),1)12/30/08
2select convert(varchar,getdate(),2)08.12.30
3select convert(varchar,getdate(),3)30/12/08
4select convert(varchar,getdate(),4)30.12.08
5select convert(varchar,getdate(),5)30-12-08
6select convert(varchar,getdate(),6)30 Dec 08
7select convert(varchar,getdate(),7)Dec 30 08
10select convert(varchar,getdate(),10)12-30-08
11select convert(varchar,getdate(),11)08/12/30
12select convert(varchar,getdate(),12)08 12 30
23select convert(varchar,getdate(),23)2008-12-30
101select convert(varchar,getdate(),101)12/30/2008
102select convert(varchar,getdate(),102)2008.12.30
103select convert(varchar,getdate(),103)30/12/2008
104select convert(varchar,getdate(),104)30.12.2008
105select convert(varchar,getdate(),105)30-12-2008
106select convert(varchar,getdate(),106)30 Dec 2008
107select convert(varchar,getdate(),107)Dec 30 2008
110select convert(varchar,getdate(),110)12/30/2008
111select convert(varchar,getdate(),111)2008/12/30
112select convert(varchar,getdate(),112)2008 12 30

Time only format:-

In SQL have some time only format lets see what are time format are there :-

Formate Query Sample
8 select convert(varchar,getdate(),8) 00:38:53
14 select convert(varchar,getdate(),14) 00:38:53:840
24 select convert(varchar,getdate(),24) 00:38:53
108 select convert(varchar,getdate(),108) 00:38:53
114 select convert(varchar,getdate(),114) 00:38:53:840


Monday, January 6, 2020

What is SQL.Purpose of SQL.Who should learn

SQL,Purpose,Learn,DBMS,RDBMS
                                                1. What is SQL and Purpose of SQL

Introduction of SQL
  • SQL stands for structured query language. SQL was initially developed at IBM is 1970s.  
  • SQL is the the standard language to communicate with relational database management system  like oracle,MS access,MS SQL server, Mysql,Db2,Sybase etc.SQL is a command based        language.
  •  SQL is domain specific not general purpose,used in design and management of data held in       RDBMS ( Relational database management system).
  •  SQL is a command based language.
  •  SQL lets you access and manipulate databases.
  •  SQL became a standard of the american national standard institute (ANSI) in 1986,and of the    international organization for standardization(ISO) in 1987.
Purpose of SQL 
  • SQL is used to create new database.
  • SQL is used to create new tables in a database.
  • SQL is used to insert records, update records,delete record in a database.
  • SQL is used to retrieve data from database.
  • SQL can set permission on tables procedures and views.
  • SQL is used to create stored procedures in a database.
  • SQL is used to create view in a database.
Who should learn SQL


  • Database Developers.
  • Database Admistrators.(DBA)
  • Database Testers.
Database Developers:
                                      Design and deploy database table structures,forms,reports,and queries.
Database Admistrators:
                                      Keeping database upto data and  managing database access.writing reports documentation and operating manulas.
Database Testers:
  1. Verify data Integrity ( completeness and correctness of data).
  2. Verify data Manipulation (Add,Update,Delete).
  3. Verify data Comparison (two database front end data with back end data).
                             

SEVER TYPE IN SSMS ( Sql Server Managment studio)

When you install the SQL Server management studio and then you want to connect with the SQL Server then there are four types of SQL servers ...