Change database loaction
When you don't provide any location,SQL Server by default uses server level settings which are provided during installation.What this means is if you don't provide any location while creating database,SQL uses this location by default..This can be changed at any time and can be found here



Further while creating a database,You also can provide location like  below,if you want any database to be created at different location 

CREATE DATABASE [sdsd] ON  PRIMARY 
( NAME = N'sdsd', FILENAME = N'new path ' , SIZE = 2048KB , FILEGROWTH = 1024KB )
 LOG ON 
( NAME = N'sdsd_log', FILENAME = N'new path' , SIZE = 1024KB , FILEGROWTH = 10%)
GO 


If you are looking to change the existing database location,here is an answer which goes in depth ..

How do I attach a database in SQL Server?