If you have both .MDF and .LDF files for any database, then simply you can create a database by using below query
USE [master]
GO
CREATE DATABASE [
AdventureWorksDW2012 ] ON
( FILENAME =
N'C:\Program Files\Microsoft SQL Server\MSSQL11.MSSQLSERVER2012\MSSQL\DATA\AdventureWorksDW2012.mdf ' ),
( FILENAME = N'C:\Program Files\Microsoft SQL Server\MSSQL11.MSSQLSERVER2012\MSSQL\DATA\AdventureWorksDW2012
.ldf ' )
FOR ATTACH ;
GO