CSC 1033 Project 1
CSC 1033 Project 1
1)
2)
3A)
SELECT `Name`,`Email`
FROM `Operators`
ORDER BY 'Email' ASC
LIMIT 1;
B)
SELECT d.`Phone number`
FROM Districts AS d , Stops AS s, Routes AS r
WHERE r.ID = 22 AND (s.ID = r.`Start` OR s.ID = r.`End`) AND d.Name =
s.District;
C)
SELECT d.name, count(*)
FROM Districts AS d, Stops AS s
WHERE d.Name = s.District
GROUP BY s.District HAVING count(*) > 4;
d)
SELECT o.email
FROM Stops s
JOIN Routes r ON s.ID = r.`Start` OR s.ID = r.`End`
JOIN Drives d ON r.ID = d.Route
JOIN Operators o ON o.Name = d.Operator
WHERE s.`Descriptor` LIKE '%Estate'
ORDER BY o.Email ASC;
4a)
Both staff and check would contain atomic data with no transitive dependencies
and full key dependencies, therefore making it valid in 3NF
b)
Staff ID, Name and Phone number won’t be fully dependant on Check ID (the
primary key). This results in a partial dependency, violating 2NF.
c)
Check Information and Staff Information would store lists (divisible information),
violating 1NF.
5a)
Query frequency: if a singular device is requesting a significant number of
queries in a short timeframe, that may signify unfair usage
Current connections: if there are a significant number of simultaneous
connections, misuse may be implied, or even if there are just a lot of
connections, potential failure could be noted
b)
User query log: noting which users are attempting to use modification (update,
delete, etc) may indicate misuse if not from an expected user
Permissions changes: a sudden, unexpected change in a user’s permissions
implies misuse and subsequent unwanted use of the database
Connection frequency: if there are suddenly a large amount of simultaneous
connections, that implies an attempt at a DDOS