Skip to content

Instantly share code, notes, and snippets.

@ypacheco
Last active March 10, 2023 16:14
Show Gist options
  • Save ypacheco/273e4f1f119c64021d712c0b5967b6fa to your computer and use it in GitHub Desktop.
Save ypacheco/273e4f1f119c64021d712c0b5967b6fa to your computer and use it in GitHub Desktop.
WPO3exercices
group: WPO3exercices
-- Ex 1 and 2
R = {
name, degree
'Anne', 'MSc Computer Science'
'Anne', 'Highschool'
'Anne', 'MSc Mathematics'
'Katja', 'MSc Computer Science'
'Katja', 'MSc Mathematics'
'Katja', 'Highschool'
'Katja', 'MSc Physics'
'William', 'Highschool'
'William', 'MSc Computer Science'
'Christophe', 'Highschool'
'Christophe', 'MSc Computer Science'
}
S = {
degree
'MSc Computer Science'
'Highschool'
'MSc Mathematics'
'MSc Physics'
}
-- Ex 3
Suppliers={
sid, sname, address
1,'Daisy' ,'Chicago'
2,'Angela' , 'Philadelphia'
3,'Lucy', 'Detroit'
4,'Valentina' , 'Dallas'
5,'Rose', 'Denver'
6,'Alexis', 'Dallas'
7,'Hector', 'San Francisco'
8,'Julian', 'Detroit'
9,'Adrian', 'Chicago'
10,'Scott', 'Denver'
}
Parts={
pid, pname, color
1,'Skirt','black'
2,'Bikini','silver'
3,'Dress pants','gray'
4,'Jumper','white'
5,'Sneakers','maroon'
6,'Hoodie','red'
7,'Vest','purple'
8,'High heels','blue'
9,'Flip flops','navy'
10,'Handbag','lime'
11,'Tank top','red'
12,'Singlet','green'
13,'Boots','gray'
14,'Shorts','silver'
15,'Polo shirt','red'
16,'Umbrella','yellow'
17,'Dress','navy'
18,'Hawaiian shirt','black'
19,'Mittens','blue'
20,'Socks','white'
21,'Swimsuit','red'
22,'Trench coat','green'
23,'Winter coat','black'
24,'Straw hat','silver'
25,'Cap','gray'
26,'Scarf','red'
}
Catalog={
sid, pid, cost
1,1 ,10.30
2,10 , 10.50
3,12, 36
4,23 , 29.99
5,5, 14.50
6,3, 20
7,9, 90
8,11, 18
9,12, 46
10,8, 68.90
1,11 ,8.30
2,2 , 39.50
3,25, 31.80
4,20 , 19.99
5,15, 12.50
6,13, 20.85
7,4, 47
8,5, 82.20
9,9, 14
10,18, 9.90
1,2 ,21.30
2,3, 45.50
3,4, 55
4,5 , 16.40
5,6, 12.50
6,7, 22
7,8, 78
8,9, 18
9,10, 45
10,11,30
}
-- Ex 5
Employee = {
person_name, street,city
'Daisy', 'Dictum Av','Chicago'
'Angela', 'Arcu St', 'Philadelphia'
'Lucy', 'Viverra Avenue', 'Detroit'
'Valentina', 'Tortor Street', 'Dallas'
'Rose', 'Proin Road', 'Denver'
'Alexis', 'Tortor Street', 'Dallas'
'Hector', 'Integer Rd', 'San Francisco'
'Julian', 'Viverra Avenue', 'Detroit'
'Adrian', 'Dictum Av', 'Chicago'
'Scott', 'Ut Ave', 'Denver'
}
Company = {
company_name, city
'Walmart', 'Philadelphia'
'First Bank Corporation', 'Dallas'
'Exxon', 'Detroit'
'Apple', 'Denver'
'Small Bank Corporation', 'Chicago'
}
Works = {
person_name, company_name, salary
'Daisy', 'Walmart', 30
'Angela', 'Exxon', 46
'Scott', 'Apple', 50
'Adrian', 'Small Bank Corporation', 24
'Julian', 'First Bank Corporation', 37
'Hector', 'Walmart', 52
'Alexis', 'Apple', 46
'Rose', 'Small Bank Corporation', 46
'Valentina', 'First Bank Corporation', 28
'Lucy', 'Exxon', 34
}
Manages = {
person_name, manager_name
'Daisy', 'Adrian'
'Rose', 'Angela'
'Hector', 'Lucy'
'Scott', 'Rose'
'Lucy', 'Julian'
'Alexis', 'Valentina'
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment