SlideShare uma empresa Scribd logo
1 de 17
Baixar para ler offline
BANCO DE DADOS - AULA 04:
CORREÇÃO DAS ATIVIDADES
Prof. Erick Franck Cainelli
Exercício 01
1. Sistema Bibliotecário Simples
– Construa um diagrama de entidade-relacionamento (DER) simples para
empréstimos de livros de uma pequena biblioteca. Para isso, utilize os
seguintes levantamentos de requisitos.
A. Todos os livros deverão ser armazenados no sistema. Para isso, deve ser
armazenado os dados de título, ISBN, autor, ano, quantidade de páginas;
B. Os livros poderão ser emprestados para leitores cadastrados. Para o
cadastrado desses leitores é necessário os dados de RG, CPF, nome, data
de nascimento e endereço completo.
1. Descrever as entidades e depois os atributos:
• Livros: Título, ISBN, autor, ano, quantidade de páginas;
• Leitores: RG, CPF, nome, data de nascimento e endereço completo.
1º Passo – Levantamento de Requisitos
2. Achar os Atributos Chave e Sublinha-los:
• Livros: Título, ISBN, autor, ano, quantidade de páginas;
• Leitores: RG, CPF, nome, data de nascimento e endereço completo.
• Obs. Caso não tenha nenhum candidato válido, deverá criar um novo
atributo para ser o atributo chave.
1º Passo – Levantamento de Requisitos
• Livros: Título, ISBN, autor, ano, quantidade de páginas;
Diagrama Simples - Livro
Livro
ISBN
Ano
Titulo
Autor
Qtd Pag
Diagrama Simples - Leitores
Leitores
CPF
D. Nasc
RG
Nome
End.
• Leitores: RG, CPF, nome, data de nascimento e endereço completo.
Rua
Cep
Bairro
Cidade
UF Numero
Diagrama Simples - Relacionamento
Leitores
CPF
D. Nasc
RG
Nome
End.
Rua
Cep
Bairro
Cidade
UF Numero
Livro
ISBN
Ano
Titulo
Autor
Qtd Pag
Empresta
Diagrama Simples – Cardinalidade
Leitores
CPF
D. Nasc
RG
Nome
End.
Rua
Cep
Bairro
Cidade
UF Numero
Livro
ISBN
Ano
Titulo
Autor
Qtd Pag
Empresta
1 N
Exercício 02
2. Cadastro Nacional de Veículos
– Você deverá construir um diagrama de entidade-relacionamento para o cadastro
nacional de veículos. Para realizar este modelo, utilize os seguintes requisitos.
A. Todo veículo deve possuir uma placa única. Também deve-se armazenar os
dados de nome, cor, ano de fabricação, ano modelo, quantidade de portas e
combustível;
B. Todo veículo possui um responsável legal por ele, desta forma deverá ser
armazenado os seguintes dados de proprietário: nome completo, RG, CPF,
endereço completo;
C. Todo veículo pertence a uma categoria, para isso, deve ser armazenado o nome
da categoria;
D. Todo veículo possui uma montadora. Para registrar os dados das montadoras,
deve-se armazenar o nome e país de origem.
1. Descrever as entidades e depois os atributos:
• Veiculo: Placa única, nome, cor, ano de fabricação, ano modelo,
quantidade de portas e combustível;
• Proprietário: nome completo, RG, CPF e endereço completo.
• Categoria: nome da categoria;
• Montadora: nome, pais de origem;
1º Passo – Levantamento de Requisitos
2. Achar os Atributos Chave e Sublinha-los:
• Veiculo: Placa única, nome, cor, ano de fabricação, ano modelo,
quantidade de portas e combustível;
• Proprietário: nome completo, RG, CPF e endereço completo.
• Categoria: nome da categoria, código;
• Montadora: nome, pais de origem, código;
• Obs. Caso não tenha nenhum candidato válido, deverá criar um novo
atributo para ser o atributo chave.
1º Passo – Levantamento de Requisitos
• Veiculo: Placa única, nome, cor, ano de fabricação, ano modelo,
quantidade de portas e combustível;
Diagrama Simples – Veiculo
Veiculo
Placa
Ano
Fabricação
Nome
Cor
Ano Modelo
Qtd
Portas
Combustível
Diagrama Simples – Proprietário
Proprietário
CPF
RG
Nome
End.
• Proprietário: nome completo, RG, CPF e endereço completo.
Rua
Cep
Bairro
Cidade
UF
Numero
• Categoria: nome da categoria, código;
Diagrama Simples – Categoria
Categoria
codigo Nome
• Montadora: nome, pais de origem, código;
Diagrama Simples – Montadora
Montadora
codigo Nome
Pais
Diagrama Simples – Relacionamento
Veiculo
Placa
Ano
Fabricação
Nome
Cor
Ano Modelo
Qtd
Portas
Combustível
Proprietário
CPF
RG
Nome
End.
Rua
Cep
Bairro
Cidade
UF
Numero
Categoria
codigo Nome
Montadora
codigo Nome
Pais
Responsável
Pertence
Possui
Diagrama Simples – Cardinalidade
Veiculo
Placa
Ano
Fabricação
Nome
Cor
Ano Modelo
Qtd
Portas
Combustível
Proprietário
CPF
RG
Nome
End.
Rua
Cep
Bairro
Cidade
UF
Numero
Categoria
codigo Nome
Montadora
codigo Nome
Pais
Responsável
Pertence
Possui
1 N
1
N
N 1

Mais conteúdo relacionado

Destaque

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
 

Destaque (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...
 

Slide 4 CORREÇÃO DAS ATIVIDADES, Banco de dados.pdf

  • 1. BANCO DE DADOS - AULA 04: CORREÇÃO DAS ATIVIDADES Prof. Erick Franck Cainelli
  • 2. Exercício 01 1. Sistema Bibliotecário Simples – Construa um diagrama de entidade-relacionamento (DER) simples para empréstimos de livros de uma pequena biblioteca. Para isso, utilize os seguintes levantamentos de requisitos. A. Todos os livros deverão ser armazenados no sistema. Para isso, deve ser armazenado os dados de título, ISBN, autor, ano, quantidade de páginas; B. Os livros poderão ser emprestados para leitores cadastrados. Para o cadastrado desses leitores é necessário os dados de RG, CPF, nome, data de nascimento e endereço completo.
  • 3. 1. Descrever as entidades e depois os atributos: • Livros: Título, ISBN, autor, ano, quantidade de páginas; • Leitores: RG, CPF, nome, data de nascimento e endereço completo. 1º Passo – Levantamento de Requisitos
  • 4. 2. Achar os Atributos Chave e Sublinha-los: • Livros: Título, ISBN, autor, ano, quantidade de páginas; • Leitores: RG, CPF, nome, data de nascimento e endereço completo. • Obs. Caso não tenha nenhum candidato válido, deverá criar um novo atributo para ser o atributo chave. 1º Passo – Levantamento de Requisitos
  • 5. • Livros: Título, ISBN, autor, ano, quantidade de páginas; Diagrama Simples - Livro Livro ISBN Ano Titulo Autor Qtd Pag
  • 6. Diagrama Simples - Leitores Leitores CPF D. Nasc RG Nome End. • Leitores: RG, CPF, nome, data de nascimento e endereço completo. Rua Cep Bairro Cidade UF Numero
  • 7. Diagrama Simples - Relacionamento Leitores CPF D. Nasc RG Nome End. Rua Cep Bairro Cidade UF Numero Livro ISBN Ano Titulo Autor Qtd Pag Empresta
  • 8. Diagrama Simples – Cardinalidade Leitores CPF D. Nasc RG Nome End. Rua Cep Bairro Cidade UF Numero Livro ISBN Ano Titulo Autor Qtd Pag Empresta 1 N
  • 9. Exercício 02 2. Cadastro Nacional de Veículos – Você deverá construir um diagrama de entidade-relacionamento para o cadastro nacional de veículos. Para realizar este modelo, utilize os seguintes requisitos. A. Todo veículo deve possuir uma placa única. Também deve-se armazenar os dados de nome, cor, ano de fabricação, ano modelo, quantidade de portas e combustível; B. Todo veículo possui um responsável legal por ele, desta forma deverá ser armazenado os seguintes dados de proprietário: nome completo, RG, CPF, endereço completo; C. Todo veículo pertence a uma categoria, para isso, deve ser armazenado o nome da categoria; D. Todo veículo possui uma montadora. Para registrar os dados das montadoras, deve-se armazenar o nome e país de origem.
  • 10. 1. Descrever as entidades e depois os atributos: • Veiculo: Placa única, nome, cor, ano de fabricação, ano modelo, quantidade de portas e combustível; • Proprietário: nome completo, RG, CPF e endereço completo. • Categoria: nome da categoria; • Montadora: nome, pais de origem; 1º Passo – Levantamento de Requisitos
  • 11. 2. Achar os Atributos Chave e Sublinha-los: • Veiculo: Placa única, nome, cor, ano de fabricação, ano modelo, quantidade de portas e combustível; • Proprietário: nome completo, RG, CPF e endereço completo. • Categoria: nome da categoria, código; • Montadora: nome, pais de origem, código; • Obs. Caso não tenha nenhum candidato válido, deverá criar um novo atributo para ser o atributo chave. 1º Passo – Levantamento de Requisitos
  • 12. • Veiculo: Placa única, nome, cor, ano de fabricação, ano modelo, quantidade de portas e combustível; Diagrama Simples – Veiculo Veiculo Placa Ano Fabricação Nome Cor Ano Modelo Qtd Portas Combustível
  • 13. Diagrama Simples – Proprietário Proprietário CPF RG Nome End. • Proprietário: nome completo, RG, CPF e endereço completo. Rua Cep Bairro Cidade UF Numero
  • 14. • Categoria: nome da categoria, código; Diagrama Simples – Categoria Categoria codigo Nome
  • 15. • Montadora: nome, pais de origem, código; Diagrama Simples – Montadora Montadora codigo Nome Pais
  • 16. Diagrama Simples – Relacionamento Veiculo Placa Ano Fabricação Nome Cor Ano Modelo Qtd Portas Combustível Proprietário CPF RG Nome End. Rua Cep Bairro Cidade UF Numero Categoria codigo Nome Montadora codigo Nome Pais Responsável Pertence Possui
  • 17. Diagrama Simples – Cardinalidade Veiculo Placa Ano Fabricação Nome Cor Ano Modelo Qtd Portas Combustível Proprietário CPF RG Nome End. Rua Cep Bairro Cidade UF Numero Categoria codigo Nome Montadora codigo Nome Pais Responsável Pertence Possui 1 N 1 N N 1