SlideShare a Scribd company logo
Never stop improving qualityMicrosoft SQL ServerLARION_TDT@Internship_03www.elarion.com
ContentsIntroductionRelational Database
Database management system
Microsoft SQL server
Structures of  Microsoft SQL server
How to create index for each record
Backup, Restore Database
Stored Procedure, Trigger, Function
View
Supporting tools for MS SQL server
Demo2
Relational Database (1 of 4)DefinitionRelational Database is database that all data are established many tables to have relationship each other.Each table consists of many columns and many rows that each column is usuallycalled a register,each row is described an attribute.3
Relational Database (2 of 4)The main componentsThe main components:Table: each table stores information of an object outside real life.
Primary key: a collection of one column or many columns inside tables that it is not permit null data and is only one.
Foreign key: a collection of one column or many columns inside tables that they are  a primary of other tables and their data can be permitted null4
Relational Database (3 of 4)Example 1:5
Relational Database (4 of 4)Example 26
Database Management System(1 of 3)Popular Database Management SystemsMS SQL server
MySQL
Oracle
PostgreSql
DB2
…7
Database Management System(2 of 3)DefinitionDatabase management system is a software to permit users to create, control and access into database.Database management system has maintained consistency of database during its cycle life.8
Database Management System (3 of 3)FunctionThe main functions of database management systemDatabase definition
Database construction
Database manipulation: add, delete...
Database administrator: security...
Database protection: backup, restore9
 Mircosoft  SQL server(1 of 3)MS SQL Server is a database management system that it is established and developed by Microsoft based on Transact-SQL method in order to exchange data between Client and MS SQL Server.10
 Mircosoft  SQL server(2 of 3)AdaptationMS SQL Server is optimized in order to run Very Large Database Environment (VLDE) even though Tera-Byte, especially for serving user thousands MS SQL Server can collaborate with other servers such as Microsoft Internet Information Server (IIS), Oracle...11
 Mircosoft  SQL server (3 of 3)VersionsVersions of  MS SQL ServerEnterprise Edition
Developer Edition
Standard Edition
Workgroup Edition
SQL Server Express Edition12
 Mircosoft  SQL server(1 of 3)StructureOne of the most usual structures MS SQL ServerClient / Server Architecture
N-tier Architecture13
Structure of MS SQL server(2 of 3)Client / Server Architecture14
Structure of MS SQL server (3 of 3)N-tier Architecture15
How to create index for each record(1 of 2)Index is used to supporting and improving for accessing more quick to data flows base on value of  one or many columns.Two forms:Clustered index
Non-clustered index16

More Related Content

PPTX
Sql server 2012 dba online training
PDF
MS-SQL SERVER ARCHITECTURE
PDF
Microsoft SQL Server - Files and Filegroups
PPTX
Sql server basics
PPTX
How to think like the engine
PPTX
MDF and LDF in SQL Server
PPTX
SQL Server 2012 Best Practices
PPT
Sql server basics
Sql server 2012 dba online training
MS-SQL SERVER ARCHITECTURE
Microsoft SQL Server - Files and Filegroups
Sql server basics
How to think like the engine
MDF and LDF in SQL Server
SQL Server 2012 Best Practices
Sql server basics

What's hot (19)

PPTX
Oracle Tablespace - Basic
PPTX
Physical architecture of sql server
PPSX
MS SQL Server
PPTX
Oracle DBA
PDF
Microsoft SQL Server 2012 Components and Tools (Quick Overview) - Rev 1.3
PDF
tempdb and Performance Keys
PPTX
Oracle dba training
PPTX
Oracle DBA Tutorial for Beginners -Oracle training institute in bangalore
PPTX
FileTable and Semantic Search in SQL Server 2012
PPT
Sql Server Basics
PPTX
Oracle database introduction
PPTX
Oracle Database Introduction
PPT
Oracle archi ppt
PPTX
Introduction to Oracle Database
PPTX
Oracle architecture with details-yogiji creations
PPTX
The oracle database architecture
DOC
Oracle vs. MS SQL Server
PPTX
Orcale dba training
Oracle Tablespace - Basic
Physical architecture of sql server
MS SQL Server
Oracle DBA
Microsoft SQL Server 2012 Components and Tools (Quick Overview) - Rev 1.3
tempdb and Performance Keys
Oracle dba training
Oracle DBA Tutorial for Beginners -Oracle training institute in bangalore
FileTable and Semantic Search in SQL Server 2012
Sql Server Basics
Oracle database introduction
Oracle Database Introduction
Oracle archi ppt
Introduction to Oracle Database
Oracle architecture with details-yogiji creations
The oracle database architecture
Oracle vs. MS SQL Server
Orcale dba training
Ad

Viewers also liked (8)

PPTX
MS SQLSERVER:Joining Databases
PPTX
MS SQLSERVER:Feeding Data Into Database
PPTX
MS SQL SERVER: Introduction To Database Concepts
PDF
Microsoft SQL SERVER 70 461
PPTX
MS SQL SERVER: Using the data mining tools
PPTX
MS SQL SERVER: Programming sql server data mining
DOCX
Sqlserver 2012 installation step by step
PPTX
MS SQLSERVER:Creating A Database
MS SQLSERVER:Joining Databases
MS SQLSERVER:Feeding Data Into Database
MS SQL SERVER: Introduction To Database Concepts
Microsoft SQL SERVER 70 461
MS SQL SERVER: Using the data mining tools
MS SQL SERVER: Programming sql server data mining
Sqlserver 2012 installation step by step
MS SQLSERVER:Creating A Database
Ad

Similar to Introducing ms sql_server_updated (20)

PDF
Introducing ms sql_server
PPT
Database Foundation Training
PPTX
Training on Microsoft SQL Server(older version).pptx
PPT
Module02
PPTX
PostgreSQL Database Slides
PPT
MySQL and its basic commands
PPTX
Developers' New features of Sql server express 2012
PDF
mysqlanditsbasiccommands-150226033905-conversion-gate02.pdf
PPT
mySQL and Relational Databases
PPT
Managing user Online Training in IBM Netezza DBA Development by www.etraining...
PDF
PT- Oracle session01
PPTX
PPT
Ms sql server architecture
DOC
Module 3
PPTX
Getting Started with MySQL I
PPTX
hjkjlboiupoiuuouoiuoiuoiuoiuoiuoippt.pptx
PPTX
MySQL 8 -- A new beginning : Sunshine PHP/PHP UK (updated)
PPT
Sql Commands_Dr.R.Shalini.ppt
PPTX
Introduction to Oracle Database.pptx
PPT
Mysql Ppt
Introducing ms sql_server
Database Foundation Training
Training on Microsoft SQL Server(older version).pptx
Module02
PostgreSQL Database Slides
MySQL and its basic commands
Developers' New features of Sql server express 2012
mysqlanditsbasiccommands-150226033905-conversion-gate02.pdf
mySQL and Relational Databases
Managing user Online Training in IBM Netezza DBA Development by www.etraining...
PT- Oracle session01
Ms sql server architecture
Module 3
Getting Started with MySQL I
hjkjlboiupoiuuouoiuoiuoiuoiuoiuoippt.pptx
MySQL 8 -- A new beginning : Sunshine PHP/PHP UK (updated)
Sql Commands_Dr.R.Shalini.ppt
Introduction to Oracle Database.pptx
Mysql Ppt

Recently uploaded (20)

PDF
Saundersa Comprehensive Review for the NCLEX-RN Examination.pdf
PDF
Origin of periodic table-Mendeleev’s Periodic-Modern Periodic table
PDF
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
PDF
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH 9 GLOBAL SUCCESS - CẢ NĂM - BÁM SÁT FORM Đ...
PPTX
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
PPTX
Pharma ospi slides which help in ospi learning
PDF
102 student loan defaulters named and shamed – Is someone you know on the list?
PPTX
master seminar digital applications in india
PPTX
Microbial diseases, their pathogenesis and prophylaxis
PDF
Module 4: Burden of Disease Tutorial Slides S2 2025
PPTX
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
PDF
STATICS OF THE RIGID BODIES Hibbelers.pdf
PDF
Complications of Minimal Access Surgery at WLH
PDF
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
PPTX
Cell Types and Its function , kingdom of life
PDF
Basic Mud Logging Guide for educational purpose
PDF
Supply Chain Operations Speaking Notes -ICLT Program
PDF
RMMM.pdf make it easy to upload and study
PDF
VCE English Exam - Section C Student Revision Booklet
PDF
O5-L3 Freight Transport Ops (International) V1.pdf
Saundersa Comprehensive Review for the NCLEX-RN Examination.pdf
Origin of periodic table-Mendeleev’s Periodic-Modern Periodic table
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH 9 GLOBAL SUCCESS - CẢ NĂM - BÁM SÁT FORM Đ...
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
Pharma ospi slides which help in ospi learning
102 student loan defaulters named and shamed – Is someone you know on the list?
master seminar digital applications in india
Microbial diseases, their pathogenesis and prophylaxis
Module 4: Burden of Disease Tutorial Slides S2 2025
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
STATICS OF THE RIGID BODIES Hibbelers.pdf
Complications of Minimal Access Surgery at WLH
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
Cell Types and Its function , kingdom of life
Basic Mud Logging Guide for educational purpose
Supply Chain Operations Speaking Notes -ICLT Program
RMMM.pdf make it easy to upload and study
VCE English Exam - Section C Student Revision Booklet
O5-L3 Freight Transport Ops (International) V1.pdf

Introducing ms sql_server_updated

  • 1. Never stop improving qualityMicrosoft SQL ServerLARION_TDT@Internship_03www.elarion.com
  • 5. Structures of Microsoft SQL server
  • 6. How to create index for each record
  • 10. Supporting tools for MS SQL server
  • 11. Demo2
  • 12. Relational Database (1 of 4)DefinitionRelational Database is database that all data are established many tables to have relationship each other.Each table consists of many columns and many rows that each column is usuallycalled a register,each row is described an attribute.3
  • 13. Relational Database (2 of 4)The main componentsThe main components:Table: each table stores information of an object outside real life.
  • 14. Primary key: a collection of one column or many columns inside tables that it is not permit null data and is only one.
  • 15. Foreign key: a collection of one column or many columns inside tables that they are a primary of other tables and their data can be permitted null4
  • 16. Relational Database (3 of 4)Example 1:5
  • 17. Relational Database (4 of 4)Example 26
  • 18. Database Management System(1 of 3)Popular Database Management SystemsMS SQL server
  • 19. MySQL
  • 22. DB2
  • 23. …7
  • 24. Database Management System(2 of 3)DefinitionDatabase management system is a software to permit users to create, control and access into database.Database management system has maintained consistency of database during its cycle life.8
  • 25. Database Management System (3 of 3)FunctionThe main functions of database management systemDatabase definition
  • 30. Mircosoft SQL server(1 of 3)MS SQL Server is a database management system that it is established and developed by Microsoft based on Transact-SQL method in order to exchange data between Client and MS SQL Server.10
  • 31. Mircosoft SQL server(2 of 3)AdaptationMS SQL Server is optimized in order to run Very Large Database Environment (VLDE) even though Tera-Byte, especially for serving user thousands MS SQL Server can collaborate with other servers such as Microsoft Internet Information Server (IIS), Oracle...11
  • 32. Mircosoft SQL server (3 of 3)VersionsVersions of MS SQL ServerEnterprise Edition
  • 36. SQL Server Express Edition12
  • 37. Mircosoft SQL server(1 of 3)StructureOne of the most usual structures MS SQL ServerClient / Server Architecture
  • 39. Structure of MS SQL server(2 of 3)Client / Server Architecture14
  • 40. Structure of MS SQL server (3 of 3)N-tier Architecture15
  • 41. How to create index for each record(1 of 2)Index is used to supporting and improving for accessing more quick to data flows base on value of one or many columns.Two forms:Clustered index
  • 43. How to create index for each record(2 of 2)Syntax:CREATE [CLUSTERED | NONCLUSTERED] INDEXindex_nameON table_name(column_name [, column_name]...)For example for creating non-clustered index on MADV of NHANVIEN columns:CREATE NONCLUSTERED INDEX idx_nhanvien_madvONnhanvien(madv)17
  • 44. Backup, Restore Database(1 of 7)BackupWhat is Backup Database?That is the activity of copying files or databases from SQL server to another storage device.
  • 45. Having two backup database forms:
  • 47. By direct action in your SQL Server18
  • 48. Backup, Restore Database(2 of 7)BackupSyntax of Backup Database CommandsBACKUP DATABASE { database_name | @database_name_var}TO < backup_device > [ ,...n ][ WITH    [ BLOCKSIZE = { blocksize | @blocksize_variable} ]    [ [ , ] DESCRIPTION = { 'text'| @text_variable} ]    [ [ , ] DIFFERENTIAL ]    [ [ , ] EXPIREDATE = { date | @date_var}        | RETAINDAYS = { days | @days_var} ]    [ [ , ] FORMAT | NOFORMAT ]    [ [ , ] { INIT | NOINIT } ]    [ [ , ] MEDIADESCRIPTION = { 'text'| @text_variable} ]    [ [ , ] MEDIANAME = { media_name| @media_name_variable} ]    [ [ , ] NAME = { backup_set_name | @backup_set_name_var} ]    [ [ , ] { NOSKIP | SKIP } ]    [ [ , ] { NOUNLOAD | UNLOAD } ]    [ [ , ] RESTART ]    [ [ , ] STATS [ =percentage ] ]]19
  • 49. Backup, Restore Database(3 of 7)BackupDescriptionBLOCKSIZE: automatic parameter
  • 50. DIFFERENTIAL: differential backup is only necessary change datas
  • 55. STATS: appearance of programbar20
  • 56. Backup, Restore Database(4 of 7)BackupFor example backup databaseBACKUP DATABASE QLNGKTO DISK= ‘F:\ ngk.bak’WITH DESCRIPTION = ‘BACK UP’,STATS          GO21
  • 57. Backup, Restore Database(5 of 7)BackupResult22
  • 58. Backup, Restore Database(6 of 7)RestoreSyntax RESTORE DATABASE { database_name | @database_name_var }  [ FROM <backup_device> [ ,...n ] ]  [ WITH  {     [ RECOVERY | NORECOVERY | STANDBY =         {standby_file_name | @standby_file_name_var } ]    | , <general_WITH_options> [ ,...n ]  | , <replication_WITH_option>    | , <change_data_capture_WITH_option> | , <service_broker_WITH options>    | , <point_in_time_WITH_options—RESTORE_DATABASE>    } [ ,...n ]  ][;]23
  • 59. Backup, Restore Database(end)RestoreFor example: RESTORE DATABASE users FROM DISK='C:\backupusers.BAK' WITH RECOVERY24
  • 60. Stored Procedure, Trigger (1 of 9)Stored ProcedureWhat is Stored Procedure ?SP(Stored Procedure) is the name given to a group of SQL statement is created and stored in the server database.
  • 61. SP allows transmission parameters, and may be called by many clients over the network with different parameters. When SP is changed, all clients will automatically receive the new version, because the SP is stored at the Server, not Client.25
  • 62. Stored Procedure, Trigger (2 of 9)Stored ProcedureCreating procedureCREATE PROCEDURE procedure_name [;number] [([parameter1] [,parameter2]...[parameter255])] AS sql_statements26
  • 63. Stored Procedure, Trigger (3 of 9)Stored ProcedureFor example CREATEPROCEDURE sp_users_insert (@firstname varchar(50), @lastname varchar(50), @birthday date, @groupid int) AS BEGIN ifexists(select groupid from groups where groupid = @groupid) BEGINinsertinto users(firstname, lastname, birthday, groupid)values(@firstname,@lastname,@birthday,@groupid) END END27
  • 64. Stored Procedure, Trigger (4 of 9)TriggerTrigger is a data type that is specific saved. Otherwise, trigger to help ensure data integrityA table has maximum 3 trigger types:Update trigger
  • 66. Delete triggerFor example: employer salary is not permitted higher than his top-banana28
  • 67. Stored Procedure, Trigger (5 of 9)TriggerSyntax:CREATE TRIGGER trigger_name ON table_name | view_name [WITH ENCRYPTION] {FOR | AFTER | INSTEAD OF}{ [INSERT] [,] [UPDATE ] [,] [DELETE] } AS sql_statements29
  • 68. Stored Procedure, Trigger (6 of 9)TriggerCREATE TRIGGER groups_users_deleteon groupsfordeleteasBEGINDECLARE @groupid int;Set @groupid=(Select groupid from DELETED);deletefrom users where groupid = @groupidEND30
  • 69. Stored Procedure, Trigger (7 of 9)Function Function is database object similar procedures. However, the difference between procedures and function that function returns to a value via its function name while procedures do not.31
  • 70. Stored Procedure, Trigger (8 of 9)TriggerSyntaxCREATE FUNCTION [ schema_name. ] function_name ( [ { @parameter_name [ AS ] [ type_schema_name. ] parameter_data_type      [ = default ] [ READONLY ] }     [ ,...n ]S   ] ) RETURNS return_data_type     [ WITH <function_option> [ ,...n ] ]     [ AS ]     BEGIN         function_body         RETURN scalar_expression     END [ ; ]32
  • 71. Stored Procedure, Trigger (end)TriggerFor exampleCREATEFUNCTION f_users_tong() RETURNS @bangthongke TABLE (groupid int,groupname varchar(50),tonguser INT) AS BEGIN INSERTINTO @bangthongke SELECT groups.groupid,groups.groupname,COUNT(userid) FROM (groups INNERJOIN users ON groups.groupid = users.groupid) GROUPBY groups.groupid,groups.groupname RETURN END33
  • 72. View(1 of 4)DefinitionView is a method that we can watch at data into one or many tables of database.
  • 73. View is a virtual screen that it is created as a union of rows and columns by one or many different tables.
  • 74. Decreasing more complex in database34
  • 75. View(2 of 4)Syntax:CREATE VIEW COMMAND used to create view:CREATE VIEW <virtual_name_table> AS <select_statement>35
  • 76. View(3 of 4) For example:CREATE VIEW DSSVAS SELECT masv, hodem, ten,DATEDIFF (YY, ngaysinh,GETDATE())AStuoi, tenlopFROMsinhvien, lop36
  • 78. Supportting tools for MS SQL Server One of the most popular supporting tools for MS SQL sever is SQL Assistant. You can download from linkhttp://www.softpedia.com/progDownload/SoftTree-SQL-Assistant-Download-92428.html38
  • 79. DemoHow to use DiagramDecentralizedBackupRestoreFunctionStore ProcedureTrigger39
  • 80. Reference Document of LARION_TDT@internship_02 Courses