Anda di halaman 1dari 2

ANGEL CASTILLO HINOSTROZA TRABAJO 1.txt ALUMNO: ANGEL ALEJO CASTILLO HINOSTROZA DNI: 42635888 SOLUCION 1.

Select Nom_Propietario, Ape_Propietario, count(P.Cod_Propietario) From tb_Propietario P inner join Tb_Auto A On P.Cod_Propietario=A.Cod_propietario Group by Nom_Propietario, Ape_Propietario Having count(P.Cod_Propietario)>1 SOLUCION 2. Select Num_Papeleta, Fec_Papeleta From tb_Papeleta Where Cod_infraccion in T01 SOLUCION 3. SELECT Num_Papeleta, Fec_Papeleta, Cod_Infraccion, Num_Placa, Est_Papeleta, Cod_Agente FROM Tb_Papeleta WHERE (Day(Fec_Papeleta)>=15) AND (Month(Fec_Papeleta)=3) AND (Year(Fec_Papeleta)=2006) SOLUCION 4. Select P.Num_Placa, Des_Color, Des_Marca, Sum(Multa) From (((Tb_Papeleta P Inner Join Tb_Auto A On P.Num_placa=A.Num_placa) Inner Join Tb_color C On C.Cod_color=A.Cod_color) Inner Join Tb_Marca M On M.Cod_Marca=A.Cod_Marca) Inner Join Tb_Infraccion I On I.Cod_Infraccion=P.Cod_Infraccion Group by P.Num_Placa, Des_Color, Des_Marca SOLUCION 5. Select Nom_Agente, Ape_Agente, Cod_Infraccion From Tb_Agente A Inner Join Tb_Papeleta P On A.Cod_Agente=P.Cod_Agente Where Cod_Infraccion in(T03) SOLUCION 6. Select Top 1 I.Cod_infraccion, Des_infraccion, Count(P.Cod_infraccion) From Tb_infraccion I Left join Tb_Papeleta P On P.Cod_Infraccion=I.Cod_Infraccion Group by I.Cod_Infraccion, Des_Infraccion Order by Count(P.Cod_infraccion) asc SOLUCION 7. Select Cod_Agente, Nom_Agente+ + Ape_Agente From Tb_Agente Where (Nom_Agente Like%A) Or (Ape_Agente like_O%) SOLUCION 8. Select A.Cod_marca, Des_marca, count(A.Cod_Marca) From Tb_Auto A Inner Join Tb_Marca M On A.Cod_marca=M.Cod_Marca Group by A.Cod_marca, des_Marca Pgina 1

SOLUCION 9.

ANGEL CASTILLO HINOSTROZA TRABAJO 1.txt

Select P.Cod_Agente, Nom_Agente, Ape_Agente, Sum(Multa) From ((Tb_Papeleta P Inner Join Tb_Agente A On P.Cod_Agente = A.Cod_Agente) Inner Join Tb_Infraccion I On P.Cod_Infraccion = I.Cod_Infraccion) Group by P.Cod_Agente, Nom_Agente, Ape_Agente SOLUCION 10. Select Top 3 P.Cod_infraccion, Des_infraccion, Count(P.Cod_infraccion) From Tb_infraccion I Inner join Tb_Papeleta P On P.Cod_Infraccion=I.Cod_Infraccion Group by P.Cod_Infraccion, Des_Infraccion Order by Count(P.Cod_infraccion) Desc

Pgina 2