SlideShare a Scribd company logo
1 of 6
CONSULTES CLUB 1<br />Seleccionar els jugadors que tinguin com número de lliga el 7060<br />select playerno, name<br />from jugadors<br />where leagueno=7060<br />Obtenir número de jugador, data de naixament, any d’incorporació al club d’aquells jugadors <br />que van ingresar al club quan tenien 17 anys<br />select playerno, name, yearofbirth, yearjoined<br />from jugadors<br />where  (yearjoined-yearofbirth)=17<br />Obtenir el número de jugador i el número de lliga dels jugadors que tinguin número de lliga<br />select playerno, name, leagueno<br />from jugadors<br />where  leagueno is not null<br />Obtenir els números dels jugadors que van naixer després de 1960<br />select COUNT (playerno), name, yearofbirth<br />from jugadors<br />where  yearofbirth>= 1960<br />group by playerno, yearofbirth, name<br />Obtenir el número d’equip de cada equip que no tingui com a capità el jugador número 27<br />select teamno<br />from equips<br />where  playerno!=27<br />Obtenir els números dels jugadors que per un determinat equip han guanyat més partiss que <br />els que han perdut<br />select playerno, teamno<br />from partits<br />where  won>lost<br />Obtenir els números dels jugadors que per un determinat equip han jugat 10 partits en total<br />select playerno, teamno<br />from partits<br />where  (won+lost)=10<br />Obtenir els número, nom, sexe i data de naixament dels jugadors que viuen a Stratford però no <br />inclogueu els que viuen a Stratford i van naixer al 1963<br />select name, yearofbirth, town, playerno, sex<br />from jugadors<br />where  town='Stratford' and yearofbirth!=1963<br />Obtenir els número de jugador, any de naixement i ciutat d’aquells jugadors que van naixer en <br />el periode entre 1962 i 1964<br />select name, yearofbirth, town, playerno, sex<br />from jugadors<br />where  yearofbirth between 1962 and 1964<br />CONSULTES CLUB 2<br />Obtenir el nom d’aquells jugadors que viuen a Inglewood, Plymouth, Midhurst o Douglas<br />select name<br />from jugadors<br />where  town='Inglewood' or town='Plymouth' or town='Midhurst' or  town='Douglas'<br />Obtenir el número de la sanció de cada una de les sancions que estiguin entre 50 i 100 euros<br />select paymentno<br />from sancions<br />where  amount between 50 and 100<br />Obtenir el número de la sanció de cada una de les sancions que no estiguin entre 50 i 100 <br />euros<br />select paymentno<br />from sancions<br />where  amount not between 50 and 100<br />Obtenir el número de la sanció de les sancions de 50, 75 i 100 euros<br />select paymentno<br />from sancions<br />where  amount=50 or amount=75 or amount=100<br />Obtenir el número del jugadors que no viuen ni a Stratford ni a Douglas<br />select COUNT (playerno) as 'numero  de jugadors'<br />from jugadors<br />where  town!= 'Stratford' and town!= 'Douglas'<br />Obtenir el nom i el número del jugadors el nom dels quals acaba amb la lletra n<br />select playerno, name<br />from jugadors<br />where  name like '%n'<br />Fes les següents consultes de forma separada. Obtenir el nom dels jugadors el nom dels quals:<br />- Contingui la cadena ‘is’<br />select name<br />from jugadors<br />where  name like '%is%'<br />- Tingui 3 caràcters<br />select  name<br />from jugadors<br />where  name like '???'<br />- Com a mínim tingui 3 caràcters<br />select  name<br />from jugadors<br />where  name like '???%'<br />- Tingui la lletra ‘p’ en la segona i penúltima lletra del seu nom<br />select  name<br />from jugadors<br />where  name like '?p%p?'<br />Obtenir el nom, número del jugadors els quals el número de lliga no sigui 8467<br />select  name<br />from jugadors<br />where  leagueno!=8467<br />CONSULTES CLUB 3<br />1. Obtenir el nom i les inicials d’aquells jugadors que hagin jugat com a mínim un partit<br />select  name, initials <br />from jugadors<br />where  playerno in(select playerno <br />from partits<br />where (won+lost)>=1)<br />2. Obtenir el nom de cada jugador que hagi jugat un o mes partits en l’equip número 1<br />select  name <br />from jugadors<br />where  playerno in(select playerno<br />from partits<br />where teamno=1)<br />3. Obtenir el nom de cada jugador que hagi jugat un o mes partits en l’equip que està <br />capitanejat pel jugador número 6<br />select  name, initials <br />from jugadors<br />where  playerno in(select playerno<br />from partits<br />where teamno in( select teamno <br />from equips <br />where playerno=6))<br />4. Obtenir numero i nom de cada jugador que hagi estat sancionat<br />select  name, playerno  <br />from jugadors<br />where  playerno in(select playerno<br />from sancions)<br />5. Obtenir numero i nom de cada jugador que hagi estat sancionat amb sancions <br />superiors a 50€<br />select  name, playerno  <br />from jugadors<br />where  playerno in(select playerno<br />from sancions<br />where amount> 50)<br />6. Obtenir numero i nom de cada jugador que hagi estat sancionat i que no sigui el capità <br />de l’equip que juga en la primera divisió<br />select  name, playerno  <br />from jugadors<br />where  playerno in(select playerno<br />from sancions<br />where playerno in (select playerno <br />from equips<br />where division!='first' ))<br />7. Obtenir el nom del jugador que és capità de l’equip numero 1<br />select  name<br />from jugadors<br />where  playerno in(select playerno<br />from equips<br />where teamno=1)<br />8. Obtenir el nom de cada jugador que sigui més vell que R. Parmenter<br />select  name<br />from jugadors<br />where  yearofbirth >( select yearofbirth <br />from jugadors<br />where initials='r' and name='parmenter')<br />CONSULTES CLUB 4<br />1. Obtenir el número de cada jugador que tingui la mateixa edat que R.Parmenter però <br />R.Parmenter no volem que surti en el resultat<br />select playerno, yearofbirth<br />from jugadors<br />where initials='R'and name!='Parmenter' and yearofbirth in ( select yearofbirth from jugadors where name='Parmenter')<br />o<br />Select playerno From jugadors <br />where name!='Parmenter' AND initials='R' AND yearofbirth=(<br />Select yearofbirth<br />from jugadors<br />Where initials='R' AND Name='Parmenter')<br />2. Obtenir el número de cada jugador que ha guanyat tants partits en l’equip 2 com el <br />jugador número 8 (en l’equip 2).<br />Select playerno<br />from partits <br />where teamno=2 and won in ( select won  from partits where playerno=8)<br />OPERADORS ANY i ALL<br />3. Obtenir el nom i la data de naixement del jugador més vell.<br />Select name, yearofbirth<br />from jugadors <br />where yearofbirth <= all (select yearofbirth from jugadors)<br />4. Obtenir la data de naixement de tots els jugadors excepte el que sigui més vell<br />Select name, yearofbirth<br />from jugadors <br />where yearofbirth not in (select yearofbirth from jugadors where yearofbirth >=all(select yearofbirth from jugadors))<br />5. Obtenir el numero de jugador del jugador més vell d’Stratford<br />Select name, yearofbirth, town <br />from jugadors <br />where town='Stratford' and yearofbirth >=all (select yearofbirth from jugadors where town='Stratford' )<br />6. Obtenir el número de jugador de cada jugador que ha estat sancionat (sense utilitzar <br />IN)<br />Select distinct playerno from sancions<br />7. Obtenir el nom i les inicials de cada jugador que és capità d’algun equip<br />Select name, initials<br />from jugadors<br />where playerno in( select playerno from equips) <br />8. Obtenir el nom i les inicials de cada jugador que no és capità del equip on juga el <br />jugador 112<br />CONSULTES CLUB 5<br />1. Obtenir el nom de les ciutats que tenen un únic jugador amb número de lliga<br />2. Obtenir el número de cada jugador que hagi rebut la seva primera sanció l’any 1984<br />3. Obtenir el número de lliga d’aquells jugadors que han rebut un total de 150€ en <br />sancions<br />4. Obtenir el número d’aquells jugadors els quals han rebut com a mínim una sanció i la <br />seva mitja de sancions sigui 50€<br />5. Seleccionar aquelles ciutats on hi viuen més de 4 jugadors<br />6. Obtenir el número de cada jugador que hagi rebut més de 150€ amb sancions<br />7. Obtenir el nom i el número de cada jugador que hagi rebut més d’una sanció<br />
Consultes club
Consultes club
Consultes club
Consultes club
Consultes club

More Related Content

Featured

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
 
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...DevGAMM Conference
 

Featured (20)

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
 
More than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike RoutesMore than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike Routes
 
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
 

Consultes club

  • 1. CONSULTES CLUB 1<br />Seleccionar els jugadors que tinguin com número de lliga el 7060<br />select playerno, name<br />from jugadors<br />where leagueno=7060<br />Obtenir número de jugador, data de naixament, any d’incorporació al club d’aquells jugadors <br />que van ingresar al club quan tenien 17 anys<br />select playerno, name, yearofbirth, yearjoined<br />from jugadors<br />where (yearjoined-yearofbirth)=17<br />Obtenir el número de jugador i el número de lliga dels jugadors que tinguin número de lliga<br />select playerno, name, leagueno<br />from jugadors<br />where leagueno is not null<br />Obtenir els números dels jugadors que van naixer després de 1960<br />select COUNT (playerno), name, yearofbirth<br />from jugadors<br />where yearofbirth>= 1960<br />group by playerno, yearofbirth, name<br />Obtenir el número d’equip de cada equip que no tingui com a capità el jugador número 27<br />select teamno<br />from equips<br />where playerno!=27<br />Obtenir els números dels jugadors que per un determinat equip han guanyat més partiss que <br />els que han perdut<br />select playerno, teamno<br />from partits<br />where won>lost<br />Obtenir els números dels jugadors que per un determinat equip han jugat 10 partits en total<br />select playerno, teamno<br />from partits<br />where (won+lost)=10<br />Obtenir els número, nom, sexe i data de naixament dels jugadors que viuen a Stratford però no <br />inclogueu els que viuen a Stratford i van naixer al 1963<br />select name, yearofbirth, town, playerno, sex<br />from jugadors<br />where town='Stratford' and yearofbirth!=1963<br />Obtenir els número de jugador, any de naixement i ciutat d’aquells jugadors que van naixer en <br />el periode entre 1962 i 1964<br />select name, yearofbirth, town, playerno, sex<br />from jugadors<br />where yearofbirth between 1962 and 1964<br />CONSULTES CLUB 2<br />Obtenir el nom d’aquells jugadors que viuen a Inglewood, Plymouth, Midhurst o Douglas<br />select name<br />from jugadors<br />where town='Inglewood' or town='Plymouth' or town='Midhurst' or town='Douglas'<br />Obtenir el número de la sanció de cada una de les sancions que estiguin entre 50 i 100 euros<br />select paymentno<br />from sancions<br />where amount between 50 and 100<br />Obtenir el número de la sanció de cada una de les sancions que no estiguin entre 50 i 100 <br />euros<br />select paymentno<br />from sancions<br />where amount not between 50 and 100<br />Obtenir el número de la sanció de les sancions de 50, 75 i 100 euros<br />select paymentno<br />from sancions<br />where amount=50 or amount=75 or amount=100<br />Obtenir el número del jugadors que no viuen ni a Stratford ni a Douglas<br />select COUNT (playerno) as 'numero de jugadors'<br />from jugadors<br />where town!= 'Stratford' and town!= 'Douglas'<br />Obtenir el nom i el número del jugadors el nom dels quals acaba amb la lletra n<br />select playerno, name<br />from jugadors<br />where name like '%n'<br />Fes les següents consultes de forma separada. Obtenir el nom dels jugadors el nom dels quals:<br />- Contingui la cadena ‘is’<br />select name<br />from jugadors<br />where name like '%is%'<br />- Tingui 3 caràcters<br />select name<br />from jugadors<br />where name like '???'<br />- Com a mínim tingui 3 caràcters<br />select name<br />from jugadors<br />where name like '???%'<br />- Tingui la lletra ‘p’ en la segona i penúltima lletra del seu nom<br />select name<br />from jugadors<br />where name like '?p%p?'<br />Obtenir el nom, número del jugadors els quals el número de lliga no sigui 8467<br />select name<br />from jugadors<br />where leagueno!=8467<br />CONSULTES CLUB 3<br />1. Obtenir el nom i les inicials d’aquells jugadors que hagin jugat com a mínim un partit<br />select name, initials <br />from jugadors<br />where playerno in(select playerno <br />from partits<br />where (won+lost)>=1)<br />2. Obtenir el nom de cada jugador que hagi jugat un o mes partits en l’equip número 1<br />select name <br />from jugadors<br />where playerno in(select playerno<br />from partits<br />where teamno=1)<br />3. Obtenir el nom de cada jugador que hagi jugat un o mes partits en l’equip que està <br />capitanejat pel jugador número 6<br />select name, initials <br />from jugadors<br />where playerno in(select playerno<br />from partits<br />where teamno in( select teamno <br />from equips <br />where playerno=6))<br />4. Obtenir numero i nom de cada jugador que hagi estat sancionat<br />select name, playerno <br />from jugadors<br />where playerno in(select playerno<br />from sancions)<br />5. Obtenir numero i nom de cada jugador que hagi estat sancionat amb sancions <br />superiors a 50€<br />select name, playerno <br />from jugadors<br />where playerno in(select playerno<br />from sancions<br />where amount> 50)<br />6. Obtenir numero i nom de cada jugador que hagi estat sancionat i que no sigui el capità <br />de l’equip que juga en la primera divisió<br />select name, playerno <br />from jugadors<br />where playerno in(select playerno<br />from sancions<br />where playerno in (select playerno <br />from equips<br />where division!='first' ))<br />7. Obtenir el nom del jugador que és capità de l’equip numero 1<br />select name<br />from jugadors<br />where playerno in(select playerno<br />from equips<br />where teamno=1)<br />8. Obtenir el nom de cada jugador que sigui més vell que R. Parmenter<br />select name<br />from jugadors<br />where yearofbirth >( select yearofbirth <br />from jugadors<br />where initials='r' and name='parmenter')<br />CONSULTES CLUB 4<br />1. Obtenir el número de cada jugador que tingui la mateixa edat que R.Parmenter però <br />R.Parmenter no volem que surti en el resultat<br />select playerno, yearofbirth<br />from jugadors<br />where initials='R'and name!='Parmenter' and yearofbirth in ( select yearofbirth from jugadors where name='Parmenter')<br />o<br />Select playerno From jugadors <br />where name!='Parmenter' AND initials='R' AND yearofbirth=(<br />Select yearofbirth<br />from jugadors<br />Where initials='R' AND Name='Parmenter')<br />2. Obtenir el número de cada jugador que ha guanyat tants partits en l’equip 2 com el <br />jugador número 8 (en l’equip 2).<br />Select playerno<br />from partits <br />where teamno=2 and won in ( select won from partits where playerno=8)<br />OPERADORS ANY i ALL<br />3. Obtenir el nom i la data de naixement del jugador més vell.<br />Select name, yearofbirth<br />from jugadors <br />where yearofbirth <= all (select yearofbirth from jugadors)<br />4. Obtenir la data de naixement de tots els jugadors excepte el que sigui més vell<br />Select name, yearofbirth<br />from jugadors <br />where yearofbirth not in (select yearofbirth from jugadors where yearofbirth >=all(select yearofbirth from jugadors))<br />5. Obtenir el numero de jugador del jugador més vell d’Stratford<br />Select name, yearofbirth, town <br />from jugadors <br />where town='Stratford' and yearofbirth >=all (select yearofbirth from jugadors where town='Stratford' )<br />6. Obtenir el número de jugador de cada jugador que ha estat sancionat (sense utilitzar <br />IN)<br />Select distinct playerno from sancions<br />7. Obtenir el nom i les inicials de cada jugador que és capità d’algun equip<br />Select name, initials<br />from jugadors<br />where playerno in( select playerno from equips) <br />8. Obtenir el nom i les inicials de cada jugador que no és capità del equip on juga el <br />jugador 112<br />CONSULTES CLUB 5<br />1. Obtenir el nom de les ciutats que tenen un únic jugador amb número de lliga<br />2. Obtenir el número de cada jugador que hagi rebut la seva primera sanció l’any 1984<br />3. Obtenir el número de lliga d’aquells jugadors que han rebut un total de 150€ en <br />sancions<br />4. Obtenir el número d’aquells jugadors els quals han rebut com a mínim una sanció i la <br />seva mitja de sancions sigui 50€<br />5. Seleccionar aquelles ciutats on hi viuen més de 4 jugadors<br />6. Obtenir el número de cada jugador que hagi rebut més de 150€ amb sancions<br />7. Obtenir el nom i el número de cada jugador que hagi rebut més d’una sanció<br />