SlideShare una empresa de Scribd logo
1 de 10
SEP        DGEST


  INSTITUTO TECNOLOGICO DE
                  TUXTEPEC



                    MATERIA:

      Fundamentos de bases de datos

                     TEMA
Operaciones básicas utilizadas en álgebra relacional

PRESENTA:

              Sánchez Valdez Jesús z.

                 CATEDRÁTICO:

     Mcc. Maria Luisa Acosta Sanjuan

                      AREA:

                ING. INFORMATICA



TUXTEPEC, OAX., A 06 de Diciembre del 2012
Índice
Índice ........................................................................... 2
Introducción ................................................................. 3
Conjunto de operaciones en relaciones ....................... 4
Proyección ................................................................... 5
Selección ..................................................................... 6
Producto cartesiano (x) ................................................ 7
Unión (∪) ..................................................................... 8
Conclusiones ............................................................... 9
Fuentes consultadas............................................................................................... 10
Introducción
El Algebra relacional es un lenguaje de consulta procedural. Consta de un
conjunto de operaciones que toman como entrada una o dos relaciones y
producen como resultado una nueva relación, por lo tanto, es posible anidar y
combinar operadores.

El álgebra relacional consiste de algunas simples pero poderosas maneras de
construir nuevas relaciones a partir de otras. Si pensamos que las relaciones
iniciales son los datos almacenados entonces las nuevas relaciones se pueden ver
como respuestas a algunas consultas deseadas.
Conjunto de operaciones en relaciones
        R S, la unión de R y S es el conjunto de elementos que están en R o S o
        ambos. Un elemento solo aparece una sola vez.
        R S, el conjunto de elementos que aparecen en ambos R y S
        R - S, la diferencia de R y S, el conjunto de elementos que estan en R pero
        no en S. Es importante resaltar que R - S es diferente a S - R.
        R / S, la división de una relación entre otra, debe cumplirse que para toda
        tupla en R exista su correspondiente en S.

Restricciones:

   1. R y S deben tener esquemas idénticos.
   2. El orden de las columnas debe ser el mismo

Ejemplos:

            name             address             gender     birthdate
            Carrie Fisher    123 Maple St.       F          9/9/99
            Mark Hamill      456 OakRd.          M          8/8/88




            name              address            gender     birthdate
            Harrison Ford     789 Palm Dr.       M          7/7/77
            Carrie Fisher     123 Maple St.      F          9/9/99

Unión

            name              address            gender     birthdate
            Harrison Ford     789 Palm Dr.       M          7/7/77
            Mark Hamill       456 OakRd.         M          8/8/88
            Carrie Fisher     123 Maple St.      F          9/9/99

Intersección

            name             address             gender     birthdate
            Carrie Fisher    123 Maple St.       F          9/9/99

Resta

            name             address           gender      birthdate
            Mark Hamill      456 OakRd.        M           8/8/88
Proyección
      Crea una nueva relación a partir de otra, pero incluyendo sólo algunas de
      las columnas
        A1,A3,A6 (R)



                title        year length     filmType    studioName
             StarWars        1977   124         color        Fox
            MightyDucks      1991   104         color       Disney
            Wayne'sWorld     1992   95          color     Paramount

                                     Movie

Ejemplo:

  title,year,length(Movie)

                        title                 year          length
                     StarWars                 1977            124
                    MightyDucks               1991            104
                    Wayne'sWorld              1992             95

  filmType(Movie)

                                   filmType
                                      color
Selección
      Crea una nueva relación a partir de otra, pero incluyendo sólo algunas de
      las tuplas a partir de un criterio dado.
      El criterio se basa en restricciones sobre los atributos de la relación R y no
      pueden incluirse otras relaciones en dicho criterio que no esten en R
        A3>16 (R) , A3>16 and A3 < 45 (R), nombre='Carlos' and edad=45
      (R)

                title         year length        filmType   studioName
             StarWars         1977   124            color       Fox
            MightyDucks       1991   104            color      Disney
            Wayne'sWorld      1992   95             color    Paramount

                                         Movie

Ejemplos:

  length>=100 (Movie)

                title        year length         filmType   studioName
             StarWars        1977   124             color       Fox
            MightyDucks      1991   104             color      Disney

  length>=100 and studioName='Fox' (Movie)

              title       year      length   filmType       studioName
            StarWars      1977        124       color           Fox




  title,studioName(     length>=100 (Movie))

                          title                      studioName
                       StarWars                          Fox
                      MightyDucks                       Disney
Producto cartesiano (x)
El producto cartesiano de dos relaciones se escribe como:



y entrega una relación, cuyo esquema corresponde a una combinación de todas
las tuplas de R con cada una de las tuplas de S, y sus atributos corresponden a
los de R seguidos por los de S.

Ejemplo:



Muestra una nueva relación, cuyo esquema contiene cada una de las tuplas de la
relación Alumnos junto con las tuplas de la relación Maestros, mostrando primero
los atributos de la relación Alumnos seguidos por las tuplas de la relación
Maestros.
Unión (∪)
La operación



retorna el conjunto de tuplas que están en R, o en S, o en ambas. R y S deben ser
uniones compatibles.

Diferencia (-)

La diferencia de dos relaciones, R y S denotada por:



entrega todas aquellas tuplas que están en R, pero no en S. R y S deben ser
uniones compatibles.


Estas operaciones son fundamentales en el sentido en que (1) todas las demás
operaciones pueden ser expresadas como una combinación de éstas y (2)
ninguna de estas operaciones pueden ser omitidas sin que con ello se pierda
información.
Conclusiones
El álgebra relacional es un conjunto de operaciones que describen paso a paso
como computar una respuesta sobre las relaciones, en las bases de datos ayudan
más que nada para manipular las relaciones entre tablas , lo que hace de estas
herramientas efectivas para la gestión de las tablas.
Fuentes consultadas
http://es.wikipedia.org/wiki/%C3%81lgebra_relacional#B.C3.A1sicas

http://ict.udlap.mx/people/carlos/is341/bases04.html

http://basdatos.tripod.com/algebra.html

Más contenido relacionado

Destacado

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by HubspotMarius Sescu
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTExpeed Software
 
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
 

Destacado (20)

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
 
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...
 

Operaciones básicas en álgebra relacional

  • 1. SEP DGEST INSTITUTO TECNOLOGICO DE TUXTEPEC MATERIA: Fundamentos de bases de datos TEMA Operaciones básicas utilizadas en álgebra relacional PRESENTA: Sánchez Valdez Jesús z. CATEDRÁTICO: Mcc. Maria Luisa Acosta Sanjuan AREA: ING. INFORMATICA TUXTEPEC, OAX., A 06 de Diciembre del 2012
  • 2. Índice Índice ........................................................................... 2 Introducción ................................................................. 3 Conjunto de operaciones en relaciones ....................... 4 Proyección ................................................................... 5 Selección ..................................................................... 6 Producto cartesiano (x) ................................................ 7 Unión (∪) ..................................................................... 8 Conclusiones ............................................................... 9 Fuentes consultadas............................................................................................... 10
  • 3. Introducción El Algebra relacional es un lenguaje de consulta procedural. Consta de un conjunto de operaciones que toman como entrada una o dos relaciones y producen como resultado una nueva relación, por lo tanto, es posible anidar y combinar operadores. El álgebra relacional consiste de algunas simples pero poderosas maneras de construir nuevas relaciones a partir de otras. Si pensamos que las relaciones iniciales son los datos almacenados entonces las nuevas relaciones se pueden ver como respuestas a algunas consultas deseadas.
  • 4. Conjunto de operaciones en relaciones R S, la unión de R y S es el conjunto de elementos que están en R o S o ambos. Un elemento solo aparece una sola vez. R S, el conjunto de elementos que aparecen en ambos R y S R - S, la diferencia de R y S, el conjunto de elementos que estan en R pero no en S. Es importante resaltar que R - S es diferente a S - R. R / S, la división de una relación entre otra, debe cumplirse que para toda tupla en R exista su correspondiente en S. Restricciones: 1. R y S deben tener esquemas idénticos. 2. El orden de las columnas debe ser el mismo Ejemplos: name address gender birthdate Carrie Fisher 123 Maple St. F 9/9/99 Mark Hamill 456 OakRd. M 8/8/88 name address gender birthdate Harrison Ford 789 Palm Dr. M 7/7/77 Carrie Fisher 123 Maple St. F 9/9/99 Unión name address gender birthdate Harrison Ford 789 Palm Dr. M 7/7/77 Mark Hamill 456 OakRd. M 8/8/88 Carrie Fisher 123 Maple St. F 9/9/99 Intersección name address gender birthdate Carrie Fisher 123 Maple St. F 9/9/99 Resta name address gender birthdate Mark Hamill 456 OakRd. M 8/8/88
  • 5. Proyección Crea una nueva relación a partir de otra, pero incluyendo sólo algunas de las columnas A1,A3,A6 (R) title year length filmType studioName StarWars 1977 124 color Fox MightyDucks 1991 104 color Disney Wayne'sWorld 1992 95 color Paramount Movie Ejemplo: title,year,length(Movie) title year length StarWars 1977 124 MightyDucks 1991 104 Wayne'sWorld 1992 95 filmType(Movie) filmType color
  • 6. Selección Crea una nueva relación a partir de otra, pero incluyendo sólo algunas de las tuplas a partir de un criterio dado. El criterio se basa en restricciones sobre los atributos de la relación R y no pueden incluirse otras relaciones en dicho criterio que no esten en R A3>16 (R) , A3>16 and A3 < 45 (R), nombre='Carlos' and edad=45 (R) title year length filmType studioName StarWars 1977 124 color Fox MightyDucks 1991 104 color Disney Wayne'sWorld 1992 95 color Paramount Movie Ejemplos: length>=100 (Movie) title year length filmType studioName StarWars 1977 124 color Fox MightyDucks 1991 104 color Disney length>=100 and studioName='Fox' (Movie) title year length filmType studioName StarWars 1977 124 color Fox title,studioName( length>=100 (Movie)) title studioName StarWars Fox MightyDucks Disney
  • 7. Producto cartesiano (x) El producto cartesiano de dos relaciones se escribe como: y entrega una relación, cuyo esquema corresponde a una combinación de todas las tuplas de R con cada una de las tuplas de S, y sus atributos corresponden a los de R seguidos por los de S. Ejemplo: Muestra una nueva relación, cuyo esquema contiene cada una de las tuplas de la relación Alumnos junto con las tuplas de la relación Maestros, mostrando primero los atributos de la relación Alumnos seguidos por las tuplas de la relación Maestros.
  • 8. Unión (∪) La operación retorna el conjunto de tuplas que están en R, o en S, o en ambas. R y S deben ser uniones compatibles. Diferencia (-) La diferencia de dos relaciones, R y S denotada por: entrega todas aquellas tuplas que están en R, pero no en S. R y S deben ser uniones compatibles. Estas operaciones son fundamentales en el sentido en que (1) todas las demás operaciones pueden ser expresadas como una combinación de éstas y (2) ninguna de estas operaciones pueden ser omitidas sin que con ello se pierda información.
  • 9. Conclusiones El álgebra relacional es un conjunto de operaciones que describen paso a paso como computar una respuesta sobre las relaciones, en las bases de datos ayudan más que nada para manipular las relaciones entre tablas , lo que hace de estas herramientas efectivas para la gestión de las tablas.