SlideShare a Scribd company logo
1 of 10
BARBARA PAREDES
Requerimientos de hardware y software      Requisitos del sistema  En la tabla siguiente se enumeran los requisitos de hardware y software de los tres entornos de SQL Server Compact Edition: de desarrollo, de cliente y de servidor. Para obtener más información sobre los distintos entornos, vea Arquitectura de SQL Server Compact Edition y Instalar SQL Server Compact Edition.
principales mejoras con respecto a SQL 2000
[object Object],ROW_NUMBER () OVER ([<partition_by_clause>] <order_by_clause>)  RANK () OVER ([<partition_by_clause>] <order_by_clause>)  DENSE_RANK () OVER ([<partition_by_clause>] <order_by_clause>)  NTILE (integer_expression) OVER ([<partition_by_clause>] <order_by_clause>)
ROW_NUMBER FunctionSELECT ROW_NUMBER() OVER(ORDER BY FirstName) [Nro],        FirstName,        LastName,        Title FROM   Person.Contact  la función ROW_NUMBER() que nos permite enumerar los resultados de una manera sencilla, es decir, nos devuelve el número secuencial para cada una de la filas de un conjunto de resultados , donde la primera fila es 1.
RANK Function Rankea los datos de acuerdo a lo que se especifique para la cláusula ORDER BY, y lo hace rankeando verdaderamente la enumeración los resultados. Se diferencia de ROW_NUMBER() en lo siguiente. ROW_NUMBER() enumera así: 1,2,3,4,5... cada fila, en cambio RANK() no tendría porque hacerlo necesarimente de la misma manera, pudiendo enumerar así: 1,2,4,4,7,8,8,8,9... Por ejemplo:  SELECT RANK() OVER(ORDER BY FirstName) [Nro],        FirstName,        LastName,        Title FROM   Person.Contact
DENSE_RANK Function Es parecido a RANK(), y se diferencia en que no produce saltos en la enumeración de los result set. Es decir, la enumeración sería así: 1,2,2,3,4,5,5,6,7,8,8,9. Enumeración repetida pero secuencial, sin saltar números.    SELECT DENSE_RANK() OVER(ORDER BY FirstName) [Nro],        FirstName,        LastName,        Title FROM   Person.Contact
NTILE Function Esta función lo que hace es limitar la numeración máxima de los resultados, por ejemplo, si es especifica NTILE(3O00) entonces la numeración será hasta 3000 a partir, obviamente, desde 1. Por ejemplo:  SELECT NTILE(1000) OVER(ORDER BY FirstName) [Nro],        FirstName,        LastName,        Title FROM   Person.Contact
TODAS LAS FUNCIONES RANKING:SELECT FirstName,        LastName,        Title,        ROW_NUMBER() OVER(ORDER BY FirstName) [ROW_NUMBER],        ROW_NUMBER() OVER(PARTITION BY FirstName ORDER BY FirstNa       me) [RN_PARTITION],        RANK() OVER(ORDER BY FirstName) [RANK],        DENSE_RANK() OVER(ORDER BY FirstName) [DENSE_RANK],        NTILE(1000) OVER(ORDER BY FirstName) [NTILE] FROM   Person.Contact WHERE  [Title] IS NOT NULL

More Related Content

What's hot

Unidad v integridad relacional
Unidad v  integridad relacionalUnidad v  integridad relacional
Unidad v integridad relacionalOrlando Verdugo
 
Otros Objetos de Esquemas Z051 Cap 12
Otros Objetos de Esquemas Z051 Cap 12Otros Objetos de Esquemas Z051 Cap 12
Otros Objetos de Esquemas Z051 Cap 12Alexander Calderón
 
4 establecer-procesos-para-la-manipulacion-de-la-base-de-datos
4 establecer-procesos-para-la-manipulacion-de-la-base-de-datos4 establecer-procesos-para-la-manipulacion-de-la-base-de-datos
4 establecer-procesos-para-la-manipulacion-de-la-base-de-datosNathaly Arias
 
HTML5 API WebSQL Database: DML: Data Manipulation Language
HTML5 API WebSQL Database: DML: Data Manipulation LanguageHTML5 API WebSQL Database: DML: Data Manipulation Language
HTML5 API WebSQL Database: DML: Data Manipulation LanguageFrancisco Javier Arce Anguiano
 
Ddl-Lenguaje de definición de datos
Ddl-Lenguaje de definición de datosDdl-Lenguaje de definición de datos
Ddl-Lenguaje de definición de datosvargasaldanajohanna
 
Insercción de datos y selección de datos
Insercción de datos y selección de datosInsercción de datos y selección de datos
Insercción de datos y selección de datosPathy1254
 
Segunda forma normal
Segunda forma normalSegunda forma normal
Segunda forma normalITCV
 
MANUAL COMPLETO DE SQL
MANUAL COMPLETO DE SQLMANUAL COMPLETO DE SQL
MANUAL COMPLETO DE SQLEdgar Sandoval
 
Normalización de Base de Datos
Normalización de Base de DatosNormalización de Base de Datos
Normalización de Base de DatosVictor Chavez
 

What's hot (20)

Consultas básicas en sql server
Consultas básicas en sql serverConsultas básicas en sql server
Consultas básicas en sql server
 
Comandos SQL
Comandos SQLComandos SQL
Comandos SQL
 
Aprenda SQL Server
Aprenda SQL ServerAprenda SQL Server
Aprenda SQL Server
 
SENTENCIAS DE SQL SERVER
SENTENCIAS DE SQL SERVERSENTENCIAS DE SQL SERVER
SENTENCIAS DE SQL SERVER
 
Unidad v integridad relacional
Unidad v  integridad relacionalUnidad v  integridad relacional
Unidad v integridad relacional
 
Apuntes 3
Apuntes 3Apuntes 3
Apuntes 3
 
Otros Objetos de Esquemas Z051 Cap 12
Otros Objetos de Esquemas Z051 Cap 12Otros Objetos de Esquemas Z051 Cap 12
Otros Objetos de Esquemas Z051 Cap 12
 
Operaciones basicas de sql
Operaciones basicas de sqlOperaciones basicas de sql
Operaciones basicas de sql
 
4 establecer-procesos-para-la-manipulacion-de-la-base-de-datos
4 establecer-procesos-para-la-manipulacion-de-la-base-de-datos4 establecer-procesos-para-la-manipulacion-de-la-base-de-datos
4 establecer-procesos-para-la-manipulacion-de-la-base-de-datos
 
Consultas en SQL
Consultas en SQLConsultas en SQL
Consultas en SQL
 
Practica3
Practica3Practica3
Practica3
 
INSERT
INSERTINSERT
INSERT
 
HTML5 API WebSQL Database: DML: Data Manipulation Language
HTML5 API WebSQL Database: DML: Data Manipulation LanguageHTML5 API WebSQL Database: DML: Data Manipulation Language
HTML5 API WebSQL Database: DML: Data Manipulation Language
 
Ddl-Lenguaje de definición de datos
Ddl-Lenguaje de definición de datosDdl-Lenguaje de definición de datos
Ddl-Lenguaje de definición de datos
 
Insercción de datos y selección de datos
Insercción de datos y selección de datosInsercción de datos y selección de datos
Insercción de datos y selección de datos
 
ARBOLES MULTICAMINOS
ARBOLES MULTICAMINOSARBOLES MULTICAMINOS
ARBOLES MULTICAMINOS
 
Segunda forma normal
Segunda forma normalSegunda forma normal
Segunda forma normal
 
Sql Sentencias
Sql Sentencias Sql Sentencias
Sql Sentencias
 
MANUAL COMPLETO DE SQL
MANUAL COMPLETO DE SQLMANUAL COMPLETO DE SQL
MANUAL COMPLETO DE SQL
 
Normalización de Base de Datos
Normalización de Base de DatosNormalización de Base de Datos
Normalización de Base de Datos
 

Viewers also liked

Intro to tsql unit 1
Intro to tsql   unit 1Intro to tsql   unit 1
Intro to tsql unit 1Syed Asrarali
 
ITCamp 2013 - Cristian Lefter - Transact-SQL from 0 to SQL Server 2012
ITCamp 2013 - Cristian Lefter - Transact-SQL from 0 to SQL Server 2012ITCamp 2013 - Cristian Lefter - Transact-SQL from 0 to SQL Server 2012
ITCamp 2013 - Cristian Lefter - Transact-SQL from 0 to SQL Server 2012ITCamp
 
Intro to tsql unit 15
Intro to tsql   unit 15Intro to tsql   unit 15
Intro to tsql unit 15Syed Asrarali
 
Intro to tsql unit 13
Intro to tsql   unit 13Intro to tsql   unit 13
Intro to tsql unit 13Syed Asrarali
 
Introduction of lambda expression and predicate builder
Introduction of lambda expression and predicate builderIntroduction of lambda expression and predicate builder
Introduction of lambda expression and predicate builderLearningTech
 
20120504 tsql temp_table
20120504 tsql temp_table20120504 tsql temp_table
20120504 tsql temp_tableLearningTech
 
Intro to tsql unit 8
Intro to tsql   unit 8Intro to tsql   unit 8
Intro to tsql unit 8Syed Asrarali
 
Intro to tsql unit 4
Intro to tsql   unit 4Intro to tsql   unit 4
Intro to tsql unit 4Syed Asrarali
 
Intro to tsql unit 6
Intro to tsql   unit 6Intro to tsql   unit 6
Intro to tsql unit 6Syed Asrarali
 
Intro to tsql unit 7
Intro to tsql   unit 7Intro to tsql   unit 7
Intro to tsql unit 7Syed Asrarali
 
Intro to tsql unit 3
Intro to tsql   unit 3Intro to tsql   unit 3
Intro to tsql unit 3Syed Asrarali
 
Intro to tsql unit 12
Intro to tsql   unit 12Intro to tsql   unit 12
Intro to tsql unit 12Syed Asrarali
 
Intro to tsql unit 10
Intro to tsql   unit 10Intro to tsql   unit 10
Intro to tsql unit 10Syed Asrarali
 
Intro to tsql unit 14
Intro to tsql   unit 14Intro to tsql   unit 14
Intro to tsql unit 14Syed Asrarali
 
Adding a timeline to your web app
Adding a timeline to your web appAdding a timeline to your web app
Adding a timeline to your web appJoe Wilson
 
Intro to tsql unit 11
Intro to tsql   unit 11Intro to tsql   unit 11
Intro to tsql unit 11Syed Asrarali
 
Intro to tsql unit 2
Intro to tsql   unit 2Intro to tsql   unit 2
Intro to tsql unit 2Syed Asrarali
 
Intro to tsql unit 9
Intro to tsql   unit 9Intro to tsql   unit 9
Intro to tsql unit 9Syed Asrarali
 

Viewers also liked (20)

Intro to tsql unit 1
Intro to tsql   unit 1Intro to tsql   unit 1
Intro to tsql unit 1
 
ITCamp 2013 - Cristian Lefter - Transact-SQL from 0 to SQL Server 2012
ITCamp 2013 - Cristian Lefter - Transact-SQL from 0 to SQL Server 2012ITCamp 2013 - Cristian Lefter - Transact-SQL from 0 to SQL Server 2012
ITCamp 2013 - Cristian Lefter - Transact-SQL from 0 to SQL Server 2012
 
Intro to tsql unit 15
Intro to tsql   unit 15Intro to tsql   unit 15
Intro to tsql unit 15
 
Intro to tsql unit 13
Intro to tsql   unit 13Intro to tsql   unit 13
Intro to tsql unit 13
 
Introduction of lambda expression and predicate builder
Introduction of lambda expression and predicate builderIntroduction of lambda expression and predicate builder
Introduction of lambda expression and predicate builder
 
20120504 tsql temp_table
20120504 tsql temp_table20120504 tsql temp_table
20120504 tsql temp_table
 
Intro to tsql unit 8
Intro to tsql   unit 8Intro to tsql   unit 8
Intro to tsql unit 8
 
Intro to tsql unit 4
Intro to tsql   unit 4Intro to tsql   unit 4
Intro to tsql unit 4
 
Intro to tsql unit 6
Intro to tsql   unit 6Intro to tsql   unit 6
Intro to tsql unit 6
 
Intro to tsql unit 7
Intro to tsql   unit 7Intro to tsql   unit 7
Intro to tsql unit 7
 
Intro to tsql unit 3
Intro to tsql   unit 3Intro to tsql   unit 3
Intro to tsql unit 3
 
Intro to tsql
Intro to tsqlIntro to tsql
Intro to tsql
 
Intro to tsql unit 12
Intro to tsql   unit 12Intro to tsql   unit 12
Intro to tsql unit 12
 
Intro to tsql unit 10
Intro to tsql   unit 10Intro to tsql   unit 10
Intro to tsql unit 10
 
Intro to tsql unit 14
Intro to tsql   unit 14Intro to tsql   unit 14
Intro to tsql unit 14
 
Adding a timeline to your web app
Adding a timeline to your web appAdding a timeline to your web app
Adding a timeline to your web app
 
Intro to tsql unit 11
Intro to tsql   unit 11Intro to tsql   unit 11
Intro to tsql unit 11
 
Campanha da fraternidade 2014
Campanha da fraternidade 2014Campanha da fraternidade 2014
Campanha da fraternidade 2014
 
Intro to tsql unit 2
Intro to tsql   unit 2Intro to tsql   unit 2
Intro to tsql unit 2
 
Intro to tsql unit 9
Intro to tsql   unit 9Intro to tsql   unit 9
Intro to tsql unit 9
 

Similar to Sql ii

Similar to Sql ii (20)

SQLSaturday Guatemala - SOS de Alto de rendimiento con Window Functions
SQLSaturday Guatemala - SOS de Alto de rendimiento con Window FunctionsSQLSaturday Guatemala - SOS de Alto de rendimiento con Window Functions
SQLSaturday Guatemala - SOS de Alto de rendimiento con Window Functions
 
Command oracle
Command oracleCommand oracle
Command oracle
 
Sentencias Sql
Sentencias SqlSentencias Sql
Sentencias Sql
 
SQL
SQLSQL
SQL
 
Amnel
AmnelAmnel
Amnel
 
Tm13 introduccion al_sql
Tm13 introduccion al_sqlTm13 introduccion al_sql
Tm13 introduccion al_sql
 
Precentacion de sql visual
Precentacion de sql visualPrecentacion de sql visual
Precentacion de sql visual
 
Consultas-SQL.pdf
Consultas-SQL.pdfConsultas-SQL.pdf
Consultas-SQL.pdf
 
Consultas sql
Consultas sqlConsultas sql
Consultas sql
 
Resumen sql-oracle
Resumen sql-oracleResumen sql-oracle
Resumen sql-oracle
 
Seleccion de datos_sql_2005
Seleccion de datos_sql_2005Seleccion de datos_sql_2005
Seleccion de datos_sql_2005
 
Presentacion 4 unidad
Presentacion 4 unidadPresentacion 4 unidad
Presentacion 4 unidad
 
Seleccion de datos_sql_2005
Seleccion de datos_sql_2005Seleccion de datos_sql_2005
Seleccion de datos_sql_2005
 
Introduccion ddl
Introduccion ddlIntroduccion ddl
Introduccion ddl
 
Introduccion ddl
Introduccion ddlIntroduccion ddl
Introduccion ddl
 
Mejoras en T-SQL para SQL Server 2005
Mejoras en T-SQL para SQL Server 2005Mejoras en T-SQL para SQL Server 2005
Mejoras en T-SQL para SQL Server 2005
 
Tema 3.2 SQL.ppt
Tema 3.2 SQL.pptTema 3.2 SQL.ppt
Tema 3.2 SQL.ppt
 
Tema 3.2 SQL.ppt
Tema 3.2 SQL.pptTema 3.2 SQL.ppt
Tema 3.2 SQL.ppt
 
SQL(DQL).pdf
SQL(DQL).pdfSQL(DQL).pdf
SQL(DQL).pdf
 
Fundamentos de BD - Unidad 6 lenguaje sql
Fundamentos de BD - Unidad 6 lenguaje sqlFundamentos de BD - Unidad 6 lenguaje sql
Fundamentos de BD - Unidad 6 lenguaje sql
 

More from bat1820

Flash =)
Flash =)Flash =)
Flash =)bat1820
 
Procedimientos almacenados
Procedimientos almacenadosProcedimientos almacenados
Procedimientos almacenadosbat1820
 
Ejemplos de diagramas =)
Ejemplos de diagramas =)Ejemplos de diagramas =)
Ejemplos de diagramas =)bat1820
 
Reportes =)
Reportes =)Reportes =)
Reportes =)bat1820
 
Java ventajas y caracteristicas
Java ventajas y caracteristicasJava ventajas y caracteristicas
Java ventajas y caracteristicasbat1820
 
Permisos de linux
Permisos de linuxPermisos de linux
Permisos de linuxbat1820
 
Permisos de Windows
Permisos de WindowsPermisos de Windows
Permisos de Windowsbat1820
 

More from bat1820 (12)

B.v.ii
B.v.iiB.v.ii
B.v.ii
 
B.V. II
B.V. IIB.V. II
B.V. II
 
Flash =)
Flash =)Flash =)
Flash =)
 
Procedimientos almacenados
Procedimientos almacenadosProcedimientos almacenados
Procedimientos almacenados
 
Ejemplos de diagramas =)
Ejemplos de diagramas =)Ejemplos de diagramas =)
Ejemplos de diagramas =)
 
Java
JavaJava
Java
 
Reportes =)
Reportes =)Reportes =)
Reportes =)
 
Java ventajas y caracteristicas
Java ventajas y caracteristicasJava ventajas y caracteristicas
Java ventajas y caracteristicas
 
Ip v4
Ip v4Ip v4
Ip v4
 
Ip v4
Ip v4Ip v4
Ip v4
 
Permisos de linux
Permisos de linuxPermisos de linux
Permisos de linux
 
Permisos de Windows
Permisos de WindowsPermisos de Windows
Permisos de Windows
 

Sql ii

  • 2. Requerimientos de hardware y software  Requisitos del sistema En la tabla siguiente se enumeran los requisitos de hardware y software de los tres entornos de SQL Server Compact Edition: de desarrollo, de cliente y de servidor. Para obtener más información sobre los distintos entornos, vea Arquitectura de SQL Server Compact Edition y Instalar SQL Server Compact Edition.
  • 3.
  • 4. principales mejoras con respecto a SQL 2000
  • 5.
  • 6. ROW_NUMBER FunctionSELECT ROW_NUMBER() OVER(ORDER BY FirstName) [Nro],        FirstName,        LastName,        Title FROM   Person.Contact la función ROW_NUMBER() que nos permite enumerar los resultados de una manera sencilla, es decir, nos devuelve el número secuencial para cada una de la filas de un conjunto de resultados , donde la primera fila es 1.
  • 7. RANK Function Rankea los datos de acuerdo a lo que se especifique para la cláusula ORDER BY, y lo hace rankeando verdaderamente la enumeración los resultados. Se diferencia de ROW_NUMBER() en lo siguiente. ROW_NUMBER() enumera así: 1,2,3,4,5... cada fila, en cambio RANK() no tendría porque hacerlo necesarimente de la misma manera, pudiendo enumerar así: 1,2,4,4,7,8,8,8,9... Por ejemplo: SELECT RANK() OVER(ORDER BY FirstName) [Nro],        FirstName,        LastName,        Title FROM   Person.Contact
  • 8. DENSE_RANK Function Es parecido a RANK(), y se diferencia en que no produce saltos en la enumeración de los result set. Es decir, la enumeración sería así: 1,2,2,3,4,5,5,6,7,8,8,9. Enumeración repetida pero secuencial, sin saltar números.   SELECT DENSE_RANK() OVER(ORDER BY FirstName) [Nro],        FirstName,        LastName,        Title FROM   Person.Contact
  • 9. NTILE Function Esta función lo que hace es limitar la numeración máxima de los resultados, por ejemplo, si es especifica NTILE(3O00) entonces la numeración será hasta 3000 a partir, obviamente, desde 1. Por ejemplo: SELECT NTILE(1000) OVER(ORDER BY FirstName) [Nro],        FirstName,        LastName,        Title FROM   Person.Contact
  • 10. TODAS LAS FUNCIONES RANKING:SELECT FirstName,        LastName,        Title,        ROW_NUMBER() OVER(ORDER BY FirstName) [ROW_NUMBER],        ROW_NUMBER() OVER(PARTITION BY FirstName ORDER BY FirstNa me) [RN_PARTITION],        RANK() OVER(ORDER BY FirstName) [RANK],        DENSE_RANK() OVER(ORDER BY FirstName) [DENSE_RANK],        NTILE(1000) OVER(ORDER BY FirstName) [NTILE] FROM   Person.Contact WHERE  [Title] IS NOT NULL