Pierre Xavier Portfolio

18
SQL Server 2008 Portfolio Pierre B. Xavier [email protected] Phone: (917) 519-2694

Transcript of Pierre Xavier Portfolio

SQL Server 2008

Portfolio

Pierre B. Xavier

[email protected]

Phone: (917) 519-2694

TABLE OF CONTENTS

• Piggy Bank database diagram

• Examples of Stored Procedures Created

• Test Scripts to evaluate stored procedures

• T-SQL queries for the library database project

• T-SQL Scripts to define tasks performed by a DBA

from the DBA Admin practical project

THE PIGGY BANK PROJECT

• Introduction:

This project designs, and implements a SQL Server PiggyBank database to create and update customer’s accounts and transactions, make deposit, transfers, and withdrawals, apply interest rate, as well as establish ATM procedures. Bank tellers will be able to search customer information using specific entity like: Name, or Phone number.

• Project Goals:

Run an existing XML script to add preexisting customer and account to the database. Make enhancements to the previous database to support more flexible transactions for customer as well bank tellers

PIGGY BANK DATABASE DIAGRAM

This the ER

diagram of the

Piggy Bank

Database

involving 7

tables . Primary

keys, Foreign

Keys, and

validation

constraints are

defined in this

diagram.

Update a Customer personal’s information

Stored procedure

This procedure

validates a given

customer and updates

the entire customer’s

personal information

TEST SCRIPTS TO EVALUATE STORED PROCEDURES

CUSTOMER PERSONAL’S INFORMATION

Stored procedure to create accounts for a customer

and update these accounts

This

procedure

will create an

account for a

given

customer

and provide

the ability to

update these

accounts.

Test scripts to evaluate stored procedure

Create Accounts for a customer and update these

accounts

To display transactions of an account for

the last 30 daysThis stored procedure

named

GetTransactions

passed and AccounID

and CustomerID as

parameters.

To display the

transactions , this

procedure joined two

tables and filtered the

date by subtracting

30 days from the

current date.

Test scripts to evaluate stored procedure

Show transactions of an account for the last 30 days

THE LIBRARY DATABASE PROJECT

• Introduction:

This project involves creating T_SQL queries

using database named library. This database

contains 9 tables that allows members of the

library to loan and make reservations for their

desired books.

• Project Goals:

Write T-SQL queries to display information related

to customers, loan, books reservations.

QUERY TO LOAD RECORDS INTO A TEMPORARY TABLE

This query

joined three

tables to

generate a list

of columns,

perform date

conversion , and

and load these

records into a

temporary table

called #

Overdue

USING JOINS AND UNION ALL CLAUSE TO WRITE T-SQL QUERIES

This query

retrieves a

single list of

members both

adult and

juvenile who

have reserved a

specific ISBN

number using

Joins and Union

Clause.

This generates

the records by

name

QUERY TO CONCATENATE MULTIPLE COLUMNS INTO A

STRING AND ALIAS AS NAME

This query

concatenated

the first name,

middle initial and

last name

columns into

one string and

alias as Name.

Display

records in

order by

last name

and first

name

DBA ADMIN PRACTICAL PROJECT

• Introduction:

This project defines the tasks performed by a SQL

Server 2008 Database Administrator. The main

objectives are to : install and configure SQL Server

2008, manage database files, backup and restore

database, manage security, transfer data into and

out of SQL Server, replicate data between SQL

servers instances, and monitor SQL Server.

IMPLEMENTING DISASTER RECOVERY PROCEDURES

This T-SQL Script

creates a logical backup

device and a backup of

the primary file group .

It also restores the

secondary file group.

This appends a backup of

a specific file group to the

same backup device,

and update the

ClockOutTime for the only

record in the

EmployeeWorkhistory

Table

T-SQL SCRIPTS TO CREATE DATABASE SNAPSHOTS

This script creates a

database snapshot that

will allow the database

to be recovered from

the database snapshot,

often referred to as

reverting to the

database snapshot

T-SQL SCRIPTS TO EXPORT AND IMPORT DATA

This Script uses a bcp

utility from the

command prompt

windows to export two

columns of a table to a

flat file.

Use the BULK INSERT

to insert records from

the flat file created

above to a newly

created table