SlideShare a Scribd company logo
1 of 37
Nombre de las Alumnas:

María Cristina Martínez Arriaga.

      Emma Herrera Elías.



           Trabajo:

     Consultas en Navicat



    Nombre de la Profesora:

  Esperanza Pescador Espitia.



        Grado y Grupo:

              4°C
Se encarga de desarrollar proyectos diferentes en el cual
  participan diferentes departamentos. En cada proyecto
participan varias personas y el proyecto tiene un líder en el
        cual hacen un presupuesto para el proyecto.

                        Entidades:
                     Proyecto(CveProy)
                     Empleado(IdEmp)
                 Departamento(CveDepto)


                       Relaciones:
                 Empleado – Departamento
                            N:1
                   Empleado - Proyecto
                            N:M
Diagrama
                      Cveproy
     PROYECTO




         R1




                                           Cvedepto




        EMPLEADO                     DEPARTAMENTO
                                R1




R1
                   Idemp
Diagrama final

 PROYECTO              R1   PRESUPUESTO




                                 R2
  Cveproy                                 Idemp




                            EMPLEADO
                                                   R4




 DEPARTAMENTO                    R
                                 3




                                                  LIDER
            Cvedepto
Consulta 1: Obtener los datos de los clientes
Sintaxis:

select *

from empleado




consulta 2: Obtener los nombres de         los
empleados y claves de los departamentos.
Sintaxis:

select NomEmp,empleado.CveDepto

from empleado
consulta 3 Obtener el nombre de los
empleados, la clave del departamento, para
cuando la clave del departamento sea diseño.
Sintaxis:

select NomEmp,empleado.CveDepto

from empleado,departamento

where
empleado.CveDepto=departamento.CveDepto and
NomDepto='Diseño'



consulta 4 Obtener los nombres de los
empleados y el nombre del proyecto en el que
participan
Sintaxis:

select NomEmp,proyecto.`Nombre del Proyecto`

from empleado,presupuesto,proyecto

where empleado.IdEmp=presupuesto.IdEmp and
presupuesto.Cveproy =proyecto.CveProy
consulta 5Obtener los nombres de los
empleados que pertenecen al departamento de
producción.
Sintaxis:

select empleado.NomEmp

from empleado,departamento

where empleado.CveDepto=departamento.CveDepto and
departamento.NomDepto= 'diseño'



consulta 6 Obtener los nombres de los
empleados y el nombre de los proyectos donde
participan los psicologos
Sintaxis:

select empleado.NomEmp,proyecto.`Nombre del
Proyecto`

from empleado,presupuesto,proyecto

where empleado.IdEmp=presupuesto.IdEmp and
presupuesto.Cveproy=proyecto.CveProy and
empleado.Perfil= 'psicologia'
CONSULTA 7 Obtener los nombres de los
empleados que pertenecen al departamento de
datos
Sintaxis:

Select empleado.NomEmp

from empleado,departamento

where empleado.CveDepto=departamento.CveDepto and
departamento.NomDepto='datos'


Consulta 08: Obtener los nombres de los empleados
que participan en los proyectos.

Sintaxis:

select NomEmp

from Empleado,presupuesto,proyecto

where
Empleado.IdEmp=Presupuesto.IdEmp and
presupuesto.cveProy=proyecto.cveProy


Consulta 09: Obtener los nombres de
los departamentos de los empleados
que participan en los proyectos.
Sintaxis
select NomDepto

from Empleado,Presupuesto, Departamento

where Departamento.Cvedepto=Empleado.cvedepto and
Empleado.IdEmp=presupuesto.IdEmp




Consulta 10: Obtener los nombres de los empleados
que pertenecen al depto. de desarrollo
Sintaxis:

select NomEmp

from
empleado,departamento

where Empleado.cvedepto=Departamento.cvedepto and
nomdepto='Desarrollo'




Consulta 11:Que Nombres de empleados participan en
el proyecto zada.
Sintaxis:

select NomEmp

from Empleado,Presupuesto,Proyecto
where Empleado.IdEmp=Presupuesto.IdEmp

and proyecto.cveproy=Presupuesto.cveproy

and proyecto.`Nombre del Proyecto`= 'Záda'




Consulta      12:Sumar    la    cantidad   de
participantes q pertenecen al proyecto PS035
Sintaxis:

select CantPart

From Proyecto,Presupuesto

Where Proyecto.CveProy=Presupuesto.CveProy and
Proyecto.CveProy ='PS035'

Consulta 13:Obtener el nombre del proyecto
en que participa López Bravo José Carlos
Sintaxis:

select `Nombre del Proyecto`

from proyecto,empleado,presupuesto

where proyecto.CveProy=presupuesto.Cveproy and
empleado.IdEmp=presupuesto.IdEmp and
empleado.NomEmp='López Bravo José Carlos'
Consulta 14:Obtener los nombres de los
departamentos que participan en el proyecto
PS555
Sintaxis:

select NomDepto

from empleado,presupuesto,proyecto,departamento

where departamento.CveDepto=empleado.CveDepto

and empleado.IdEmp=presupuesto.IdEmp

and presupuesto.Cveproy=proyecto.CveProy

and proyecto.CveProy="PS555"

Consulta 15:Ordenar de mayor a menor los
gastos de presupuesto por proyecto
Sintaxis:

select presupuesto.presup

from presupuesto

where presupuesto.presup <> "0"

order by- presupuesto.presup


Consulta 16:Ordenar los           nombres   de    los
empleados alfabéticamente
Sintaxis:
select NomEmp

from empleado

ORDER BY

empleado.NomEmp ASC


Consulta 17:Obtener que proyecto obtuvo el
mayor gasto.
Sintaxis:

select max(presup)

from presupuesto

Consulta 18: Obtener los nombres de los
empleados donde su apeido empiece con g
Sintaxis:

select NomEmp

from empleado

where empleado.NomEmp like "G%"



consulta 19 Obtener los nombres de los
empleados de aquel que tiene el apeido Gasca
Sintaxis:
select NomEmp

from empleado

where empleado.NomEmp like "Gasca%"




consulta 20 Obtener los nombres de los
empleados y el nombre de departamento
agrupados por departamento
Sintaxis:

select
departamento.NomDepto,empleado.NomEmp
from departamento,empleado

where
departamento.CveDepto=empleado.CveDepto
GROUP BY departamento.NomDepto
Consulta 21 Seleccionar la clave de los
proyectos que se les asigno un presupuesto de
40000
Sintaxis:

select CveProy

from presupuesto

where presupuesto.Presup ="40000"
consulta 22 Obtener que cable de proyecto se
asigno en el 2008
Sintaxis:

select proyecto.CveProy

from proyecto

where proyecto.`Fecha.Inicio` like '2008%'
Un pequeño hotel rural necesita una aplicación software que
le permita gestionar su negocio. Las primeras reuniones se
han resumido en un documento expresado en lenguaje
natural, que recoge a grandes rasgos la lógica de negocio del
sistema a construir. Las reservas se hacen por teléfono, y el
cliente debe dar su nombre, NIF, teléfono de contacto (siendo
posible dar hasta tres números de teléfono diferentes).
El hotel tiene tres plantas con habitaciones para los clientes.
Cada habitación tiene un número de habitación y pertenece a
un tipo de habitación (los tipos existentes son individual,
doble y matrimonio) Al abandonar el hotel se realizará una
factura asociada al responsable de la habitación, aunque
puede llevar otro nombre y otro NIF o CIF. La factura reflejará
todos los gastos asociados a la habitación o habitaciones
perfectamente desglosados en las líneas de la factura. Las
facturas no pueden borrarse, aunque si podrían modificarse
los gastos involucrados en caso de error.
                         Entidades
                      Cliente(Idcliente)
                      Habitacion(numH)
                       Reserva(NumR)
                      Temporada(codT)

                          Relacion:
                     Cliente – Habitacion
                              N:1
                      Cliente – Reservas
                              1:N
                    Reservas – Temporada
                              N:M
CodT



  Temporada
               Diagrama
                                                           NumH

          R1
          3


    Reservas      R2   Cliente              R3           Habitacion
                  3                         3



     NumR                           IdC




Diagrama final



  Cliente

                                 Reservas

                 IdC
     R4                                           NumR
                                    R4




Habitacion                       Factura                   Temporada
                  R4                             R4



NumH


                                                            CodT
Consulta 1 Obtener los nombres de           los
clientes y en las habitaciones que ocupan
Sintaxis:

select NomC,NumH

from cliente




consulta 2 obtener los datos de los clientes
Sintaxis:

select *

from cliente
Consulta 3 Obtener los IdC de los clientes
con los nombres de los clientes
Sintaxis:

SELECT IdC,NomC

from cliente




Consulta 4 Obtener los datos de facturas
Sintaxis:

select *

from factura
consulta 5 obtener el nombre del cliente y el
tipo de habitaciòn que ocupan
Sintaxis:

select
cliente.NomC,habitacion.TipoH

from cliente,habitacion

where
habitacion.NumH=cliente.NumH

consulta 6 obtener el nombre del cliente y el
tipo de habitación que ocupa laHabitacion
num= “H008”
Sintaxis:

select cliente.NomC,habitacion.TipoH

from cliente,habitacion

where habitacion.NumH=cliente.NumH and
habitacion.NumH='H008'
consulta 7 obtener la descripción y el nombre
del cliente, del código de la temporada=
“CD08”
Sintaxis:

select cliente.NomC,temporada.Descri

from temporada,factura,cliente

where temporada.CodT=factura.CodT and
factura.IdC=cliente.IdC and temporada.CodT='CD08'




consulta 8 ordenar de mayor a menor los
costos de habitación
Sintaxis:

select habitacion.Costo

from habitacion

where habitacion.Costo<> "0"

order by- habitacion.Costo
Consulta 9 Obtener la fecha inicial y final de
temporada del cliente =Pescador Espitia
Esperanza
Sintaxis:

select temporada.FechaI,temporada.FechaF

from temporada,factura,cliente

where temporada.CodT=factura.CodT and
factura.IdC=cliente.IdC and cliente.NomC='Pescador
Espitia Esperanza'




Consulta 10 Obtener los Id de los clientes y
los códigos de temporada y los números de
habitaciones
Sintaxis:

select cliente.IdC,temporada.CodT,cliente.NumH

from
cliente,factura,temporada

where
cliente.IdC=factura.IdC and
factura.CodT=temporada.CodT
Consulta 11 Ordenar los nombres de los
clientes alfabéticamente
Sintaxis:

select NomC
from cliente
order by cliente.NomC


Consulta 12 Obtener los menores costos de
habitación
Sintaxis:

select min(costo)

from habitacion



consulta 13 obtener los mayores costos de
habitacion
Sintaxis:

select max(costo)

from habitacion
Consulta 14 Obtener los numeros                  de
habitaciones que son matrimoniales.
Sintaxis:

select habitacion.NumH

from habitacion,factura

where
habitacion.NumH=factura.NumH and
habitacion.TipoH='matrimonial'



consulta 15 Obtener los            numeros       de
habitaciones que son dobles
Sintaxis:

select habitacion.NumH

from habitacion,factura

where habitacion.NumH=factura.NumH and
habitacion.TipoH='doble'

consulta 16 obtener el             codigo   de   la
temporada y la descripcion
Sintaxis:

Select
temporada.cogT,temporada.desc
From temporada

Consulta 17 Obtener los datos de reservas
Sintaxis:

select *

from reservas




Consulta 18 Obtener el estado, fecha de inicio
de la habitacion H008
Sintaxis:

select reservas.Estado,temporada.FechaI

from reservas,factura,temporada

where reservas.NumR=factura.NumR and
factura.CodT=temporada.CodT and
reservas.NomH='H008'
consulta 19 Obtener el numeros de facturas y
los nombres de los clientes.
Sintaxis:

select NumF,NomC

from factura




consulta20 Obtener el numeros de reserva, el
estado y la descripción.
Sintaxis:

select
reservas.NumR,reservas.Estado,temporada.`Desc`

from reservas,factura,temporada
where reservas.NumR=factura.NumR and
factura.CodT=temporada.CodT
La universidad Pedagógica nacional, que tiene varias
facultades como electricidad, psicología, turismo y derecho y
docentes que son muy eficaces para el manejo y conducción
de los alumnos, existen cursos como física literatura entre
otros. Dando evaluaciones parciales a los alumnos de los
cursos que han estado asistiendo con sus docentes
respectivamente.
                         Entidades:
                     Alumno(matricula)
                      Facultad(CveFalc)
                        Docente(RFC)
                      Curso(No.Curso)
                         Relaciones:
                      Alumno – Curso
                             N:M
                     Alumno – Facultad
                             N:1
                      Curso – Docente
                             N:M
Diagrama INICIAL
Matricula                    ALUNMO                         CURSO
                                                  R1
                                                  3

                                                                  R3
                                 R2             No.Curso          3
                                 3
                                                                DOCENTE

                             FACULTAD



                                                                       RFC
                                 CveFalc




    Diagrama final                                                       No.Curso




                  ALUNMO                                                  CURSO
                                           R2   EVA.P      R2
                                           3               3



                       R2
                       3                                                       R3
Matricula                                                                      3



                      FACULTAD                                                DOCENTE




                                                                        RFC
            CveFalc
consulta      01   Obtener   los    datos      de   los
alumnos:
Sintaxis:

select *

from alumno




consulta 02: Obtener la            matricula    y   las
claves de facultad:
Sintaxis:

select
alumno.Matri,evaluacion.CveFac

from alumno,evaluacion,facultad

where
alumno.Matri=evaluacion.Matri and
evaluacion.CveFac=facultad.CveFac
consulta3 obtener la matricula y el nombre
la facultad:
Sintaxis:

select
alumno.NomA,facultad.NomFac

from alumno,evaluacion,facultad

where
alumno.Matri=evaluacion.Matri and
evaluacion.CveFac=facultad.CveFac




consulta 04obtener la matricula y el nombre
de la facultad
Sintaxis:

select matri,nomFacu

from alumno




consulta 05 obtener el nombre del alumno, la
clave de la facultad y el nombre de la
facultad.
Sintaxis:
select alumno.NomA,facultad.CveFac,facultad.NomFac

from alumno,evaluacion,facultad

where alumno.Matri=evaluacion.Matri and
evaluacion.CveFac=facultad.CveFac




consulta 06 obtener los números de curso y
materias.
Sintaxis:

select curso.NomCurso,curso.NumCurso
from curso


consulta 07 obtener los RFC y los
nombres de los profesores.
Sintaxis:
select docente.Rfc,docente.NomDoc
from docente


consulta 08 obtener el RFC y el numero de
cursos que imparten.
Sintaxis:

select docente.Rfc,docente.Numcurso
from docente




consulta 09 obtener el nombre de la materia
del numero de curso C001
Sintaxis:

select curso.NomCurso
from curso
where curso.NumCurso like 'C001%'


consulta 10 obtener las calificaciones de
todos los alumnos del curso C001
Sintaxis:

select evaluacion.C001
from evaluación




consulta 11 ordenar de mayor a menor las
calificaciones del nombre del curso de física
Sintaxis:

select evaluacion.C001
from evaluacion
where evaluacion.C001<> "0"
order by- evaluacion.C001


consulta 12 obtener los nombres de los
alumnos que están en la facultad de derechos
Sintaxis:

select alumno.NomA
from alumno
where alumno.NomFacu="derecho"
consulta 13 obtener los nombres de los
alumnos que pertenecen a turismo
Sintaxis:

select alumno.NomA
from alumno
where alumno.NomFacu="turismo"
consulta 14 obtener la calificación de
fisiología y el nombre del alumno, con la
matricula A004
Sintaxis:

select evaluacion.C005,alumno.NomA
from alumno,evaluacion
where alumno.Matri=evaluacion.Matri and
alumno.Matri="A004"




consulta 15 obtener la calificación de fisica y
el nombre del alumno, con la matricula A018
Sintaxis:

select evaluacion.C001,alumno.NomA
from alumno,evaluacion
where alumno.Matri=evaluacion.Matri and
alumno.Matri="A016"




consulta 16 obtener los datos de
evaluación
Sintaxis:

select *

from evaluación
consulta 17 ordenar de mayor a
menor los promedios
Sintaxis:

select evaluacion.Promedio

from evaluacion

where evaluacion.Promedio<> "0"

order by- evaluacion.Promedio



consulta 18 obtener el mayor promedio
Sintaxis:

select max(promedio)
from evaluación
consulta 19 obtener el minimo promedio
Sintaxis:

select min(promedio)
from evaluación
consulta 20 obtenre el RFC del docente
Sintaxis:

select docente.Rfc
from docente
consulta 21 obtener los nombres de los
maestros con los curso que imparten
Sintaxis:

select docente.NomDoc,curso.NomCurso
from docente,curso
where docente.Rfc=curso.Rfc

More Related Content

Featured

Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsPixeldarts
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthThinkNow
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfmarketingartwork
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summarySpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Applitools
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at WorkGetSmarter
 

Featured (20)

Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
 

Consultas finales

  • 1. Nombre de las Alumnas: María Cristina Martínez Arriaga. Emma Herrera Elías. Trabajo: Consultas en Navicat Nombre de la Profesora: Esperanza Pescador Espitia. Grado y Grupo: 4°C
  • 2. Se encarga de desarrollar proyectos diferentes en el cual participan diferentes departamentos. En cada proyecto participan varias personas y el proyecto tiene un líder en el cual hacen un presupuesto para el proyecto. Entidades: Proyecto(CveProy) Empleado(IdEmp) Departamento(CveDepto) Relaciones: Empleado – Departamento N:1 Empleado - Proyecto N:M
  • 3. Diagrama Cveproy PROYECTO R1 Cvedepto EMPLEADO DEPARTAMENTO R1 R1 Idemp
  • 4. Diagrama final PROYECTO R1 PRESUPUESTO R2 Cveproy Idemp EMPLEADO R4 DEPARTAMENTO R 3 LIDER Cvedepto
  • 5. Consulta 1: Obtener los datos de los clientes Sintaxis: select * from empleado consulta 2: Obtener los nombres de los empleados y claves de los departamentos. Sintaxis: select NomEmp,empleado.CveDepto from empleado
  • 6. consulta 3 Obtener el nombre de los empleados, la clave del departamento, para cuando la clave del departamento sea diseño. Sintaxis: select NomEmp,empleado.CveDepto from empleado,departamento where empleado.CveDepto=departamento.CveDepto and NomDepto='Diseño' consulta 4 Obtener los nombres de los empleados y el nombre del proyecto en el que participan Sintaxis: select NomEmp,proyecto.`Nombre del Proyecto` from empleado,presupuesto,proyecto where empleado.IdEmp=presupuesto.IdEmp and presupuesto.Cveproy =proyecto.CveProy
  • 7. consulta 5Obtener los nombres de los empleados que pertenecen al departamento de producción. Sintaxis: select empleado.NomEmp from empleado,departamento where empleado.CveDepto=departamento.CveDepto and departamento.NomDepto= 'diseño' consulta 6 Obtener los nombres de los empleados y el nombre de los proyectos donde participan los psicologos Sintaxis: select empleado.NomEmp,proyecto.`Nombre del Proyecto` from empleado,presupuesto,proyecto where empleado.IdEmp=presupuesto.IdEmp and presupuesto.Cveproy=proyecto.CveProy and empleado.Perfil= 'psicologia'
  • 8. CONSULTA 7 Obtener los nombres de los empleados que pertenecen al departamento de datos Sintaxis: Select empleado.NomEmp from empleado,departamento where empleado.CveDepto=departamento.CveDepto and departamento.NomDepto='datos' Consulta 08: Obtener los nombres de los empleados que participan en los proyectos. Sintaxis: select NomEmp from Empleado,presupuesto,proyecto where Empleado.IdEmp=Presupuesto.IdEmp and presupuesto.cveProy=proyecto.cveProy Consulta 09: Obtener los nombres de los departamentos de los empleados que participan en los proyectos.
  • 9. Sintaxis select NomDepto from Empleado,Presupuesto, Departamento where Departamento.Cvedepto=Empleado.cvedepto and Empleado.IdEmp=presupuesto.IdEmp Consulta 10: Obtener los nombres de los empleados que pertenecen al depto. de desarrollo Sintaxis: select NomEmp from empleado,departamento where Empleado.cvedepto=Departamento.cvedepto and nomdepto='Desarrollo' Consulta 11:Que Nombres de empleados participan en el proyecto zada. Sintaxis: select NomEmp from Empleado,Presupuesto,Proyecto
  • 10. where Empleado.IdEmp=Presupuesto.IdEmp and proyecto.cveproy=Presupuesto.cveproy and proyecto.`Nombre del Proyecto`= 'Záda' Consulta 12:Sumar la cantidad de participantes q pertenecen al proyecto PS035 Sintaxis: select CantPart From Proyecto,Presupuesto Where Proyecto.CveProy=Presupuesto.CveProy and Proyecto.CveProy ='PS035' Consulta 13:Obtener el nombre del proyecto en que participa López Bravo José Carlos Sintaxis: select `Nombre del Proyecto` from proyecto,empleado,presupuesto where proyecto.CveProy=presupuesto.Cveproy and empleado.IdEmp=presupuesto.IdEmp and empleado.NomEmp='López Bravo José Carlos'
  • 11. Consulta 14:Obtener los nombres de los departamentos que participan en el proyecto PS555 Sintaxis: select NomDepto from empleado,presupuesto,proyecto,departamento where departamento.CveDepto=empleado.CveDepto and empleado.IdEmp=presupuesto.IdEmp and presupuesto.Cveproy=proyecto.CveProy and proyecto.CveProy="PS555" Consulta 15:Ordenar de mayor a menor los gastos de presupuesto por proyecto Sintaxis: select presupuesto.presup from presupuesto where presupuesto.presup <> "0" order by- presupuesto.presup Consulta 16:Ordenar los nombres de los empleados alfabéticamente Sintaxis:
  • 12. select NomEmp from empleado ORDER BY empleado.NomEmp ASC Consulta 17:Obtener que proyecto obtuvo el mayor gasto. Sintaxis: select max(presup) from presupuesto Consulta 18: Obtener los nombres de los empleados donde su apeido empiece con g Sintaxis: select NomEmp from empleado where empleado.NomEmp like "G%" consulta 19 Obtener los nombres de los empleados de aquel que tiene el apeido Gasca Sintaxis:
  • 13. select NomEmp from empleado where empleado.NomEmp like "Gasca%" consulta 20 Obtener los nombres de los empleados y el nombre de departamento agrupados por departamento Sintaxis: select departamento.NomDepto,empleado.NomEmp from departamento,empleado where departamento.CveDepto=empleado.CveDepto GROUP BY departamento.NomDepto
  • 14. Consulta 21 Seleccionar la clave de los proyectos que se les asigno un presupuesto de 40000 Sintaxis: select CveProy from presupuesto where presupuesto.Presup ="40000" consulta 22 Obtener que cable de proyecto se asigno en el 2008 Sintaxis: select proyecto.CveProy from proyecto where proyecto.`Fecha.Inicio` like '2008%'
  • 15. Un pequeño hotel rural necesita una aplicación software que le permita gestionar su negocio. Las primeras reuniones se han resumido en un documento expresado en lenguaje natural, que recoge a grandes rasgos la lógica de negocio del sistema a construir. Las reservas se hacen por teléfono, y el cliente debe dar su nombre, NIF, teléfono de contacto (siendo posible dar hasta tres números de teléfono diferentes). El hotel tiene tres plantas con habitaciones para los clientes. Cada habitación tiene un número de habitación y pertenece a un tipo de habitación (los tipos existentes son individual, doble y matrimonio) Al abandonar el hotel se realizará una factura asociada al responsable de la habitación, aunque puede llevar otro nombre y otro NIF o CIF. La factura reflejará todos los gastos asociados a la habitación o habitaciones perfectamente desglosados en las líneas de la factura. Las facturas no pueden borrarse, aunque si podrían modificarse los gastos involucrados en caso de error. Entidades Cliente(Idcliente) Habitacion(numH) Reserva(NumR) Temporada(codT) Relacion: Cliente – Habitacion N:1 Cliente – Reservas 1:N Reservas – Temporada N:M
  • 16. CodT Temporada Diagrama NumH R1 3 Reservas R2 Cliente R3 Habitacion 3 3 NumR IdC Diagrama final Cliente Reservas IdC R4 NumR R4 Habitacion Factura Temporada R4 R4 NumH CodT
  • 17. Consulta 1 Obtener los nombres de los clientes y en las habitaciones que ocupan Sintaxis: select NomC,NumH from cliente consulta 2 obtener los datos de los clientes Sintaxis: select * from cliente
  • 18. Consulta 3 Obtener los IdC de los clientes con los nombres de los clientes Sintaxis: SELECT IdC,NomC from cliente Consulta 4 Obtener los datos de facturas Sintaxis: select * from factura
  • 19. consulta 5 obtener el nombre del cliente y el tipo de habitaciòn que ocupan Sintaxis: select cliente.NomC,habitacion.TipoH from cliente,habitacion where habitacion.NumH=cliente.NumH consulta 6 obtener el nombre del cliente y el tipo de habitación que ocupa laHabitacion num= “H008” Sintaxis: select cliente.NomC,habitacion.TipoH from cliente,habitacion where habitacion.NumH=cliente.NumH and habitacion.NumH='H008'
  • 20. consulta 7 obtener la descripción y el nombre del cliente, del código de la temporada= “CD08” Sintaxis: select cliente.NomC,temporada.Descri from temporada,factura,cliente where temporada.CodT=factura.CodT and factura.IdC=cliente.IdC and temporada.CodT='CD08' consulta 8 ordenar de mayor a menor los costos de habitación Sintaxis: select habitacion.Costo from habitacion where habitacion.Costo<> "0" order by- habitacion.Costo
  • 21. Consulta 9 Obtener la fecha inicial y final de temporada del cliente =Pescador Espitia Esperanza Sintaxis: select temporada.FechaI,temporada.FechaF from temporada,factura,cliente where temporada.CodT=factura.CodT and factura.IdC=cliente.IdC and cliente.NomC='Pescador Espitia Esperanza' Consulta 10 Obtener los Id de los clientes y los códigos de temporada y los números de habitaciones Sintaxis: select cliente.IdC,temporada.CodT,cliente.NumH from cliente,factura,temporada where cliente.IdC=factura.IdC and factura.CodT=temporada.CodT
  • 22. Consulta 11 Ordenar los nombres de los clientes alfabéticamente Sintaxis: select NomC from cliente order by cliente.NomC Consulta 12 Obtener los menores costos de habitación Sintaxis: select min(costo) from habitacion consulta 13 obtener los mayores costos de habitacion Sintaxis: select max(costo) from habitacion
  • 23. Consulta 14 Obtener los numeros de habitaciones que son matrimoniales. Sintaxis: select habitacion.NumH from habitacion,factura where habitacion.NumH=factura.NumH and habitacion.TipoH='matrimonial' consulta 15 Obtener los numeros de habitaciones que son dobles Sintaxis: select habitacion.NumH from habitacion,factura where habitacion.NumH=factura.NumH and habitacion.TipoH='doble' consulta 16 obtener el codigo de la temporada y la descripcion Sintaxis: Select temporada.cogT,temporada.desc
  • 24. From temporada Consulta 17 Obtener los datos de reservas Sintaxis: select * from reservas Consulta 18 Obtener el estado, fecha de inicio de la habitacion H008 Sintaxis: select reservas.Estado,temporada.FechaI from reservas,factura,temporada where reservas.NumR=factura.NumR and factura.CodT=temporada.CodT and reservas.NomH='H008'
  • 25. consulta 19 Obtener el numeros de facturas y los nombres de los clientes. Sintaxis: select NumF,NomC from factura consulta20 Obtener el numeros de reserva, el estado y la descripción. Sintaxis: select reservas.NumR,reservas.Estado,temporada.`Desc` from reservas,factura,temporada
  • 27. La universidad Pedagógica nacional, que tiene varias facultades como electricidad, psicología, turismo y derecho y docentes que son muy eficaces para el manejo y conducción de los alumnos, existen cursos como física literatura entre otros. Dando evaluaciones parciales a los alumnos de los cursos que han estado asistiendo con sus docentes respectivamente. Entidades: Alumno(matricula) Facultad(CveFalc) Docente(RFC) Curso(No.Curso) Relaciones: Alumno – Curso N:M Alumno – Facultad N:1 Curso – Docente N:M
  • 28. Diagrama INICIAL Matricula ALUNMO CURSO R1 3 R3 R2 No.Curso 3 3 DOCENTE FACULTAD RFC CveFalc Diagrama final No.Curso ALUNMO CURSO R2 EVA.P R2 3 3 R2 3 R3 Matricula 3 FACULTAD DOCENTE RFC CveFalc
  • 29. consulta 01 Obtener los datos de los alumnos: Sintaxis: select * from alumno consulta 02: Obtener la matricula y las claves de facultad: Sintaxis: select alumno.Matri,evaluacion.CveFac from alumno,evaluacion,facultad where alumno.Matri=evaluacion.Matri and evaluacion.CveFac=facultad.CveFac
  • 30. consulta3 obtener la matricula y el nombre la facultad: Sintaxis: select alumno.NomA,facultad.NomFac from alumno,evaluacion,facultad where alumno.Matri=evaluacion.Matri and evaluacion.CveFac=facultad.CveFac consulta 04obtener la matricula y el nombre de la facultad Sintaxis: select matri,nomFacu from alumno consulta 05 obtener el nombre del alumno, la clave de la facultad y el nombre de la facultad. Sintaxis:
  • 31. select alumno.NomA,facultad.CveFac,facultad.NomFac from alumno,evaluacion,facultad where alumno.Matri=evaluacion.Matri and evaluacion.CveFac=facultad.CveFac consulta 06 obtener los números de curso y materias. Sintaxis: select curso.NomCurso,curso.NumCurso from curso consulta 07 obtener los RFC y los nombres de los profesores. Sintaxis:
  • 32. select docente.Rfc,docente.NomDoc from docente consulta 08 obtener el RFC y el numero de cursos que imparten. Sintaxis: select docente.Rfc,docente.Numcurso from docente consulta 09 obtener el nombre de la materia del numero de curso C001 Sintaxis: select curso.NomCurso from curso where curso.NumCurso like 'C001%' consulta 10 obtener las calificaciones de todos los alumnos del curso C001 Sintaxis: select evaluacion.C001
  • 33. from evaluación consulta 11 ordenar de mayor a menor las calificaciones del nombre del curso de física Sintaxis: select evaluacion.C001 from evaluacion where evaluacion.C001<> "0" order by- evaluacion.C001 consulta 12 obtener los nombres de los alumnos que están en la facultad de derechos Sintaxis: select alumno.NomA from alumno where alumno.NomFacu="derecho"
  • 34. consulta 13 obtener los nombres de los alumnos que pertenecen a turismo Sintaxis: select alumno.NomA from alumno where alumno.NomFacu="turismo" consulta 14 obtener la calificación de fisiología y el nombre del alumno, con la matricula A004 Sintaxis: select evaluacion.C005,alumno.NomA from alumno,evaluacion where alumno.Matri=evaluacion.Matri and alumno.Matri="A004" consulta 15 obtener la calificación de fisica y el nombre del alumno, con la matricula A018 Sintaxis: select evaluacion.C001,alumno.NomA from alumno,evaluacion
  • 35. where alumno.Matri=evaluacion.Matri and alumno.Matri="A016" consulta 16 obtener los datos de evaluación Sintaxis: select * from evaluación
  • 36. consulta 17 ordenar de mayor a menor los promedios Sintaxis: select evaluacion.Promedio from evaluacion where evaluacion.Promedio<> "0" order by- evaluacion.Promedio consulta 18 obtener el mayor promedio Sintaxis: select max(promedio) from evaluación consulta 19 obtener el minimo promedio Sintaxis: select min(promedio) from evaluación consulta 20 obtenre el RFC del docente Sintaxis: select docente.Rfc from docente
  • 37. consulta 21 obtener los nombres de los maestros con los curso que imparten Sintaxis: select docente.NomDoc,curso.NomCurso from docente,curso where docente.Rfc=curso.Rfc