Download presentation
Presentation is loading. Please wait.
Published bySuzan Cobb Modified over 9 years ago
1
DBA Developer
2
Responsibilities Designing Relational databases Developing interface layer Environment Microsoft SQL Server,.NET SQL Layer: Stored procedures, functions,CLR Objects Object Layer: ADO. Net, Microsoft enterprise library, Object-Relational mappers Query optimization/Performance tuning Code review for performance Missing indices
3
Applications Single Sign on (SSO) Search Solutions Search Database Search Engines Import/Export solutions Sending to and receiving data from web services XML/CSV transformation Frameworks Data warehouse and OLAP
4
Challenges Performance Missing index Poorly written queries Normalized vs. Denormalized Deadlocks Design Schema flexible to changes DDL (data definition language) Vs DML(data manipulation language) ○ example
5
Simple example Design a database to store user information Username,password, first name, last name, postal code Requirement changes Email, Address, City, Province, Country, language and etc now is needed to be stored. Solution ? CREATE TABLE Users ( UserID INT NOT NULL Primary Key, UserName NVARCHAR(50) NOT NULL, FirstName NVARCHAR(50) NULL, LastName NVARCHAR(50) NULL, PostalCode NVARCHAR(50) NULL );
6
Simple example Option 1 add more column to the Users table Option 2 insert rows instead of columns (How)
7
CREATE TABLE Users ( UserID INT NOT NULL Primary Key, UserName NVARCHAR(50) NOT NULL ); CREATE TABLE Properties ( PropertyID INT NOT NULL Primary Key, PropertyName NVARCHAR(50) NOT NULL ) CREATE TABLE UserProperty ( PropertyID INT NOT NULL Primary Key, UserID INT NOT NULL, value NVARCHAR(100) NOT NULL ) Many to Many Relation
8
XML DataType –Hybrid design CREATE TABLE Users ( UserID INT NOT NULL Primary Key, UserName NVARCHAR(50) NOT NULL, UserProperty XML ); CREATE TABLE Properties ( PropertyID INT NOT NULL Primary Key, PropertyName NVARCHAR(50) NOT NULL ) CREATE TABLE UserProperty ( PropertyID INT NOT NULL Primary Key, UserID INT NOT NULL, value NVARCHAR(100) NOT NULL )
9
XML DataType –Hybrid design XML Advantages Flexibility Easy to parse and to serialized in to objects Disadvantages Searching trough XML is Slow Maintenance – adds over head to insert and update XML model is not a replacement for Relational model
10
Good to know about Paging in SQL Trees & Hierarchies in SQL Graph in SQL Recursive query in SQL (using Common Table Expressions) XML manipulation (XPATH,XQUERY) CLR objects in MS SQL Server
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.