SQL Server Performance

TGIF

Discussion in 'The Lighter Side of Being a DBA' started by Luis Martin, Nov 4, 2004.

  1. Luis Martin Moderator

    The following is a google translation of a spanish question last week.
    When I read it, my first thought was is a Brad joke.

    So if you have timeeeeeeeeeeeee, read it (remember is a google translation) and tell me what will be your answer.




    I must make this selects nevertheless I do not have nor I devise of like obtaining them aki the tables:

    create table almacenes(almacen int, product int, amount int, primary key (warehouse, product))

    create table catalogos (I catalogue int, product int, description char(25), primary key (product, I catalogue))

    create table clients (client int primary key, name char(30), street char(30), I number char(5), colony char(30), delegation char(30), cp to char (5), been char(30), pais char(30), group char(30), I telephone bigint, RFC char(13), age int, sex bit)

    create table consumers (consuming int primary key, region int, description char(30))

    create table structures (head int, Indian int) create table fact_clientes (fact_cliente int table fact_proveedores (it invoices int primary key, supplier int, product int, price money, amount int, total money, paid bit)

    create table linea_prod (no_prod int primary key, name char(25), description char(25))

    create table lineas(linea char(10), description to char (30)) create table marcas(marca char(10), description to char (30)) create table markets (market int primary key, description char(25)) create table orden_compras (order int, date datetime, product int, supplier int, amount int, total money, discount dec(6,2), primary key(orden, producto))

    create table pagos_clientes (payment int, fact_cliente int, date datetime, concerns money, client int, product int, amount int, total money, primary key(pedido, product))

    create table products (product int primary key, description to char (25), price money, model int, tipo_prod bigint, marks to char (10), garantia smalldatetime, presentation to varchar (10), mayoreo decimal (6,2), discount smallint, quality to varchar (10), IVA smallint, line to char (30), subline to char (30), subsublinea to char (30), marking char(30)) create table suppliers (supplier int primary key, name char(25), direction char(40), I telephone bigint, mail char(30))

    create table sublineas(sublinea char(10), description to char (30 create table subsublineas(subsublineas char(10), description to char (30)) create table salesmen (salesman int primary key, name char(30))

    create table sales (sale int, amount int, client int, product int, cost money, total money primary key(venta, producto))

    In all the cases of showing to key and description (ej. Client 1? name pedro perez) (Frame AC? High quality)

    1. Consultation of client, and delegation
    2. Consultation of sales by client in units
    3. Consultation of sales by client in weights
    4. Consultation of sales in units by product select
    5. Consultation of sales in weights by product
    6. Consultation of sales in units by mark
    7. Consultation of sales in units by mark and marking
    8. Consultation of sales in units by mark and marking and marking
    9. Consultation of sales in units by client and marks
    10. Consultation of sales in units by client and line
    11. Consultation of sales in units by Line
    12. Consultation of sales in units by product and delegation
    13. Consultation of sales in units by subsublinea and cp
    14. Consultation of sales in units by product, client and colony
    15. Consultation of sales in units by subline, marks, client, state
    16. Consultation of sales in units by submark, subline, client product
    17. Consultation of sales in units by group and client
    18. Consultation of sales in units by gruido line and product
    19. Consultation of sales in units by state and product
    20. Consultation of sales in units by state and product and pais

    Luis Martin
    Moderator
    SQL-Server-Performance.com

    All postings are provided “AS IS” with no warranties for accuracy.

Share This Page