SlideShare a Scribd company logo
1 of 1
Download to read offline
/*
Script para ser utilizado com os exemplos de Algebra Relacional
no SQL Sever
*/
USE MASTER
GO
CREATE DATABASE AR
GO
USE AR
GO
CREATE TABLE R (
A INT,
B INT
);
CREATE TABLE S (
A INT,
B INT
);
CREATE TABLE T (
B INT,
C INT,
D INT
);
INSERT INTO R (A, B) VALUES (1, 2);
INSERT INTO R (A, B) VALUES (3, 4);
INSERT INTO S (A, B) VALUES (3, 4);
INSERT INTO S (A, B) VALUES (5, 6);
INSERT INTO S (A, B) VALUES (5, 8);
INSERT INTO T (B, C, D) VALUES (2, 2, 6);
INSERT INTO T (B, C, D) VALUES (4, 7, 8);
INSERT INTO T (B, C, D) VALUES (3, 2, 1);

More Related Content

More from Rodrigo Kiyoshi Saito

BD I - Aula 14 A - Limitando Conj Dados e Sub Selects
BD I - Aula 14 A - Limitando Conj Dados e Sub SelectsBD I - Aula 14 A - Limitando Conj Dados e Sub Selects
BD I - Aula 14 A - Limitando Conj Dados e Sub SelectsRodrigo Kiyoshi Saito
 
Algoritmos - Aula 15 - Modularizacao e Escopo de Variaveis - Exercicios Enunc...
Algoritmos - Aula 15 - Modularizacao e Escopo de Variaveis - Exercicios Enunc...Algoritmos - Aula 15 - Modularizacao e Escopo de Variaveis - Exercicios Enunc...
Algoritmos - Aula 15 - Modularizacao e Escopo de Variaveis - Exercicios Enunc...Rodrigo Kiyoshi Saito
 
Algoritmos - Aula 15 - Modularizacao e Escopo de Variaveis
Algoritmos - Aula 15 - Modularizacao e Escopo de VariaveisAlgoritmos - Aula 15 - Modularizacao e Escopo de Variaveis
Algoritmos - Aula 15 - Modularizacao e Escopo de VariaveisRodrigo Kiyoshi Saito
 
BD I - Aula 13 B - Agrupando Dados - Parte 04 - Exercicios Enunciado
BD I - Aula 13 B - Agrupando Dados  - Parte 04 - Exercicios EnunciadoBD I - Aula 13 B - Agrupando Dados  - Parte 04 - Exercicios Enunciado
BD I - Aula 13 B - Agrupando Dados - Parte 04 - Exercicios EnunciadoRodrigo Kiyoshi Saito
 
BD I - Aula 13 B - Agrupando Dados - Parte 04
BD I - Aula 13 B - Agrupando Dados  - Parte 04BD I - Aula 13 B - Agrupando Dados  - Parte 04
BD I - Aula 13 B - Agrupando Dados - Parte 04Rodrigo Kiyoshi Saito
 
BD I - Aula 13 B - Agrupando dados - Parte 04 - Exercicios Enunciado
BD I - Aula 13 B - Agrupando dados  - Parte 04 - Exercicios EnunciadoBD I - Aula 13 B - Agrupando dados  - Parte 04 - Exercicios Enunciado
BD I - Aula 13 B - Agrupando dados - Parte 04 - Exercicios EnunciadoRodrigo Kiyoshi Saito
 
BD I - Aula 13 A - Funcoes de string datas numeros e conversao - parte 03
BD I - Aula 13 A - Funcoes de string datas numeros e conversao - parte 03BD I - Aula 13 A - Funcoes de string datas numeros e conversao - parte 03
BD I - Aula 13 A - Funcoes de string datas numeros e conversao - parte 03Rodrigo Kiyoshi Saito
 
Algoritmos - Aula 13 C - Matrizes em C
Algoritmos - Aula 13 C - Matrizes em CAlgoritmos - Aula 13 C - Matrizes em C
Algoritmos - Aula 13 C - Matrizes em CRodrigo Kiyoshi Saito
 
Algoritmos - Aula 13 B - Vetores em C
Algoritmos - Aula 13 B - Vetores em CAlgoritmos - Aula 13 B - Vetores em C
Algoritmos - Aula 13 B - Vetores em CRodrigo Kiyoshi Saito
 
Algoritmos - Aula 12 B - Traducao Ling C - Condicoes
Algoritmos - Aula 12 B - Traducao Ling C - CondicoesAlgoritmos - Aula 12 B - Traducao Ling C - Condicoes
Algoritmos - Aula 12 B - Traducao Ling C - CondicoesRodrigo Kiyoshi Saito
 
Algoritmos - Aula 12 A - Traducao ling C - Ent Proc Saida
Algoritmos - Aula 12 A - Traducao ling C - Ent Proc SaidaAlgoritmos - Aula 12 A - Traducao ling C - Ent Proc Saida
Algoritmos - Aula 12 A - Traducao ling C - Ent Proc SaidaRodrigo Kiyoshi Saito
 
Algoritmos - Aula 10 A - Traducao Do Port Est Para Ling C
Algoritmos - Aula 10 A - Traducao Do Port Est Para Ling CAlgoritmos - Aula 10 A - Traducao Do Port Est Para Ling C
Algoritmos - Aula 10 A - Traducao Do Port Est Para Ling CRodrigo Kiyoshi Saito
 
Algoritmos - Aula 10 A - Traducao do Port Est Para Ling C - Exercicios
Algoritmos - Aula 10 A - Traducao do Port Est Para Ling C - ExerciciosAlgoritmos - Aula 10 A - Traducao do Port Est Para Ling C - Exercicios
Algoritmos - Aula 10 A - Traducao do Port Est Para Ling C - ExerciciosRodrigo Kiyoshi Saito
 
BDI - Aula 09 - SQL e Algebra Relacional
BDI - Aula 09 - SQL e Algebra RelacionalBDI - Aula 09 - SQL e Algebra Relacional
BDI - Aula 09 - SQL e Algebra RelacionalRodrigo Kiyoshi Saito
 
Algoritmos - Aula 09 B - Exercicios de Matrizes - Resolucao
Algoritmos - Aula 09 B - Exercicios de Matrizes - ResolucaoAlgoritmos - Aula 09 B - Exercicios de Matrizes - Resolucao
Algoritmos - Aula 09 B - Exercicios de Matrizes - ResolucaoRodrigo Kiyoshi Saito
 
Algoritmos - Aula 09 B - Exercicios de Matrizes - Enunciado
Algoritmos - Aula 09 B - Exercicios de Matrizes - EnunciadoAlgoritmos - Aula 09 B - Exercicios de Matrizes - Enunciado
Algoritmos - Aula 09 B - Exercicios de Matrizes - EnunciadoRodrigo Kiyoshi Saito
 
BD I - Aula 08 B - Algebra Relacional - Exercicios Resolucao
BD I - Aula 08 B - Algebra Relacional - Exercicios ResolucaoBD I - Aula 08 B - Algebra Relacional - Exercicios Resolucao
BD I - Aula 08 B - Algebra Relacional - Exercicios ResolucaoRodrigo Kiyoshi Saito
 

More from Rodrigo Kiyoshi Saito (20)

BD I - Aula 14 A - Limitando Conj Dados e Sub Selects
BD I - Aula 14 A - Limitando Conj Dados e Sub SelectsBD I - Aula 14 A - Limitando Conj Dados e Sub Selects
BD I - Aula 14 A - Limitando Conj Dados e Sub Selects
 
Algoritmos - Aula 15 - Modularizacao e Escopo de Variaveis - Exercicios Enunc...
Algoritmos - Aula 15 - Modularizacao e Escopo de Variaveis - Exercicios Enunc...Algoritmos - Aula 15 - Modularizacao e Escopo de Variaveis - Exercicios Enunc...
Algoritmos - Aula 15 - Modularizacao e Escopo de Variaveis - Exercicios Enunc...
 
Algoritmos - Aula 15 - Modularizacao e Escopo de Variaveis
Algoritmos - Aula 15 - Modularizacao e Escopo de VariaveisAlgoritmos - Aula 15 - Modularizacao e Escopo de Variaveis
Algoritmos - Aula 15 - Modularizacao e Escopo de Variaveis
 
BD I - Aula 13 B - Agrupando Dados - Parte 04 - Exercicios Enunciado
BD I - Aula 13 B - Agrupando Dados  - Parte 04 - Exercicios EnunciadoBD I - Aula 13 B - Agrupando Dados  - Parte 04 - Exercicios Enunciado
BD I - Aula 13 B - Agrupando Dados - Parte 04 - Exercicios Enunciado
 
BD I - Aula 13 B - Agrupando Dados - Parte 04
BD I - Aula 13 B - Agrupando Dados  - Parte 04BD I - Aula 13 B - Agrupando Dados  - Parte 04
BD I - Aula 13 B - Agrupando Dados - Parte 04
 
BD I - Aula 13 B - Agrupando dados - Parte 04 - Exercicios Enunciado
BD I - Aula 13 B - Agrupando dados  - Parte 04 - Exercicios EnunciadoBD I - Aula 13 B - Agrupando dados  - Parte 04 - Exercicios Enunciado
BD I - Aula 13 B - Agrupando dados - Parte 04 - Exercicios Enunciado
 
BD I - Aula 13 A - Funcoes de string datas numeros e conversao - parte 03
BD I - Aula 13 A - Funcoes de string datas numeros e conversao - parte 03BD I - Aula 13 A - Funcoes de string datas numeros e conversao - parte 03
BD I - Aula 13 A - Funcoes de string datas numeros e conversao - parte 03
 
Algoritmos - Aula 13 C - Matrizes em C
Algoritmos - Aula 13 C - Matrizes em CAlgoritmos - Aula 13 C - Matrizes em C
Algoritmos - Aula 13 C - Matrizes em C
 
Algoritmos - Aula 13 B - Vetores em C
Algoritmos - Aula 13 B - Vetores em CAlgoritmos - Aula 13 B - Vetores em C
Algoritmos - Aula 13 B - Vetores em C
 
Algoritmos - Aula 13 A - Lacos em C
Algoritmos - Aula 13 A - Lacos em CAlgoritmos - Aula 13 A - Lacos em C
Algoritmos - Aula 13 A - Lacos em C
 
Algoritmos - Aula 12 B - Traducao Ling C - Condicoes
Algoritmos - Aula 12 B - Traducao Ling C - CondicoesAlgoritmos - Aula 12 B - Traducao Ling C - Condicoes
Algoritmos - Aula 12 B - Traducao Ling C - Condicoes
 
Algoritmos - Aula 12 A - Traducao ling C - Ent Proc Saida
Algoritmos - Aula 12 A - Traducao ling C - Ent Proc SaidaAlgoritmos - Aula 12 A - Traducao ling C - Ent Proc Saida
Algoritmos - Aula 12 A - Traducao ling C - Ent Proc Saida
 
BD I - Aula 10 A - Introducao a SQL
BD I - Aula 10 A - Introducao a SQLBD I - Aula 10 A - Introducao a SQL
BD I - Aula 10 A - Introducao a SQL
 
Algoritmos - Aula 10 A - Traducao Do Port Est Para Ling C
Algoritmos - Aula 10 A - Traducao Do Port Est Para Ling CAlgoritmos - Aula 10 A - Traducao Do Port Est Para Ling C
Algoritmos - Aula 10 A - Traducao Do Port Est Para Ling C
 
Algoritmos - Aula 10 A - Traducao do Port Est Para Ling C - Exercicios
Algoritmos - Aula 10 A - Traducao do Port Est Para Ling C - ExerciciosAlgoritmos - Aula 10 A - Traducao do Port Est Para Ling C - Exercicios
Algoritmos - Aula 10 A - Traducao do Port Est Para Ling C - Exercicios
 
BDI - Aula 09 - SQL e Algebra Relacional
BDI - Aula 09 - SQL e Algebra RelacionalBDI - Aula 09 - SQL e Algebra Relacional
BDI - Aula 09 - SQL e Algebra Relacional
 
Algoritmos - Aula 09 B - Exercicios de Matrizes - Resolucao
Algoritmos - Aula 09 B - Exercicios de Matrizes - ResolucaoAlgoritmos - Aula 09 B - Exercicios de Matrizes - Resolucao
Algoritmos - Aula 09 B - Exercicios de Matrizes - Resolucao
 
Algoritmos - Aula 09 B - Exercicios de Matrizes - Enunciado
Algoritmos - Aula 09 B - Exercicios de Matrizes - EnunciadoAlgoritmos - Aula 09 B - Exercicios de Matrizes - Enunciado
Algoritmos - Aula 09 B - Exercicios de Matrizes - Enunciado
 
Algoritmos - Aula 09 A - Matrizes
Algoritmos - Aula 09 A - MatrizesAlgoritmos - Aula 09 A - Matrizes
Algoritmos - Aula 09 A - Matrizes
 
BD I - Aula 08 B - Algebra Relacional - Exercicios Resolucao
BD I - Aula 08 B - Algebra Relacional - Exercicios ResolucaoBD I - Aula 08 B - Algebra Relacional - Exercicios Resolucao
BD I - Aula 08 B - Algebra Relacional - Exercicios Resolucao
 

Recently uploaded

SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptxSKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptxAmanpreet Kaur
 
Spellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseSpellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseAnaAcapella
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.christianmathematics
 
Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsKarakKing
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxheathfieldcps1
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.pptRamjanShidvankar
 
FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024Elizabeth Walsh
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfAdmir Softic
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfPoh-Sun Goh
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptxMaritesTamaniVerdade
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.MaryamAhmad92
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentationcamerronhm
 
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...pradhanghanshyam7136
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsMebane Rash
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfciinovamais
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfagholdier
 
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfUGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfNirmal Dwivedi
 
Towards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxTowards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxJisc
 
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17  How to Extend Models Using Mixin ClassesMixin Classes in Odoo 17  How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17 How to Extend Models Using Mixin ClassesCeline George
 
Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfSherif Taha
 

Recently uploaded (20)

SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptxSKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
 
Spellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseSpellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please Practise
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functions
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.ppt
 
FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdf
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentation
 
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan Fellows
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfUGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
 
Towards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxTowards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptx
 
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17  How to Extend Models Using Mixin ClassesMixin Classes in Odoo 17  How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
 
Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdf
 

BDI - Aula 09 - SQL e Algebra Relacional para SQL Sever

  • 1. /* Script para ser utilizado com os exemplos de Algebra Relacional no SQL Sever */ USE MASTER GO CREATE DATABASE AR GO USE AR GO CREATE TABLE R ( A INT, B INT ); CREATE TABLE S ( A INT, B INT ); CREATE TABLE T ( B INT, C INT, D INT ); INSERT INTO R (A, B) VALUES (1, 2); INSERT INTO R (A, B) VALUES (3, 4); INSERT INTO S (A, B) VALUES (3, 4); INSERT INTO S (A, B) VALUES (5, 6); INSERT INTO S (A, B) VALUES (5, 8); INSERT INTO T (B, C, D) VALUES (2, 2, 6); INSERT INTO T (B, C, D) VALUES (4, 7, 8); INSERT INTO T (B, C, D) VALUES (3, 2, 1);