SlideShare uma empresa Scribd logo
1 de 19
Nocions   bàsiques... Rosa Surís exercici per a l’assignatura “Didàctica de la Informàtica” professora: Mªdel Mar Lluelles CAP 2007 BASES DE DADES RELACIONALS
Què és una Base de Dades? ,[object Object],[object Object],[object Object],[object Object]
Objectiu d’una Base de Dades? ,[object Object]
Per què de l’automatització de les BASES de DADES? ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Altres avantatges de l’automatització de les bases de dades... ,[object Object],[object Object],[object Object],[object Object]
Model Relacional: per què? ,[object Object],[object Object]
1ªpas: observem i decidim quines dades volem enregistrar... ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
2 on  pas: traduïm això en un fitxer que podem gravar al ordinador...
Amb això ho tenim tot solventat? ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
...passem a enregistrar nous amic: Joan Prats 609654321 les   afores ...doncs resulta que si aquest no te cap cotxe, estem desaprofitant  un munt d’espai en blanc quan donem d’alta més registres.... si resulta que coincideixen els mateixos cotxes....  ...estem repetint les mateixes dades a cada registre
al acabar tenim les següents dades... un altre problema...què fem si algú té més d’un cotxe? on ho apuntem això??? nom cognom telfn adreça marca model caract matric color Josep Garcia 679123456 c/pi 10 Ford c-max vel.màx. 175kms/h d0a100: 12’9seg. 1111 ABC groc Joel Prats 609654321 les afores Josep Pons 676159357 c/petit 1 Seat Ibiza   Cupra vel.màx. 220kms/h d0a100: 7’6seg. 1234 ABC vermell Judith Segura 646147963 c/ del mar 5 Ford c-max vel.màx. 175kms/h d0a100: 12’9seg. 2222 BCI negre Anna Torres 679148368 c/ centre 1 Marc Soler 679321123 c/Urgell 3 Citroën C4 vel.màx. 192kms/h d0a100: 11’2seg. 4444 CSI vermell
...passem ara a modificar algunes dades dels cotxes que tenim arxivats ... ...i resulta que no ens en recordem de  canviar de igual manera totes les que són el mateix!!! LA INTEGRITAT QUEDA MALMESA!!! nom cognom telfn adreça marca model caract matric color Josep Garcia 679123456 c/pi 10 Ford c-max vel.màx. 175kms/h d0a100: 12’9seg. 1111 ABC groc Joel Prats 609654321 les afores Josep Pons 676159357 c/petit 1 Seat Ibiza   Cupra vel.màx. 220kms/h d0a100: 7’6seg. 1234 ABC vermell Judith Segura 646147963 c/ del mar 5 Ford c-max vel.màx. 85 kms/h d0a100:  120 ’9seg. 2222 BCI negre Anna Torres 679148368 c/ centre 1 Marc Soler 679321123 c/Urgell 3 Citroën C4 vel.màx. 192kms/h d0a100: 11’2seg. 4444 CSI vermell
i si finalment eliminem ara registres de amics ... ... ALESHORES RESULTA QUE PODEM PERDRE DADES DE VEHICLES QUE JA TENIEM!!! nom cognom telfn adreça marca model caract matric color Josep Garcia 679123456 c/pi 10 Ford c-max vel.màx. 175kms/h d0a100: 12’9seg. 1111 ABC groc Joel Prats 609654321 les afores Josep Pons 676159357 c/petit 1 Seat Ibiza   Cupra vel.màx. 220kms/h d0a100: 7’6seg. 1234 ABC vermell Judith Segura 646147963 c/ del mar 5 Ford c-max vel.màx. 175kms/h d0a100: 12’9seg. 2222 BCI negre Anna Torres 679148368 c/ centre 1 Marc Soler 679321123 c/Urgell 3 Citroën C4 vel.màx. 192kms/h d0a100: 11’2seg. 4444 CSI vermell Seat Ibiza   Cupra vel.màx. 220kms/h d0a100: 7’6seg.
Que podríem fer per evitar tot això? ,[object Object],[object Object],[object Object],[object Object]
Solució!!! ,[object Object]
Cóm es tradueix això a nivell informàtic? ,[object Object],[object Object],[object Object],[object Object]
Al nostre exemple!!! ,[object Object],[object Object],[object Object],[object Object],1  N AMICS COTXES
i el corresponent model relacional : ,[object Object],[object Object],amb aquest camp informat a cotxes que ens permetrà anar a trobar la informació del propietari corresponent
com se fa la traducció a model relacional ? ,[object Object],[object Object],[object Object],[object Object]

Mais conteúdo relacionado

Destaque

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
 

Destaque (20)

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
 
ChatGPT webinar slides
ChatGPT webinar slidesChatGPT webinar slides
ChatGPT webinar slides
 

Introducció a les BD relacionals

  • 1. Nocions bàsiques... Rosa Surís exercici per a l’assignatura “Didàctica de la Informàtica” professora: Mªdel Mar Lluelles CAP 2007 BASES DE DADES RELACIONALS
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8. 2 on pas: traduïm això en un fitxer que podem gravar al ordinador...
  • 9.
  • 10. ...passem a enregistrar nous amic: Joan Prats 609654321 les afores ...doncs resulta que si aquest no te cap cotxe, estem desaprofitant un munt d’espai en blanc quan donem d’alta més registres.... si resulta que coincideixen els mateixos cotxes.... ...estem repetint les mateixes dades a cada registre
  • 11. al acabar tenim les següents dades... un altre problema...què fem si algú té més d’un cotxe? on ho apuntem això??? nom cognom telfn adreça marca model caract matric color Josep Garcia 679123456 c/pi 10 Ford c-max vel.màx. 175kms/h d0a100: 12’9seg. 1111 ABC groc Joel Prats 609654321 les afores Josep Pons 676159357 c/petit 1 Seat Ibiza Cupra vel.màx. 220kms/h d0a100: 7’6seg. 1234 ABC vermell Judith Segura 646147963 c/ del mar 5 Ford c-max vel.màx. 175kms/h d0a100: 12’9seg. 2222 BCI negre Anna Torres 679148368 c/ centre 1 Marc Soler 679321123 c/Urgell 3 Citroën C4 vel.màx. 192kms/h d0a100: 11’2seg. 4444 CSI vermell
  • 12. ...passem ara a modificar algunes dades dels cotxes que tenim arxivats ... ...i resulta que no ens en recordem de canviar de igual manera totes les que són el mateix!!! LA INTEGRITAT QUEDA MALMESA!!! nom cognom telfn adreça marca model caract matric color Josep Garcia 679123456 c/pi 10 Ford c-max vel.màx. 175kms/h d0a100: 12’9seg. 1111 ABC groc Joel Prats 609654321 les afores Josep Pons 676159357 c/petit 1 Seat Ibiza Cupra vel.màx. 220kms/h d0a100: 7’6seg. 1234 ABC vermell Judith Segura 646147963 c/ del mar 5 Ford c-max vel.màx. 85 kms/h d0a100: 120 ’9seg. 2222 BCI negre Anna Torres 679148368 c/ centre 1 Marc Soler 679321123 c/Urgell 3 Citroën C4 vel.màx. 192kms/h d0a100: 11’2seg. 4444 CSI vermell
  • 13. i si finalment eliminem ara registres de amics ... ... ALESHORES RESULTA QUE PODEM PERDRE DADES DE VEHICLES QUE JA TENIEM!!! nom cognom telfn adreça marca model caract matric color Josep Garcia 679123456 c/pi 10 Ford c-max vel.màx. 175kms/h d0a100: 12’9seg. 1111 ABC groc Joel Prats 609654321 les afores Josep Pons 676159357 c/petit 1 Seat Ibiza Cupra vel.màx. 220kms/h d0a100: 7’6seg. 1234 ABC vermell Judith Segura 646147963 c/ del mar 5 Ford c-max vel.màx. 175kms/h d0a100: 12’9seg. 2222 BCI negre Anna Torres 679148368 c/ centre 1 Marc Soler 679321123 c/Urgell 3 Citroën C4 vel.màx. 192kms/h d0a100: 11’2seg. 4444 CSI vermell Seat Ibiza Cupra vel.màx. 220kms/h d0a100: 7’6seg.
  • 14.
  • 15.
  • 16.
  • 17.
  • 18.
  • 19.