Download as pdf or txt
Download as pdf or txt
You are on page 1of 2

UNICA

FACULTAD DE INGENIERIA DE SISTEMAS


ESCUELA DE INGENIERIA DE SISTEMAS

Curso : DISEÑO E IMPLEMENTACIÓN DE BASE DE DATOS

Catedrático : Paco Márquez Urbina.

LABORATORIO Nº4

1.- --- Order by Orden ascendente


use Northwind
go
Select customerid, companyname, contactname, country
from customers
order by country asc

2.- --Order by Orden descendente


Select customerid, companyname, contactname, country
from customers
order by country desc

3.- --Order by Orden descendente indicando numero de columna


Select customerid, companyname, contactname, country
from customers
order by 4 desc

4.- --Uso del Top, mostrando los 10 productos mas caros de la tabla
producto
Select top 10 productname, unitprice
from products
order by unitprice desc
5.- --Uso del Top, mostrando el 10 por ciento de productos mas caros de
la tabla producto
Select top 10 percent productname, unitprice
from products
order by unitprice desc

6.- ----With ties


Select top 11 with ties productname, unitprice
from products
order by unitprice desc

7.- --Offset 5 rows


Select productname, unitprice
from products
order by unitprice Offset 5 rows

8.- --Fetch next 5 row only


Select productname, unitprice
from products
order by unitprice Offset 5 rows
Fetch next 5 row only

You might also like