0% found this document useful (0 votes)
74 views

MITS4003: Case Studies: Database Systems

Uploaded by

AbdulSamad
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
74 views

MITS4003: Case Studies: Database Systems

Uploaded by

AbdulSamad
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 28

MITS4003

Case Studies: Database Systems

Copyright © 2020, Victorian Institute of Technology.


The contents contained in this document may not be reproduced in any form or by any means, without the written permission of VIT,
Total Slides: 58
other than for the purpose for which it has been supplied. VIT and its logo are trademarks of Victorian Institute of Technology.

MITS4003 [Lesson 13] Copyright © 2020 VIT, All Rights Reserved 1


Case Study based on ER Diagram

• Country Bus Company


– A Country bus Company owns a number of buses. Each bus is
allocated to a particular route, although Some routes may have
Several buses. Each route passes through a number of towns. One
or more drivers are allocated to each stage of a route, which
corresponds to a journey through some or all of the towns on a route.
Some of the towns have a garage where buses are kept and each of
the buses are identified by the registration number and can carry
different numbers of passengers, since the vehicles vary in size and
can be single or double-decked. Each route is identified by a route
number and information is available on the average number of
passengers carried per day for each route. Drivers have an
employee number, name, address, and sometimes a telephone
number.

MITS4003 [Lesson 13] Copyright © 2020 VIT, All Rights Reserved 2


Case Study based on ER Diagram (Cont…)

• Country Bus Company (Cont…)


– Entities
• Bus – Company owns buses and will hold information about
them.
• Route – Buses travel on routes and will need described.
• Town – Buses pass through towns and need to know about
them.
• Driver – Company employs drivers, personnel will hold their data.
• Stage – Routes are made up of Stages. Garage –
• Garage houses buses, and need to know where they are.

MITS4003 [Lesson 13] Copyright © 2020 VIT, All Rights Reserved 3


Case Study based on ER Diagram (Cont…)

• Country Bus Company (Cont…)


– Relationships
• A bus is allocated to a route and a route may have several buses.
• Bus-route (m:1) is serviced by a route comprises of one or more
stages.
• Route-Stage (1:m) Comprises One or more drivers are allocated
to each stage.
• Driver-stage (m:1) is allocated A Stage passes through some or
all of the towns on a route.
• Stage-town (min) passes-through. A route passes through some
or all of the towns.
• Route-town (min) passes-through Some of the towns have a
garage.
• Garage-town (1:1) is situated A garage keeps buses and each
bus has one home garage.
• Garage-bus (m:1) is garaged.
MITS4003 [Lesson 13] Copyright © 2020 VIT, All Rights Reserved 4
Case Study based on ER Diagram (Cont…)

• Country Bus Company (Cont…)


– Relationships
• A bus is allocated to a route and a route may have several buses.
• Bus-route (m:1) is serviced by a route comprises of one or more
stages.
• Route-Stage (1:m) Comprises One or more drivers are allocated
to each stage.
• Driver-stage (m:1) is allocated A Stage passes through some or
all of the towns on a route.
• Stage-town (min) passes-through. A route passes through some
or all of the towns.
• Route-town (min) passes-through Some of the towns have a
garage.
• Garage-town (1:1) is situated A garage keeps buses and each
bus has one home garage.
• Garage-bus (m:1) is garaged.
MITS4003 [Lesson 13] Copyright © 2020 VIT, All Rights Reserved 5
Case Study based on ER Diagram (Cont…)

• Country Bus Company (Cont…)


– ER Diagram

MITS4003 [Lesson 13] Copyright © 2020 VIT, All Rights Reserved 6


Case Study based on Normalization

• consider the following fields of unnormalized database table


and normalized it to 3NF
Project Code
Project Name
Project Manager
Project Budget
Employee No
Employee Name
Department No
Department Name
Hourly Rate

MITS4003 [Lesson 13] Copyright © 2020 VIT, All Rights Reserved 7


Case Study based on Normalization (Cont…)

• First Normal Form (1NF)


– Project
• Project Code
• Project Name
• Project Manager
• Project Budget
– Employee
• Project Code
• Employee No
• Employee Name
• Department No
• Department Name
• Hourly Rate
MITS4003 [Lesson 13] Copyright © 2020 VIT, All Rights Reserved 8
Case Study based on Normalization (Cont…)

• Second Normal Form (1NF)


– Project
• Project Code
• Project Name
• Project Manager
• Project Budget
– Rate
• Project Code
• Employee No
• Hourly Rate
– Employee
• Employee No
• Employee Name
• Department No
• Department Name
MITS4003 [Lesson 13] Copyright © 2020 VIT, All Rights Reserved 9
Case Study based on Normalization (Cont…)

• Third Normal Form (1NF)


– Project
• Project Code
• Project Name
• Project Manager
• Project Budget
– Rate
• Project Code
• Employee No
• Hourly Rate
– Employee
• Employee No
• Employee Name
• Department No
– Department
• Department No
• Department Name
MITS4003 [Lesson 13] Copyright © 2020 VIT, All Rights Reserved 10
Case Study based on Queries

• Use Northwind database to solve the following:


– Find the CustomerID of the company that placed order 10269.
SELECT CustomerID
FROM Orders
WHERE OrderID = 10269;

– Find the name of the company that placed order 10269.


SELECT CompanyName
FROM Customers
WHERE CustomerID = (SELECT CustomerID
FROM Orders
WHERE OrderID = 10269);

MITS4003 [Lesson 13] Copyright © 2020 VIT, All Rights Reserved 11


Case Study based on Queries (Cont…)

– Find the Companies that placed orders in 1998


SELECT CompanyName
FROM Customers
WHERE CustomerID IN (SELECT CustomerID
FROM Orders
WHERE OrderDate BETWEEN '1998-01-01' AND '1998-12-31’);

– Create a report that shows the product name and supplier id for all
products supplied by Mayumi's and Pavlova, Ltd.
SELECT ProductName, SupplierID
FROM Products
WHERE SupplierID IN (SELECT SupplierID
FROM Suppliers
WHERE CompanyName IN ('Mayumi''s', 'Pavlova, Ltd'));
MITS4003 [Lesson 13] Copyright © 2020 VIT, All Rights Reserved 12
Case Study based on Queries (Cont…)

– Create a report that shows all products by name that are in the Dairy
Products category
SELECT ProductName
FROM Products
WHERE CategoryID = (SELECT CategoryID
FROM Categories
WHERE CategoryName = 'Dairy Products');
– Create a report showing employee orders.
SELECT Employees.EmployeeID, Employees.FirstName,
Employees.LastName, Orders.OrderID, Orders.OrderDate
FROM Employees JOIN Orders ON
(Employees.EmployeeID = Orders.EmployeeID)
ORDER BY Orders.OrderDate;
MITS4003 [Lesson 13] Copyright © 2020 VIT, All Rights Reserved 13
MITS4003
Revision: Database Systems

Copyright © 2020, Victorian Institute of Technology.


The contents contained in this document may not be reproduced in any form or by any means, without the written permission of VIT,
Total Slides: 58
other than for the purpose for which it has been supplied. VIT and its logo are trademarks of Victorian Institute of Technology.

MITS4003 [Lesson 13] Copyright © 2020 VIT, All Rights Reserved 14


DATA DEFINITION LANGUAGE
AND
INSERT, UPDATE AND DELETE STATEMENT

Copyright © 2020, Victorian Institute of Technology.


The contents contained in this document may not be reproduced in any form or by any means, without the written permission of VIT,
other than for the purpose for which it has been supplied. VIT and its logo are trademarks of Victorian Institute of Technology.

MITS4003 [Lesson 13] Copyright © 2020 VIT, All Rights Reserved 15


Topics

• Create Statement
• Create Database Statement
• Drop Database Statement
• Create Table Statement
• Truncate Table Statement
• Drop Table Statement
• Alter Table Statement
• INSERT INTO Statement
• Update Statement
• Delete Statement

MITS4003 [Lesson 13] Copyright © 2020 VIT, All Rights Reserved 16


Data Mining

Copyright © 2020, Victorian Institute of Technology.


The contents contained in this document may not be reproduced in any form or by any means, without the written permission of VIT,
Total Slides: 35
other than for the purpose for which it has been supplied. VIT and its logo are trademarks of Victorian Institute of Technology.

MITS4003 [Lesson 13] Copyright © 2020 VIT, All Rights Reserved 17


Topics

• Analysis of Data
• Why Data Mining?
• What is Data Mining?
• Data Mining in easier terms….
• Data Mining and Querying
• Data Mining
• What Kinds of Data Can Be Mined?
• Data Mining Application Areas
• Data Mining Steps to Discover Knowledge

MITS4003 [Lesson 13] Copyright © 2020 VIT, All Rights Reserved 18


SQL VIEWS

Copyright © 2020, Victorian Institute of Technology.


The contents contained in this document may not be reproduced in any form or by any means, without the written permission of VIT,
Total Slides: 35
other than for the purpose for which it has been supplied. VIT and its logo are trademarks of Victorian Institute of Technology.

MITS4003 [Lesson 13] Copyright © 2020 VIT, All Rights Reserved 19


Topics

• What Are User Views?


• Characteristics of User Views
• SQL for User Views
• Tables Used in Demonstrating Views Examples in Following
Slides
• Mechanics of Views
• Types of Userviews
• Why User Views
• User View Design Considerations
• View Designed for Access Control
• View designed for Ease of Query

MITS4003 [Lesson 13] Copyright © 2020 VIT, All Rights Reserved 20


Topics (Cont…)

• Ease of Application Development


• Processing User Views
• Updating & Inserting User View
• Insert / Update / Delete Views

MITS4003 [Lesson 13] Copyright © 2020 VIT, All Rights Reserved 21


Triggers

Copyright © 2020, Victorian Institute of Technology.


The contents contained in this document may not be reproduced in any form or by any means, without the written permission of VIT,
Total Slides: 35
other than for the purpose for which it has been supplied. VIT and its logo are trademarks of Victorian Institute of Technology.

MITS4003 [Lesson 13] Copyright © 2020 VIT, All Rights Reserved 22


Topics

• Active Database Concepts and Triggers


• Introduction to Trigger
• Example of Trigger
• Components of Trigger
• Use of Trigger
• Syntax of Trigger
• Remark for DML Trigger
• Remark for DDL Trigger
• Example of Trigger

MITS4003 [Lesson 13] Copyright © 2020 VIT, All Rights Reserved 23


DATA CONTROL LANGUAGE

Copyright © 2020, Victorian Institute of Technology.


The contents contained in this document may not be reproduced in any form or by any means, without the written permission of VIT,
Total Slides: 58
other than for the purpose for which it has been supplied. VIT and its logo are trademarks of Victorian Institute of Technology.

MITS4003 [Lesson 13] Copyright © 2020 VIT, All Rights Reserved 24


Topics

• Data Security and Control


• SQL for Security and Control
• GRANT
• DENY
• REVOKE
• Data Integrity, Sharing & Recovery
• Using EM for Administering Databases
• Using Server Management Studio to Create New Login
• Levels of Security
• Objects’ Permission in Databases
• Administering Users’ Rights
MITS4003 [Lesson 13] Copyright © 2020 VIT, All Rights Reserved 25
DATABASE-SYSTEM ARCHITECTURES

Copyright © 2020, Victorian Institute of Technology.


The contents contained in this document may not be reproduced in any form or by any means, without the written permission of VIT,
Total Slides: 58
other than for the purpose for which it has been supplied. VIT and its logo are trademarks of Victorian Institute of Technology.

MITS4003 [Lesson 13] Copyright © 2020 VIT, All Rights Reserved 26


Topics

• Introduction
• Centralized and Client–Server Architectures
• Server System Architectures
• Parallel Systems
• Distributed Systems

MITS4003 [Lesson 13] Copyright © 2020 VIT, All Rights Reserved 27


Summary

• Questions and Answer

MITS4003 [Lesson 13] Copyright © 2020 VIT, All Rights Reserved 28

You might also like