-
Notifications
You must be signed in to change notification settings - Fork 0
/
Assn7
75 lines (65 loc) · 2.22 KB
/
Assn7
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
--Alexander Phosykeo
--CIT 28
--Assignment #7 - Chapter 10
--Using SQLQFMM2
--Sales Orders Database: #1
select CustLastName, CustFirstName, ProductName
from Customers
inner join Orders
on Customers.CustomerID = Orders.CustomerID
inner join Order_Details
on Order_Details.OrderNumber = Orders.OrderNumber
inner join Products
on Order_Details.ProductNumber = Products.ProductNumber
where ProductName like '%helmet%'
union
select VendName,'Vendor' as rowID, ProductName
from Vendors
inner join Product_Vendors
on Vendors.VendorID = Product_Vendors.VendorID
inner join Products
on Product_Vendors.ProductNumber = Products.ProductNumber
where ProductName like '%helmet%'
--Entertainment Agency Database: #1
select CustLastName as 'Customers and Entertainers'
from Customers
union
select EntStageName as 'Customers and Entertainers'
from Entertainers
--School Scheduling Database: #1
select StudLastName as LastName, StudFirstName as FirstName, StudZipCode as ZipCode
from Students
union
select StfLastname as LastName, StfFirstName as FirstName, StfZipCode as ZipCode
from Staff
order by StudZipCode
--Bowling League Database: #1
select BowlerLastName, BowlerFirstName, RawScore , TourneyLocation
from Bowler_Scores
inner join Bowlers
on Bowlers.BowlerID = Bowler_Scores.BowlerID
inner join Tourney_Matches
on Bowler_Scores.MatchID = Tourney_Matches.MatchID
inner join Tournaments
on Tournaments.TourneyID = Tourney_Matches.TourneyID
where Tournaments.TourneyLocation = 'Thunderbird Lanes' and Bowler_Scores.RawScore >= 165
union
select BowlerLastName, BowlerFirstName, RawScore, TourneyLocation
from Bowler_Scores
inner join Bowlers
on Bowlers.BowlerID = Bowler_Scores.BowlerID
inner join Tourney_Matches
on Bowler_Scores.MatchID = Tourney_Matches.MatchID
inner join Tournaments
on Tournaments.TourneyID = Tourney_Matches.TourneyID
where Tournaments.TourneyLocation = 'Bolero Lanes' and Bowler_Scores.RawScore >= 150
--Recipes Database: #1
--select IngredientName, MeasurementDescription
select IngredientName, MeasurementDescription
from Ingredients
inner join Measurements
on Ingredients.MeasureAmountID = Measurements.MeasureAmountID
select RecipeTitle, MeasureAmountID
from Recipes
inner join Recipe_Ingredients
on Recipes.RecipeID = Recipe_Ingredients.RecipeID