SlideShare ist ein Scribd-Unternehmen logo
1 von 88
Er. Nawaraj Bhandari
Database Design &
Development
Topic 6&7:
Physical Design 1
Recap of Phases of Database Design - 1
 Conceptual database design
 Logical database design
 Physical database design
• Conceptual database design
• Logical database design
• Physical database design
Recap of Phases of Database Design - 2
Activity: give a brief definition of the purposes of each of
these phases and the difference between them.
Conceptual Database Design
 Conceptual database design involves understanding the data in an
enterprise and modeling it without regard for any physical
considerations or particular data models.
Logical Database Design
 Logical database design involves designing a model of the data in an
enterprise that is independent of a particular DBMS but does take
account of the chosen data model.
Physical Database Design
 Physical database design involves producing a design that describes
the base relations and takes into account file organization, indexes,
integrity constraints and security measures.
The Purpose of Physical Design
 Translates logical database structures (entities, attributes,
relationships, and constraints) into a physical design.
 The physical design should be suitable for implementation by the
chosen DBMS
Knowledge needed of Chosen DBMS
 How to create base tables
 Does the system support the definition of primary, foreign keys and
alternate keys
 Does the system support definition of required data (i.e. Definition of
columns as NOT NULL)
 Does the system support domains
 Does the system system support relational integrity rules
 Does the system support the definition of business rules
Choosing a Database Product
 Requirements – what suits the business
 Budget
 Compatibility with existing technology within organisaton
 Support available
 Strength of vendor
Step 3
3.1 Design Base Tables (covered in this lecture)
3.2 Design representations of derived data (covered in this unit)
3.3 Design remaining business rules (covered in Unit (Unit 8).
Step 4
4.1 Analyse transactions (covered in Unit 9)
4.2 Choose file organisations (covered in Unit 9)
4.3 Choose indexes (covered in Unit 8)
Steps 5 to 8
 Step 5 Design User Views (Covered in Unit 8 and 9)
 Step 6 Design security mechanisms (Covered in Unit 8)
 Step 7 Consider the introduction of controlled redundancy (de-
normalisation)(Covered in Unit 9)
 Step 8 Monitor and tune the operational system (Not covered)
Design Base Tables
 Collate the information about tables gathered during the logical design stage.
Table: For each column:
Name of Table Domain consisting of data type,
length and any constraints
List of Columns Optional default value
Primary Keys and Foreign Keys Can the column be null?
Referential Integrity constraints Is the column derived? (to be
discussed later)
The Entity Relationship Diagram for the Art Supply Shop
Customer CustomerItem Item
Supplier
1 1
1
0...*
0...* 0...*
Outcome of Logical Design
Customer CustomerItem Item
Supplier
1 1
1
0...*
0...* 0...*
Initial table structures for ‘Art Suppliers’ database.
Customer (CustomerID, CustomerName, Street, Postcode)
Primary Key CustomerID
CustomerItem or Order
(CustomerID, ItemID, Date, Time, Quanitity)
Primary Key CustomerID, ItemID, Date
Item
(ItemID, ItemName, Price, SupplierID)
Primary Key (ItemID
Supplier
(SupplierID, SupplierName)
Primary Key SupplierID
Tables at the outcome of
Logical design
The physical design of the Customer Table using DBDL
Domain CustomerIDS fixed length character string length 5
Domain Street_names variable length character string maximum length 20
Domain Post_codes fixed length character string lenght 8
Customer
( CustomerID CustomerIDS NOT NULL
CustomerName Char 30 NOT NULL
Street Street_names NOT NULL
PostCode Post_codes NOT
NULL)
Primary Key CustomerID
The physical design of the Customer Table using DBDL
Domain CustomerIDS fixed length character string length 5
Domain Street_names variable length character string maximum
length 20
Domain Post_codes fixed length character string lenght 8
Customer
( CustomerID CustomerIDS NOT NULL
CustomerName Char 30 NOT NULL
Street Street_names NOT NULL
PostCode Post_codes NOT NULL)
Primary Key CustomerID
Activity: write the SQL to implement this table.
Data Definition - 1
Create table customers
(CustomerID char not null,
CustomerName varchar(20) not null,
Street char(20) not null,
PostCode char(8) not null,
primary key CustomerID);
Data Definition - 2
Create table customers
(CustomerID char not null,
CustomerName varchar(20) not null,
Street char(20) not null,
PostCode char(8) not null,
primary key CustomerID);
The table name
Here the columns are defined.
The datatypes
are specfied along with the
length in brackets.
If a columns is specified as
NOT NULL then it
is mandatory and must be
populated when a
new row is created.
CASE(Computer Aided Software
Engineering) Tools
 Has a repository to store definitions of structures like entities and attributes
 SQL scripts can be generated from definitions
 Developers still need to be able to write their own SQL!
CASE Tools Functionality
CASE tools can serve many functions in database design, including:
 Collecting and analyzing data
 Designing a data model
 Feasibility analysis
 Requirements definition
 Implementing the database
 Prototyping
 Data conversion
 Generating application code
 Generating reports
 Programming and testing
 Maintenance
CASE Tools Advantages
CASE tools can provide many advantages when used in database
design, including:
 Improved productivity in development
 Improved quality through automated checking
 Automatic preparation and update of documentation
 Encouragement of prototyping and incremental development
 Automatic preparation of program code from requirements definition
 Reduced maintenance systems
CASE Tools Disadvantages
However, there are also some disadvantages to using the tools in
database design, including:
 Cost increase
 Need for specialized training
 Limitations in flexibility of documentation
 Inadequate standardization
 Slow implementation
 Unrealistic expectations
CASE Tools
 There are three different types of CASE tools: upper, lower, and
integrated. Upper CASE tools focus on concept-level products and
tend to ignore design, lower CASE tools concentrate on details of
design such as physical design and testing, and integrated CASE tools
combine the two to support the entire development.
 The most useful type in database design is integrated CASE tools.
Some of the common packages on the market today include:
 IEF (Information Engineering Facility)
 IEW (Information Engineering Workbench)
 Oracle Designer
Primary Key
Create table customers
(CustomerID char not null,
CustomerName varchar(20)
not null,
Street char(20) not null,
PostCode char(8) not null,
primary key CustomerID);
Primary Key
defined in
different
places
Create table customers
(CustomerID char not null
primary key,
CustomerName varchar(20)
not null,
Street char(20) not null,
PostCode char(8) not null);
Foreign Key
 Item
 (ItemID, ItemName, Price, SupplierID)
 Primary Key (ItemID
 Supplier
 (SupplierID, SupplierName)
 Primary Key SupplierID)
Create table Item
(ItemID char (5) not null,
ItemName char(30),
Price float (3),
SupplierID number(5),
primary key ItemID,
foreign key (SupplierID)
references
Supplier(SupplierID));
Create Domain
 Explicitly create a domain:
Create domain Allowable_Colours as Char
Default ‘Red’
Check (Value in (‘Red’,’Blue’,’Green’));
Constraint
 SQL Server contains the following 6 types of constraints:
 Not Null Constraint
 Check Constraint
 Default Constraint
 Unique Constraint
 Primary Constraint
 Foreign Constraint
Not Null Constraint
Check Constraint
Default Constraint
Unique Constraint
Domain Constraint
Adding a Foreign Key Later
 ALTER TABLE ORDERS
ADD FOREIGN KEY (customer_id) REFERENCES
CUSTOMER(customer_id);
Example of Adding a Column using
Alter Table
 ALTER TABLE job_type
ADD salary FLOAT;
Modifying Tables using SQL
 Add an extra column
 Drop a column from a table
 Modify the maximum length of the table
 Add a new constraint
 Drop a constraint
 Set a default for a column
 Drop a default for a column
Example of Adding a Column using
Alter Table
ALTER TABLE job_type
ADD salary FLOAT;

What is Derived Data?
 A column whose value can be found be examining the values of other
columns
alter table student add age as (DATEDIFF(YY,DOB,GETDATE()))
alter table item add price_peritem as
(quantity*item_price)
Topic Room NoOfStudents
Chemistry 87 30
Mathematics 99 12
English 32 23
Computing 55 30
What is a derived column here?
Where might it be derived from?
Table: AcademicClasses
Representation of Derived Data
 Not always represented in the data model
 Represented when there is a danger of losing the information
 Derived attributes shown with a ‘/’ in front
Topic (PK)
Room
/noOfStudents
Entity: AcademicClass
Topic (PK)
Room
/noOfStudents
AcademicClass
StudentID (PK)
Name
Address
Count(Student.StudentID)
Student
Topic (PK)
Room
/noOfStudents
AcademicClass
StudentID (PK)
Name
Address
Topic(FK)
Count(Student.StudentID) AcademicClass.Topic =
Student.Topic
Student
Why do we Count the StudentIDs ?
Adding Pseudo-Code
What Sort of Documents/ Applications will
use Derived Fields? - 1
 Activity: Brainstorm – write down as many documents or applications
that might use derived fields in a business.
What Sort of Documents/ Applications will
use Derived Fields? - 2
 Activity: Brainstorm – write down as many documents or applications
that might use derived fields in a business.
Receipts
Invoices
Order Forms
Using Derived Data to think about a Data
Model
 Remember data modelling is about semantics, the meaning of the
data.
Customer Order Sheet for an Art Supplier
Customer Number: 37
Customer Name: Jagpal Singh
Customer Type Code: RC
Customer Type Description: Retail Customer
Item Number Item Name Supplier ID Price Supplier Name Quantity
099 Basic Paint Set S1 £3 Smith and Co 1
0100 Sable Brush Set S2 £3.50 Acro 1
0101 Extended Colour
Set
S1 £3.75 Smith and Co 3
098 Metallic Paint Set S1 £3.99 Smith and Co 1
078 Mixed Brush Set S2 £3.99 Acro 2
Original Customer Order Sheet for
Art Supply Shop
Customer Order Sheet for an Art Supplier
Customer Number: 37
Customer Name: Jagpal Singh
Customer Type Code: RC
Customer Type Description: Retail Customer
Item Number Item Name Supplier ID Price Supplier Name Quantity
099 Basic Paint Set S1 £3 Smith and Co 1
0100 Sable Brush Set S2 £3.50 Acro 1
0101 Extended Colour
Set
S1 £3.75 Smith and Co 3
098 Metallic Paint Set S1 £3.99 Smith and Co 1
078 Mixed Brush Set S2 £3.99 Acro 2
Total: 29.72
£3.00
£3.50
£11.25
£3.99
£7.98
Item
Total
Order ID: 4343
Adding a Total for Each Item and
the Order Itself
© NCC Education LimitedV1.0
Physical Design (2) Topic 7 - 7.49
Customer CustomerItem Item
Supplier
1 1
1
0...*
0...* 0...*
The Entity Relationship Diagram
© NCC Education LimitedV1.0
Physical Design (2) Topic 7 - 7.50
Order OrderItem Item
Supplier
1 1
1
0...*
0...* 0...*
Customer
1
0...*
The Modified Entity Relationship
Diagram
© NCC Education LimitedV1.0
Physical Design (2) Topic 7 - 7.51
Order OrderItem Item
Supplier
1 1
1
0...*
0...* 0...*
Customer
1
0...*
OrderItem
OrderID (PK) (FK)
ItemID (PK) (FK)
Amount
/ItemTotal (Amount * Item.Price Where OrderItem.ItemID = Item.ItemID
The Modified Entity Relationship
Diagram – Deriving Totals for Each Item
© NCC Education LimitedV1.0
Physical Design (2) Topic 7 - 7.52
Order OrderItem Item
Supplier
1 1
1
0...*
0...* 0...*
Customer
1
0...*
Order
OrderID (PK)
CustomerID(FK)
Date
/Total (Sum(OrderItem.ItemTotal) Where OrderItem.OrderID = Order.OrderID
The Modified Entity Relationship
Diagram – Deriving Total for Order
© NCC Education LimitedV1.0
Physical Design (2) Topic 7 - 7.53
Orders OrderItems Items
Suppliers
1 1
1
0...*
0...* 0...*
Customers
1
0...*
Step 1. Customer makes an order
Create new row in Orders table
How it Works Physically - 1
© NCC Education LimitedV1.0
Physical Design (2) Topic 7 - 7.54
Orders OrderItems Items
Suppliers
1 1
1
0...*
0...* 0...*
Customers
1
0...*
Step 2. A number of rows are created in
The OrderItems table
Step 3. For each OrderItem the
Total is calculated.
How it Works Physically - 2
© NCC Education LimitedV1.0
Physical Design (2) Topic 7 - 7.55
Orders OrderItems Items
Suppliers
1 1
1
0...*
0...* 0...*
Customers
1
0...*
Step 4. For the Order the Total is
calculated
How it Works Physically - 3
Overheads of Derived Data
 Additional storage of extra attribute
 New calculation every time a value in the source field is changed
 Possibility of data becoming inconsistant
Calculating at Run Time
 The Order Form and similar documents such as invoices and receipts
would be created as applications
 The totals calculated as they are needed
 Totals not stored in database: no derived fields
© NCC Education LimitedV1.0
Physical Design (2) Topic 7 - 7.58
Paper Based Report
Screen based Form or Report
Step 1. Report or Form
run.
© NCC Education LimitedV1.0
Physical Design (2) Topic 7 - 7.59
Paper Based Report
Screen based Form or Report
Step 2. Data used to
calculate data that is derived
from other data.
© NCC Education LimitedV1.0
Physical Design (2) Topic 7 - 7.60
Paper Based Report
Screen based Form or Report
Step 3. Data and
derived field sent to
application
Aggregate Functions that can be used to
Derive Data
 Count – returns number of values in a column
 Sum – returns the sum total of values of a column
 Avg – returns the mean average of values in column
 Min – returns the lowest value in a column
 Max – returns the highest value in a column
Standard SQL for Derived Column in
Create Table Statement
CREATE TABLE ProductsStock
(
...
Product_itemID INTEGER NOT NULL,
list_price DECIMAL(7,2) NOT NULL,
Quantity INTEGER NOT NULL,
stock_value GENERATED ALWAYS AS (Quanity *
list_price),
...
)
Example of Insert Statement with Derived
Data
INSERT INTO employee_year_earnings
SELECT employee_id, salary*12
FROM employees;
Derived Attribute or Calculation at Run
Time?
 How complicated is the calculation to be made?
 Does it involve multiple table joins and so could impact performance?
 How often would a derived attribute be updated? Could this affect
performance.
Other Types of Derived Fields – Non
Numeric
 Potentially any type of business rule could be used to derive data
 e.g. Items of a particular sort will all be the same colour
 Would need to used more complex embedded procedural logic such
as a database trigger or macro
PL(Procedural Language)-SQL
 PL/SQL is the language to use when writing code that resides in the database.
 The purpose of PL/SQL is to combine database language and procedural
programming language.
 The basic unit in PL/SQL is called a block, which is made up of three parts: a
declarative part, an executable part, and an exception-building part.
PL(Procedural Language)-SQL
SQL Server: Declare Variables
DECLARE @first_name VARCHAR(50);
DECLARE @student_id int;
DECLARE @dob date;
PL(Procedural Language)-SQL
SQL Server: Declare Variables
DECLARE @first_name VARCHAR(50);
DECLARE @student_id int;
DECLARE @dob date;
DECLARE @test VARCHAR(50) = 'Example showing how to declare variable';
DECLARE @Age INT = 40;
PL(Procedural Language)-SQL
Conditional Statements
DECLARE @age INT;
SET @age= 15;
IF @age< 25
PRINT ‘You are Younger’;
ELSE
PRINT ‘You are Elder ';
Nested Else If
DECLARE @age INT;
SET @age= (select age from person);
IF @age< 25
PRINT ‘Younger’;
ELSE
BEGIN
IF @age< 50
PRINT ‘Print Something';
ELSE
PRINT ‘Elder';
END;
Loop/while
DECLARE @site_value INT;
SET @site_value = 0;
WHILE @site_value <= 10
BEGIN
PRINT 'Inside WHILE LOOP on TechOnTheNet.com';
SET @site_value = @site_value + 1;
END;
PRINT 'Done WHILE LOOP on TechOnTheNet.com';
GO
Break and Continue
DECLARE @site_value INT;
SET @site_value = 0;
WHILE @site_value <= 10
BEGIN
IF @site_value = 2
BREAK;
ELSE
PRINT 'Inside WHILE LOOP on TechOnTheNet.com';
SET @site_value = @site_value + 1;
END;
Break and Continue
Break and Continue
Stored Procedure
A stored procedure is a set of Structured Query
Language (SQL) statements with an assigned name,
which are stored in a relational database management
system as a group, so it can be reused and shared by
multiple programs.
Stored Procedure
CREATE proc get_all_courses AS
SELECT * FROM courses;
Execute get_all_courses;
-- Creating Stored Procedure with parameters
CREATE proc get_course_name @course_id INT AS
SELECT course_name FROM courses WHERE course_id = @course_id;
EXEC get_course_name 1;
Stored Procedure
-- Creating Stored Procedure with 2 parameters
CREATE proc get_course_name @course_id INT , @course_name varchar(20)
as
SELECT course_name FROM courses WHERE course_id = @course_id and
course_name=@course_name;
EXEC get_course_name 1,’Computing Science’;
Trigger
Triggers are a specialized type of stored procedure that can be written to act on a table action
such as an INSERT, UPDATE, or DELETE
Trigger
CREATE TABLE job_log (
job_log_id INT PRIMARY KEY identity,
job_action TEXT,
action_date_time DATETIME
);
Create table jobs
(
Job_id int primary key identity,
Job_type varchar(30)
)
CREATE TRIGGER job_trigger ON jobs FOR INSERT AS
PRINT 'Data Inserted’;
--Now insert single row of data and see the result.
Trigger
CREATE TRIGGER job_insert_trigger ON jobs FOR INSERT AS
PRINT 'Data Inserted’;
INSERT INTO job_log (job_action, action_date_time) VALUES ('Data is Inserted.',
CURRENT_TIMESTAMP);
System table use in Trigger
INSERTED: This table is use to store last inserted row.
DELETED: This table is use to store last deleted row.
System table use in Trigger
ALTER TRIGGER job_delete_trigger ON jobs FOR DELETE AS
DECLARE @job_id INT = 0;
SELECT @job_id = job_id FROM deleted;
print @job_id;
IF @job_id = ''
print 'No row deleted.';
ELSE
INSERT INTO job_log (job_action, action_date_time) VALUES ('Data is being deleted.',CURRENT_TIMESTAMP);
CREATE TRIGGER job_last_insert_row ON jobs FOR INSERT AS
SELECT * FROM inserted
Log System using Trigger
Learning Outcomes
 By the end of this unit students will be able to:
 Understand the concept of derived data
 Design a representation of derived data
 Recognise the tradeoffs between different ways of implementing derived data
Did we meet them?
References - 1
 Connolly, Thomas M., and Begg, Carolyn E., Database Systems: A
Practical Approach to Design and Implementation Addision-Wesley,
Fourth Edition 2005 Chapter 17
 Connolly, Thomas and Begg, Carolyn Database Solutions: A step-by-
step guide to building database Addison-Wesley 2nd Edition 2004
Chapter 12
References - 2
 The Derivation in the Data Model at
http://wiki.webratio.com/index.php/The_derivation_in_the_data_mod
el Retrieved 7th June 2011
 SQL derived data
http://forums.mysql.com/read.php?10,361286,361286 Retrieved 20th
July 2011
References 3
 Connolly, Thomas and Begg, Carolyn Database Solutions: A step-by-step guide
to building database Addison-Wesley 2nd Edition 2004 Chapter 12
 Choosing a database
http://databases.about.com/od/administration/a/choosing_a_db.htm
Accessed 1st June 2011
 Examples of different vendor’s SQL syntax http://www.1keydata.com/sql/sql-
foreign-key.html
Accessed 5th June 2011
ANY QUESTIONS?

Weitere ähnliche Inhalte

Was ist angesagt?

Introduction to Database Concepts
Introduction to Database ConceptsIntroduction to Database Concepts
Introduction to Database ConceptsRosalyn Lemieux
 
Database Concepts and Components
Database Concepts and ComponentsDatabase Concepts and Components
Database Concepts and ComponentsRIAH ENCARNACION
 
Relational Database Design
Relational Database DesignRelational Database Design
Relational Database DesignArchit Saxena
 
Mca ii-dbms- u-ii-the relational database model
Mca ii-dbms- u-ii-the relational database modelMca ii-dbms- u-ii-the relational database model
Mca ii-dbms- u-ii-the relational database modelRai University
 
Database Concepts and Terminologies
Database Concepts and TerminologiesDatabase Concepts and Terminologies
Database Concepts and TerminologiesOusman Faal
 
Database system concepts
Database system conceptsDatabase system concepts
Database system conceptsKumar
 
Introduction to database & sql
Introduction to database & sqlIntroduction to database & sql
Introduction to database & sqlzahid6
 
Week 4 The Relational Data Model & The Entity Relationship Data Model
Week 4 The Relational Data Model & The Entity Relationship Data ModelWeek 4 The Relational Data Model & The Entity Relationship Data Model
Week 4 The Relational Data Model & The Entity Relationship Data Modeloudesign
 
Database Systems - Introduction to Database Design (Chapter 4/1)
Database Systems - Introduction to Database Design (Chapter 4/1)Database Systems - Introduction to Database Design (Chapter 4/1)
Database Systems - Introduction to Database Design (Chapter 4/1)Vidyasagar Mundroy
 
Bca examination 2017 dbms
Bca examination 2017 dbmsBca examination 2017 dbms
Bca examination 2017 dbmsAnjaan Gajendra
 
ADVANCE DATABASE MANAGEMENT SYSTEM CONCEPTS & ARCHITECTURE by vikas jagtap
ADVANCE DATABASE MANAGEMENT SYSTEM CONCEPTS & ARCHITECTURE by vikas jagtapADVANCE DATABASE MANAGEMENT SYSTEM CONCEPTS & ARCHITECTURE by vikas jagtap
ADVANCE DATABASE MANAGEMENT SYSTEM CONCEPTS & ARCHITECTURE by vikas jagtapVikas Jagtap
 
Week 1 Before the Advent of Database Systems & Fundamental Concepts
Week 1 Before the Advent of Database Systems & Fundamental ConceptsWeek 1 Before the Advent of Database Systems & Fundamental Concepts
Week 1 Before the Advent of Database Systems & Fundamental Conceptsoudesign
 
Relational database revised
Relational database revisedRelational database revised
Relational database revisedmnodalo
 
Chapter12 designing databases
Chapter12 designing databasesChapter12 designing databases
Chapter12 designing databasesDhani Ahmad
 
overview of database concept
overview of database conceptoverview of database concept
overview of database conceptgourav kottawar
 
Database Management Systems 1
Database Management Systems 1Database Management Systems 1
Database Management Systems 1Nickkisha Farrell
 

Was ist angesagt? (20)

Introduction to Database Concepts
Introduction to Database ConceptsIntroduction to Database Concepts
Introduction to Database Concepts
 
Fundamentals of Database Design
Fundamentals of Database DesignFundamentals of Database Design
Fundamentals of Database Design
 
Database Concepts and Components
Database Concepts and ComponentsDatabase Concepts and Components
Database Concepts and Components
 
Relational Database Design
Relational Database DesignRelational Database Design
Relational Database Design
 
Database
DatabaseDatabase
Database
 
Mca ii-dbms- u-ii-the relational database model
Mca ii-dbms- u-ii-the relational database modelMca ii-dbms- u-ii-the relational database model
Mca ii-dbms- u-ii-the relational database model
 
Database Concepts and Terminologies
Database Concepts and TerminologiesDatabase Concepts and Terminologies
Database Concepts and Terminologies
 
Database system concepts
Database system conceptsDatabase system concepts
Database system concepts
 
Introduction to database & sql
Introduction to database & sqlIntroduction to database & sql
Introduction to database & sql
 
Database concepts
Database conceptsDatabase concepts
Database concepts
 
Week 4 The Relational Data Model & The Entity Relationship Data Model
Week 4 The Relational Data Model & The Entity Relationship Data ModelWeek 4 The Relational Data Model & The Entity Relationship Data Model
Week 4 The Relational Data Model & The Entity Relationship Data Model
 
Database Systems - Introduction to Database Design (Chapter 4/1)
Database Systems - Introduction to Database Design (Chapter 4/1)Database Systems - Introduction to Database Design (Chapter 4/1)
Database Systems - Introduction to Database Design (Chapter 4/1)
 
Bca examination 2017 dbms
Bca examination 2017 dbmsBca examination 2017 dbms
Bca examination 2017 dbms
 
ADVANCE DATABASE MANAGEMENT SYSTEM CONCEPTS & ARCHITECTURE by vikas jagtap
ADVANCE DATABASE MANAGEMENT SYSTEM CONCEPTS & ARCHITECTURE by vikas jagtapADVANCE DATABASE MANAGEMENT SYSTEM CONCEPTS & ARCHITECTURE by vikas jagtap
ADVANCE DATABASE MANAGEMENT SYSTEM CONCEPTS & ARCHITECTURE by vikas jagtap
 
Week 1 Before the Advent of Database Systems & Fundamental Concepts
Week 1 Before the Advent of Database Systems & Fundamental ConceptsWeek 1 Before the Advent of Database Systems & Fundamental Concepts
Week 1 Before the Advent of Database Systems & Fundamental Concepts
 
Relational database revised
Relational database revisedRelational database revised
Relational database revised
 
Chapter12 designing databases
Chapter12 designing databasesChapter12 designing databases
Chapter12 designing databases
 
overview of database concept
overview of database conceptoverview of database concept
overview of database concept
 
Dbms models
Dbms modelsDbms models
Dbms models
 
Database Management Systems 1
Database Management Systems 1Database Management Systems 1
Database Management Systems 1
 

Ähnlich wie Physical Design and Development

MIS5101 WK10 Outcome Measures
MIS5101 WK10 Outcome MeasuresMIS5101 WK10 Outcome Measures
MIS5101 WK10 Outcome MeasuresSteven Johnson
 
Lecture05sql 110406195130-phpapp02
Lecture05sql 110406195130-phpapp02Lecture05sql 110406195130-phpapp02
Lecture05sql 110406195130-phpapp02Lalit009kumar
 
NoSQL - A Closer Look to Couchbase
NoSQL - A Closer Look to CouchbaseNoSQL - A Closer Look to Couchbase
NoSQL - A Closer Look to CouchbaseMohammad Shaker
 
3._DWH_Architecture__Components.ppt
3._DWH_Architecture__Components.ppt3._DWH_Architecture__Components.ppt
3._DWH_Architecture__Components.pptBsMath3rdsem
 
Analysis Services en SQL Server 2008
Analysis Services en SQL Server 2008Analysis Services en SQL Server 2008
Analysis Services en SQL Server 2008Eduardo Castro
 
Jdbc Dao it-slideshares.blogspot.com
Jdbc Dao it-slideshares.blogspot.comJdbc Dao it-slideshares.blogspot.com
Jdbc Dao it-slideshares.blogspot.comphanleson
 
chap 7.ppt(sql).ppt
chap 7.ppt(sql).pptchap 7.ppt(sql).ppt
chap 7.ppt(sql).pptarjun431527
 
BTEC- HND In Computing-Creating Table_Week6.pptx
BTEC- HND In Computing-Creating Table_Week6.pptxBTEC- HND In Computing-Creating Table_Week6.pptx
BTEC- HND In Computing-Creating Table_Week6.pptxTTKCreation
 
Analytic Views in Oracle 12.2
Analytic Views in Oracle 12.2Analytic Views in Oracle 12.2
Analytic Views in Oracle 12.2Kim Berg Hansen
 
Oracle data integrator project
Oracle data integrator projectOracle data integrator project
Oracle data integrator projectAmit Sharma
 
Database Performance
Database PerformanceDatabase Performance
Database PerformanceBoris Hristov
 
MSBI and Data WareHouse techniques by Quontra
MSBI and Data WareHouse techniques by Quontra MSBI and Data WareHouse techniques by Quontra
MSBI and Data WareHouse techniques by Quontra QUONTRASOLUTIONS
 

Ähnlich wie Physical Design and Development (20)

MIS5101 WK10 Outcome Measures
MIS5101 WK10 Outcome MeasuresMIS5101 WK10 Outcome Measures
MIS5101 WK10 Outcome Measures
 
Lecture05sql 110406195130-phpapp02
Lecture05sql 110406195130-phpapp02Lecture05sql 110406195130-phpapp02
Lecture05sql 110406195130-phpapp02
 
NoSQL - A Closer Look to Couchbase
NoSQL - A Closer Look to CouchbaseNoSQL - A Closer Look to Couchbase
NoSQL - A Closer Look to Couchbase
 
D.dsgn + dbms
D.dsgn + dbmsD.dsgn + dbms
D.dsgn + dbms
 
3._DWH_Architecture__Components.ppt
3._DWH_Architecture__Components.ppt3._DWH_Architecture__Components.ppt
3._DWH_Architecture__Components.ppt
 
Analysis Services en SQL Server 2008
Analysis Services en SQL Server 2008Analysis Services en SQL Server 2008
Analysis Services en SQL Server 2008
 
Jdbc Dao it-slideshares.blogspot.com
Jdbc Dao it-slideshares.blogspot.comJdbc Dao it-slideshares.blogspot.com
Jdbc Dao it-slideshares.blogspot.com
 
Introduction to sql
Introduction to sqlIntroduction to sql
Introduction to sql
 
chap 7.ppt(sql).ppt
chap 7.ppt(sql).pptchap 7.ppt(sql).ppt
chap 7.ppt(sql).ppt
 
Sql server T-sql basics ppt-3
Sql server T-sql basics  ppt-3Sql server T-sql basics  ppt-3
Sql server T-sql basics ppt-3
 
Module02
Module02Module02
Module02
 
Chap 7
Chap 7Chap 7
Chap 7
 
BTEC- HND In Computing-Creating Table_Week6.pptx
BTEC- HND In Computing-Creating Table_Week6.pptxBTEC- HND In Computing-Creating Table_Week6.pptx
BTEC- HND In Computing-Creating Table_Week6.pptx
 
SQL
SQL SQL
SQL
 
Analytic Views in Oracle 12.2
Analytic Views in Oracle 12.2Analytic Views in Oracle 12.2
Analytic Views in Oracle 12.2
 
Oracle data integrator project
Oracle data integrator projectOracle data integrator project
Oracle data integrator project
 
Database Performance
Database PerformanceDatabase Performance
Database Performance
 
Rdbms day3
Rdbms day3Rdbms day3
Rdbms day3
 
Metadata Creation In OBIEE
Metadata Creation In OBIEEMetadata Creation In OBIEE
Metadata Creation In OBIEE
 
MSBI and Data WareHouse techniques by Quontra
MSBI and Data WareHouse techniques by Quontra MSBI and Data WareHouse techniques by Quontra
MSBI and Data WareHouse techniques by Quontra
 

Mehr von Er. Nawaraj Bhandari

Data mining approaches and methods
Data mining approaches and methodsData mining approaches and methods
Data mining approaches and methodsEr. Nawaraj Bhandari
 
Research trends in data warehousing and data mining
Research trends in data warehousing and data miningResearch trends in data warehousing and data mining
Research trends in data warehousing and data miningEr. Nawaraj Bhandari
 
Mining Association Rules in Large Database
Mining Association Rules in Large DatabaseMining Association Rules in Large Database
Mining Association Rules in Large DatabaseEr. Nawaraj Bhandari
 
Introduction to data mining and data warehousing
Introduction to data mining and data warehousingIntroduction to data mining and data warehousing
Introduction to data mining and data warehousingEr. Nawaraj Bhandari
 
Classification and prediction in data mining
Classification and prediction in data miningClassification and prediction in data mining
Classification and prediction in data miningEr. Nawaraj Bhandari
 
Chapter 3: Simplification of Boolean Function
Chapter 3: Simplification of Boolean FunctionChapter 3: Simplification of Boolean Function
Chapter 3: Simplification of Boolean FunctionEr. Nawaraj Bhandari
 
Chapter 5: Cominational Logic with MSI and LSI
Chapter 5: Cominational Logic with MSI and LSIChapter 5: Cominational Logic with MSI and LSI
Chapter 5: Cominational Logic with MSI and LSIEr. Nawaraj Bhandari
 
Chapter 2: Boolean Algebra and Logic Gates
Chapter 2: Boolean Algebra and Logic GatesChapter 2: Boolean Algebra and Logic Gates
Chapter 2: Boolean Algebra and Logic GatesEr. Nawaraj Bhandari
 
Introduction to Electronic Commerce
Introduction to Electronic CommerceIntroduction to Electronic Commerce
Introduction to Electronic CommerceEr. Nawaraj Bhandari
 
Using macros in microsoft excel part 2
Using macros in microsoft excel   part 2Using macros in microsoft excel   part 2
Using macros in microsoft excel part 2Er. Nawaraj Bhandari
 
Using macros in microsoft excel part 1
Using macros in microsoft excel   part 1Using macros in microsoft excel   part 1
Using macros in microsoft excel part 1Er. Nawaraj Bhandari
 

Mehr von Er. Nawaraj Bhandari (20)

Data mining approaches and methods
Data mining approaches and methodsData mining approaches and methods
Data mining approaches and methods
 
Research trends in data warehousing and data mining
Research trends in data warehousing and data miningResearch trends in data warehousing and data mining
Research trends in data warehousing and data mining
 
Mining Association Rules in Large Database
Mining Association Rules in Large DatabaseMining Association Rules in Large Database
Mining Association Rules in Large Database
 
Introduction to data mining and data warehousing
Introduction to data mining and data warehousingIntroduction to data mining and data warehousing
Introduction to data mining and data warehousing
 
Data warehouse testing
Data warehouse testingData warehouse testing
Data warehouse testing
 
Data warehouse physical design
Data warehouse physical designData warehouse physical design
Data warehouse physical design
 
Data warehouse logical design
Data warehouse logical designData warehouse logical design
Data warehouse logical design
 
Classification and prediction in data mining
Classification and prediction in data miningClassification and prediction in data mining
Classification and prediction in data mining
 
Chapter 3: Simplification of Boolean Function
Chapter 3: Simplification of Boolean FunctionChapter 3: Simplification of Boolean Function
Chapter 3: Simplification of Boolean Function
 
Chapter 6: Sequential Logic
Chapter 6: Sequential LogicChapter 6: Sequential Logic
Chapter 6: Sequential Logic
 
Chapter 5: Cominational Logic with MSI and LSI
Chapter 5: Cominational Logic with MSI and LSIChapter 5: Cominational Logic with MSI and LSI
Chapter 5: Cominational Logic with MSI and LSI
 
Chapter 4: Combinational Logic
Chapter 4: Combinational LogicChapter 4: Combinational Logic
Chapter 4: Combinational Logic
 
Chapter 2: Boolean Algebra and Logic Gates
Chapter 2: Boolean Algebra and Logic GatesChapter 2: Boolean Algebra and Logic Gates
Chapter 2: Boolean Algebra and Logic Gates
 
Chapter 1: Binary System
 Chapter 1: Binary System Chapter 1: Binary System
Chapter 1: Binary System
 
Introduction to Electronic Commerce
Introduction to Electronic CommerceIntroduction to Electronic Commerce
Introduction to Electronic Commerce
 
Evaluating software development
Evaluating software developmentEvaluating software development
Evaluating software development
 
Using macros in microsoft excel part 2
Using macros in microsoft excel   part 2Using macros in microsoft excel   part 2
Using macros in microsoft excel part 2
 
Using macros in microsoft excel part 1
Using macros in microsoft excel   part 1Using macros in microsoft excel   part 1
Using macros in microsoft excel part 1
 
Using macros in microsoft access
Using macros in microsoft accessUsing macros in microsoft access
Using macros in microsoft access
 
Testing software development
Testing software developmentTesting software development
Testing software development
 

Kürzlich hochgeladen

PLE-statistics document for primary schs
PLE-statistics document for primary schsPLE-statistics document for primary schs
PLE-statistics document for primary schscnajjemba
 
怎样办理伦敦大学城市学院毕业证(CITY毕业证书)成绩单学校原版复制
怎样办理伦敦大学城市学院毕业证(CITY毕业证书)成绩单学校原版复制怎样办理伦敦大学城市学院毕业证(CITY毕业证书)成绩单学校原版复制
怎样办理伦敦大学城市学院毕业证(CITY毕业证书)成绩单学校原版复制vexqp
 
5CL-ADBA,5cladba, Chinese supplier, safety is guaranteed
5CL-ADBA,5cladba, Chinese supplier, safety is guaranteed5CL-ADBA,5cladba, Chinese supplier, safety is guaranteed
5CL-ADBA,5cladba, Chinese supplier, safety is guaranteedamy56318795
 
Top profile Call Girls In Vadodara [ 7014168258 ] Call Me For Genuine Models ...
Top profile Call Girls In Vadodara [ 7014168258 ] Call Me For Genuine Models ...Top profile Call Girls In Vadodara [ 7014168258 ] Call Me For Genuine Models ...
Top profile Call Girls In Vadodara [ 7014168258 ] Call Me For Genuine Models ...gajnagarg
 
怎样办理旧金山城市学院毕业证(CCSF毕业证书)成绩单学校原版复制
怎样办理旧金山城市学院毕业证(CCSF毕业证书)成绩单学校原版复制怎样办理旧金山城市学院毕业证(CCSF毕业证书)成绩单学校原版复制
怎样办理旧金山城市学院毕业证(CCSF毕业证书)成绩单学校原版复制vexqp
 
Top profile Call Girls In Purnia [ 7014168258 ] Call Me For Genuine Models We...
Top profile Call Girls In Purnia [ 7014168258 ] Call Me For Genuine Models We...Top profile Call Girls In Purnia [ 7014168258 ] Call Me For Genuine Models We...
Top profile Call Girls In Purnia [ 7014168258 ] Call Me For Genuine Models We...nirzagarg
 
SR-101-01012024-EN.docx Federal Constitution of the Swiss Confederation
SR-101-01012024-EN.docx  Federal Constitution  of the Swiss ConfederationSR-101-01012024-EN.docx  Federal Constitution  of the Swiss Confederation
SR-101-01012024-EN.docx Federal Constitution of the Swiss ConfederationEfruzAsilolu
 
一比一原版(UCD毕业证书)加州大学戴维斯分校毕业证成绩单原件一模一样
一比一原版(UCD毕业证书)加州大学戴维斯分校毕业证成绩单原件一模一样一比一原版(UCD毕业证书)加州大学戴维斯分校毕业证成绩单原件一模一样
一比一原版(UCD毕业证书)加州大学戴维斯分校毕业证成绩单原件一模一样wsppdmt
 
Top profile Call Girls In Satna [ 7014168258 ] Call Me For Genuine Models We ...
Top profile Call Girls In Satna [ 7014168258 ] Call Me For Genuine Models We ...Top profile Call Girls In Satna [ 7014168258 ] Call Me For Genuine Models We ...
Top profile Call Girls In Satna [ 7014168258 ] Call Me For Genuine Models We ...nirzagarg
 
Capstone in Interprofessional Informatic // IMPACT OF COVID 19 ON EDUCATION
Capstone in Interprofessional Informatic  // IMPACT OF COVID 19 ON EDUCATIONCapstone in Interprofessional Informatic  // IMPACT OF COVID 19 ON EDUCATION
Capstone in Interprofessional Informatic // IMPACT OF COVID 19 ON EDUCATIONLakpaYanziSherpa
 
Discover Why Less is More in B2B Research
Discover Why Less is More in B2B ResearchDiscover Why Less is More in B2B Research
Discover Why Less is More in B2B Researchmichael115558
 
DATA SUMMIT 24 Building Real-Time Pipelines With FLaNK
DATA SUMMIT 24  Building Real-Time Pipelines With FLaNKDATA SUMMIT 24  Building Real-Time Pipelines With FLaNK
DATA SUMMIT 24 Building Real-Time Pipelines With FLaNKTimothy Spann
 
如何办理英国诺森比亚大学毕业证(NU毕业证书)成绩单原件一模一样
如何办理英国诺森比亚大学毕业证(NU毕业证书)成绩单原件一模一样如何办理英国诺森比亚大学毕业证(NU毕业证书)成绩单原件一模一样
如何办理英国诺森比亚大学毕业证(NU毕业证书)成绩单原件一模一样wsppdmt
 
Top profile Call Girls In dimapur [ 7014168258 ] Call Me For Genuine Models W...
Top profile Call Girls In dimapur [ 7014168258 ] Call Me For Genuine Models W...Top profile Call Girls In dimapur [ 7014168258 ] Call Me For Genuine Models W...
Top profile Call Girls In dimapur [ 7014168258 ] Call Me For Genuine Models W...gajnagarg
 
怎样办理圣地亚哥州立大学毕业证(SDSU毕业证书)成绩单学校原版复制
怎样办理圣地亚哥州立大学毕业证(SDSU毕业证书)成绩单学校原版复制怎样办理圣地亚哥州立大学毕业证(SDSU毕业证书)成绩单学校原版复制
怎样办理圣地亚哥州立大学毕业证(SDSU毕业证书)成绩单学校原版复制vexqp
 
Dubai Call Girls Peeing O525547819 Call Girls Dubai
Dubai Call Girls Peeing O525547819 Call Girls DubaiDubai Call Girls Peeing O525547819 Call Girls Dubai
Dubai Call Girls Peeing O525547819 Call Girls Dubaikojalkojal131
 
+97470301568>>weed for sale in qatar ,weed for sale in dubai,weed for sale in...
+97470301568>>weed for sale in qatar ,weed for sale in dubai,weed for sale in...+97470301568>>weed for sale in qatar ,weed for sale in dubai,weed for sale in...
+97470301568>>weed for sale in qatar ,weed for sale in dubai,weed for sale in...Health
 

Kürzlich hochgeladen (20)

PLE-statistics document for primary schs
PLE-statistics document for primary schsPLE-statistics document for primary schs
PLE-statistics document for primary schs
 
怎样办理伦敦大学城市学院毕业证(CITY毕业证书)成绩单学校原版复制
怎样办理伦敦大学城市学院毕业证(CITY毕业证书)成绩单学校原版复制怎样办理伦敦大学城市学院毕业证(CITY毕业证书)成绩单学校原版复制
怎样办理伦敦大学城市学院毕业证(CITY毕业证书)成绩单学校原版复制
 
5CL-ADBA,5cladba, Chinese supplier, safety is guaranteed
5CL-ADBA,5cladba, Chinese supplier, safety is guaranteed5CL-ADBA,5cladba, Chinese supplier, safety is guaranteed
5CL-ADBA,5cladba, Chinese supplier, safety is guaranteed
 
Top profile Call Girls In Vadodara [ 7014168258 ] Call Me For Genuine Models ...
Top profile Call Girls In Vadodara [ 7014168258 ] Call Me For Genuine Models ...Top profile Call Girls In Vadodara [ 7014168258 ] Call Me For Genuine Models ...
Top profile Call Girls In Vadodara [ 7014168258 ] Call Me For Genuine Models ...
 
怎样办理旧金山城市学院毕业证(CCSF毕业证书)成绩单学校原版复制
怎样办理旧金山城市学院毕业证(CCSF毕业证书)成绩单学校原版复制怎样办理旧金山城市学院毕业证(CCSF毕业证书)成绩单学校原版复制
怎样办理旧金山城市学院毕业证(CCSF毕业证书)成绩单学校原版复制
 
Top profile Call Girls In Purnia [ 7014168258 ] Call Me For Genuine Models We...
Top profile Call Girls In Purnia [ 7014168258 ] Call Me For Genuine Models We...Top profile Call Girls In Purnia [ 7014168258 ] Call Me For Genuine Models We...
Top profile Call Girls In Purnia [ 7014168258 ] Call Me For Genuine Models We...
 
SR-101-01012024-EN.docx Federal Constitution of the Swiss Confederation
SR-101-01012024-EN.docx  Federal Constitution  of the Swiss ConfederationSR-101-01012024-EN.docx  Federal Constitution  of the Swiss Confederation
SR-101-01012024-EN.docx Federal Constitution of the Swiss Confederation
 
Sequential and reinforcement learning for demand side management by Margaux B...
Sequential and reinforcement learning for demand side management by Margaux B...Sequential and reinforcement learning for demand side management by Margaux B...
Sequential and reinforcement learning for demand side management by Margaux B...
 
一比一原版(UCD毕业证书)加州大学戴维斯分校毕业证成绩单原件一模一样
一比一原版(UCD毕业证书)加州大学戴维斯分校毕业证成绩单原件一模一样一比一原版(UCD毕业证书)加州大学戴维斯分校毕业证成绩单原件一模一样
一比一原版(UCD毕业证书)加州大学戴维斯分校毕业证成绩单原件一模一样
 
Top profile Call Girls In Satna [ 7014168258 ] Call Me For Genuine Models We ...
Top profile Call Girls In Satna [ 7014168258 ] Call Me For Genuine Models We ...Top profile Call Girls In Satna [ 7014168258 ] Call Me For Genuine Models We ...
Top profile Call Girls In Satna [ 7014168258 ] Call Me For Genuine Models We ...
 
Capstone in Interprofessional Informatic // IMPACT OF COVID 19 ON EDUCATION
Capstone in Interprofessional Informatic  // IMPACT OF COVID 19 ON EDUCATIONCapstone in Interprofessional Informatic  // IMPACT OF COVID 19 ON EDUCATION
Capstone in Interprofessional Informatic // IMPACT OF COVID 19 ON EDUCATION
 
Discover Why Less is More in B2B Research
Discover Why Less is More in B2B ResearchDiscover Why Less is More in B2B Research
Discover Why Less is More in B2B Research
 
Abortion pills in Doha Qatar (+966572737505 ! Get Cytotec
Abortion pills in Doha Qatar (+966572737505 ! Get CytotecAbortion pills in Doha Qatar (+966572737505 ! Get Cytotec
Abortion pills in Doha Qatar (+966572737505 ! Get Cytotec
 
DATA SUMMIT 24 Building Real-Time Pipelines With FLaNK
DATA SUMMIT 24  Building Real-Time Pipelines With FLaNKDATA SUMMIT 24  Building Real-Time Pipelines With FLaNK
DATA SUMMIT 24 Building Real-Time Pipelines With FLaNK
 
如何办理英国诺森比亚大学毕业证(NU毕业证书)成绩单原件一模一样
如何办理英国诺森比亚大学毕业证(NU毕业证书)成绩单原件一模一样如何办理英国诺森比亚大学毕业证(NU毕业证书)成绩单原件一模一样
如何办理英国诺森比亚大学毕业证(NU毕业证书)成绩单原件一模一样
 
Top profile Call Girls In dimapur [ 7014168258 ] Call Me For Genuine Models W...
Top profile Call Girls In dimapur [ 7014168258 ] Call Me For Genuine Models W...Top profile Call Girls In dimapur [ 7014168258 ] Call Me For Genuine Models W...
Top profile Call Girls In dimapur [ 7014168258 ] Call Me For Genuine Models W...
 
怎样办理圣地亚哥州立大学毕业证(SDSU毕业证书)成绩单学校原版复制
怎样办理圣地亚哥州立大学毕业证(SDSU毕业证书)成绩单学校原版复制怎样办理圣地亚哥州立大学毕业证(SDSU毕业证书)成绩单学校原版复制
怎样办理圣地亚哥州立大学毕业证(SDSU毕业证书)成绩单学校原版复制
 
Dubai Call Girls Peeing O525547819 Call Girls Dubai
Dubai Call Girls Peeing O525547819 Call Girls DubaiDubai Call Girls Peeing O525547819 Call Girls Dubai
Dubai Call Girls Peeing O525547819 Call Girls Dubai
 
+97470301568>>weed for sale in qatar ,weed for sale in dubai,weed for sale in...
+97470301568>>weed for sale in qatar ,weed for sale in dubai,weed for sale in...+97470301568>>weed for sale in qatar ,weed for sale in dubai,weed for sale in...
+97470301568>>weed for sale in qatar ,weed for sale in dubai,weed for sale in...
 
Cytotec in Jeddah+966572737505) get unwanted pregnancy kit Riyadh
Cytotec in Jeddah+966572737505) get unwanted pregnancy kit RiyadhCytotec in Jeddah+966572737505) get unwanted pregnancy kit Riyadh
Cytotec in Jeddah+966572737505) get unwanted pregnancy kit Riyadh
 

Physical Design and Development

  • 1. Er. Nawaraj Bhandari Database Design & Development Topic 6&7: Physical Design 1
  • 2. Recap of Phases of Database Design - 1  Conceptual database design  Logical database design  Physical database design
  • 3. • Conceptual database design • Logical database design • Physical database design Recap of Phases of Database Design - 2 Activity: give a brief definition of the purposes of each of these phases and the difference between them.
  • 4. Conceptual Database Design  Conceptual database design involves understanding the data in an enterprise and modeling it without regard for any physical considerations or particular data models.
  • 5. Logical Database Design  Logical database design involves designing a model of the data in an enterprise that is independent of a particular DBMS but does take account of the chosen data model.
  • 6. Physical Database Design  Physical database design involves producing a design that describes the base relations and takes into account file organization, indexes, integrity constraints and security measures.
  • 7. The Purpose of Physical Design  Translates logical database structures (entities, attributes, relationships, and constraints) into a physical design.  The physical design should be suitable for implementation by the chosen DBMS
  • 8. Knowledge needed of Chosen DBMS  How to create base tables  Does the system support the definition of primary, foreign keys and alternate keys  Does the system support definition of required data (i.e. Definition of columns as NOT NULL)  Does the system support domains  Does the system system support relational integrity rules  Does the system support the definition of business rules
  • 9. Choosing a Database Product  Requirements – what suits the business  Budget  Compatibility with existing technology within organisaton  Support available  Strength of vendor
  • 10. Step 3 3.1 Design Base Tables (covered in this lecture) 3.2 Design representations of derived data (covered in this unit) 3.3 Design remaining business rules (covered in Unit (Unit 8).
  • 11. Step 4 4.1 Analyse transactions (covered in Unit 9) 4.2 Choose file organisations (covered in Unit 9) 4.3 Choose indexes (covered in Unit 8)
  • 12. Steps 5 to 8  Step 5 Design User Views (Covered in Unit 8 and 9)  Step 6 Design security mechanisms (Covered in Unit 8)  Step 7 Consider the introduction of controlled redundancy (de- normalisation)(Covered in Unit 9)  Step 8 Monitor and tune the operational system (Not covered)
  • 13. Design Base Tables  Collate the information about tables gathered during the logical design stage. Table: For each column: Name of Table Domain consisting of data type, length and any constraints List of Columns Optional default value Primary Keys and Foreign Keys Can the column be null? Referential Integrity constraints Is the column derived? (to be discussed later)
  • 14. The Entity Relationship Diagram for the Art Supply Shop Customer CustomerItem Item Supplier 1 1 1 0...* 0...* 0...* Outcome of Logical Design
  • 15. Customer CustomerItem Item Supplier 1 1 1 0...* 0...* 0...* Initial table structures for ‘Art Suppliers’ database. Customer (CustomerID, CustomerName, Street, Postcode) Primary Key CustomerID CustomerItem or Order (CustomerID, ItemID, Date, Time, Quanitity) Primary Key CustomerID, ItemID, Date Item (ItemID, ItemName, Price, SupplierID) Primary Key (ItemID Supplier (SupplierID, SupplierName) Primary Key SupplierID Tables at the outcome of Logical design
  • 16. The physical design of the Customer Table using DBDL Domain CustomerIDS fixed length character string length 5 Domain Street_names variable length character string maximum length 20 Domain Post_codes fixed length character string lenght 8 Customer ( CustomerID CustomerIDS NOT NULL CustomerName Char 30 NOT NULL Street Street_names NOT NULL PostCode Post_codes NOT NULL) Primary Key CustomerID
  • 17. The physical design of the Customer Table using DBDL Domain CustomerIDS fixed length character string length 5 Domain Street_names variable length character string maximum length 20 Domain Post_codes fixed length character string lenght 8 Customer ( CustomerID CustomerIDS NOT NULL CustomerName Char 30 NOT NULL Street Street_names NOT NULL PostCode Post_codes NOT NULL) Primary Key CustomerID Activity: write the SQL to implement this table.
  • 18. Data Definition - 1 Create table customers (CustomerID char not null, CustomerName varchar(20) not null, Street char(20) not null, PostCode char(8) not null, primary key CustomerID);
  • 19. Data Definition - 2 Create table customers (CustomerID char not null, CustomerName varchar(20) not null, Street char(20) not null, PostCode char(8) not null, primary key CustomerID); The table name Here the columns are defined. The datatypes are specfied along with the length in brackets. If a columns is specified as NOT NULL then it is mandatory and must be populated when a new row is created.
  • 20. CASE(Computer Aided Software Engineering) Tools  Has a repository to store definitions of structures like entities and attributes  SQL scripts can be generated from definitions  Developers still need to be able to write their own SQL!
  • 21. CASE Tools Functionality CASE tools can serve many functions in database design, including:  Collecting and analyzing data  Designing a data model  Feasibility analysis  Requirements definition  Implementing the database  Prototyping  Data conversion  Generating application code  Generating reports  Programming and testing  Maintenance
  • 22. CASE Tools Advantages CASE tools can provide many advantages when used in database design, including:  Improved productivity in development  Improved quality through automated checking  Automatic preparation and update of documentation  Encouragement of prototyping and incremental development  Automatic preparation of program code from requirements definition  Reduced maintenance systems
  • 23. CASE Tools Disadvantages However, there are also some disadvantages to using the tools in database design, including:  Cost increase  Need for specialized training  Limitations in flexibility of documentation  Inadequate standardization  Slow implementation  Unrealistic expectations
  • 24. CASE Tools  There are three different types of CASE tools: upper, lower, and integrated. Upper CASE tools focus on concept-level products and tend to ignore design, lower CASE tools concentrate on details of design such as physical design and testing, and integrated CASE tools combine the two to support the entire development.  The most useful type in database design is integrated CASE tools. Some of the common packages on the market today include:  IEF (Information Engineering Facility)  IEW (Information Engineering Workbench)  Oracle Designer
  • 25. Primary Key Create table customers (CustomerID char not null, CustomerName varchar(20) not null, Street char(20) not null, PostCode char(8) not null, primary key CustomerID); Primary Key defined in different places Create table customers (CustomerID char not null primary key, CustomerName varchar(20) not null, Street char(20) not null, PostCode char(8) not null);
  • 26. Foreign Key  Item  (ItemID, ItemName, Price, SupplierID)  Primary Key (ItemID  Supplier  (SupplierID, SupplierName)  Primary Key SupplierID) Create table Item (ItemID char (5) not null, ItemName char(30), Price float (3), SupplierID number(5), primary key ItemID, foreign key (SupplierID) references Supplier(SupplierID));
  • 27. Create Domain  Explicitly create a domain: Create domain Allowable_Colours as Char Default ‘Red’ Check (Value in (‘Red’,’Blue’,’Green’));
  • 28. Constraint  SQL Server contains the following 6 types of constraints:  Not Null Constraint  Check Constraint  Default Constraint  Unique Constraint  Primary Constraint  Foreign Constraint
  • 34. Adding a Foreign Key Later  ALTER TABLE ORDERS ADD FOREIGN KEY (customer_id) REFERENCES CUSTOMER(customer_id);
  • 35. Example of Adding a Column using Alter Table  ALTER TABLE job_type ADD salary FLOAT;
  • 36. Modifying Tables using SQL  Add an extra column  Drop a column from a table  Modify the maximum length of the table  Add a new constraint  Drop a constraint  Set a default for a column  Drop a default for a column
  • 37. Example of Adding a Column using Alter Table ALTER TABLE job_type ADD salary FLOAT; 
  • 38. What is Derived Data?  A column whose value can be found be examining the values of other columns alter table student add age as (DATEDIFF(YY,DOB,GETDATE())) alter table item add price_peritem as (quantity*item_price)
  • 39. Topic Room NoOfStudents Chemistry 87 30 Mathematics 99 12 English 32 23 Computing 55 30 What is a derived column here? Where might it be derived from? Table: AcademicClasses
  • 40. Representation of Derived Data  Not always represented in the data model  Represented when there is a danger of losing the information  Derived attributes shown with a ‘/’ in front
  • 43. Topic (PK) Room /noOfStudents AcademicClass StudentID (PK) Name Address Topic(FK) Count(Student.StudentID) AcademicClass.Topic = Student.Topic Student Why do we Count the StudentIDs ? Adding Pseudo-Code
  • 44. What Sort of Documents/ Applications will use Derived Fields? - 1  Activity: Brainstorm – write down as many documents or applications that might use derived fields in a business.
  • 45. What Sort of Documents/ Applications will use Derived Fields? - 2  Activity: Brainstorm – write down as many documents or applications that might use derived fields in a business. Receipts Invoices Order Forms
  • 46. Using Derived Data to think about a Data Model  Remember data modelling is about semantics, the meaning of the data.
  • 47. Customer Order Sheet for an Art Supplier Customer Number: 37 Customer Name: Jagpal Singh Customer Type Code: RC Customer Type Description: Retail Customer Item Number Item Name Supplier ID Price Supplier Name Quantity 099 Basic Paint Set S1 £3 Smith and Co 1 0100 Sable Brush Set S2 £3.50 Acro 1 0101 Extended Colour Set S1 £3.75 Smith and Co 3 098 Metallic Paint Set S1 £3.99 Smith and Co 1 078 Mixed Brush Set S2 £3.99 Acro 2 Original Customer Order Sheet for Art Supply Shop
  • 48. Customer Order Sheet for an Art Supplier Customer Number: 37 Customer Name: Jagpal Singh Customer Type Code: RC Customer Type Description: Retail Customer Item Number Item Name Supplier ID Price Supplier Name Quantity 099 Basic Paint Set S1 £3 Smith and Co 1 0100 Sable Brush Set S2 £3.50 Acro 1 0101 Extended Colour Set S1 £3.75 Smith and Co 3 098 Metallic Paint Set S1 £3.99 Smith and Co 1 078 Mixed Brush Set S2 £3.99 Acro 2 Total: 29.72 £3.00 £3.50 £11.25 £3.99 £7.98 Item Total Order ID: 4343 Adding a Total for Each Item and the Order Itself
  • 49. © NCC Education LimitedV1.0 Physical Design (2) Topic 7 - 7.49 Customer CustomerItem Item Supplier 1 1 1 0...* 0...* 0...* The Entity Relationship Diagram
  • 50. © NCC Education LimitedV1.0 Physical Design (2) Topic 7 - 7.50 Order OrderItem Item Supplier 1 1 1 0...* 0...* 0...* Customer 1 0...* The Modified Entity Relationship Diagram
  • 51. © NCC Education LimitedV1.0 Physical Design (2) Topic 7 - 7.51 Order OrderItem Item Supplier 1 1 1 0...* 0...* 0...* Customer 1 0...* OrderItem OrderID (PK) (FK) ItemID (PK) (FK) Amount /ItemTotal (Amount * Item.Price Where OrderItem.ItemID = Item.ItemID The Modified Entity Relationship Diagram – Deriving Totals for Each Item
  • 52. © NCC Education LimitedV1.0 Physical Design (2) Topic 7 - 7.52 Order OrderItem Item Supplier 1 1 1 0...* 0...* 0...* Customer 1 0...* Order OrderID (PK) CustomerID(FK) Date /Total (Sum(OrderItem.ItemTotal) Where OrderItem.OrderID = Order.OrderID The Modified Entity Relationship Diagram – Deriving Total for Order
  • 53. © NCC Education LimitedV1.0 Physical Design (2) Topic 7 - 7.53 Orders OrderItems Items Suppliers 1 1 1 0...* 0...* 0...* Customers 1 0...* Step 1. Customer makes an order Create new row in Orders table How it Works Physically - 1
  • 54. © NCC Education LimitedV1.0 Physical Design (2) Topic 7 - 7.54 Orders OrderItems Items Suppliers 1 1 1 0...* 0...* 0...* Customers 1 0...* Step 2. A number of rows are created in The OrderItems table Step 3. For each OrderItem the Total is calculated. How it Works Physically - 2
  • 55. © NCC Education LimitedV1.0 Physical Design (2) Topic 7 - 7.55 Orders OrderItems Items Suppliers 1 1 1 0...* 0...* 0...* Customers 1 0...* Step 4. For the Order the Total is calculated How it Works Physically - 3
  • 56. Overheads of Derived Data  Additional storage of extra attribute  New calculation every time a value in the source field is changed  Possibility of data becoming inconsistant
  • 57. Calculating at Run Time  The Order Form and similar documents such as invoices and receipts would be created as applications  The totals calculated as they are needed  Totals not stored in database: no derived fields
  • 58. © NCC Education LimitedV1.0 Physical Design (2) Topic 7 - 7.58 Paper Based Report Screen based Form or Report Step 1. Report or Form run.
  • 59. © NCC Education LimitedV1.0 Physical Design (2) Topic 7 - 7.59 Paper Based Report Screen based Form or Report Step 2. Data used to calculate data that is derived from other data.
  • 60. © NCC Education LimitedV1.0 Physical Design (2) Topic 7 - 7.60 Paper Based Report Screen based Form or Report Step 3. Data and derived field sent to application
  • 61. Aggregate Functions that can be used to Derive Data  Count – returns number of values in a column  Sum – returns the sum total of values of a column  Avg – returns the mean average of values in column  Min – returns the lowest value in a column  Max – returns the highest value in a column
  • 62. Standard SQL for Derived Column in Create Table Statement CREATE TABLE ProductsStock ( ... Product_itemID INTEGER NOT NULL, list_price DECIMAL(7,2) NOT NULL, Quantity INTEGER NOT NULL, stock_value GENERATED ALWAYS AS (Quanity * list_price), ... )
  • 63. Example of Insert Statement with Derived Data INSERT INTO employee_year_earnings SELECT employee_id, salary*12 FROM employees;
  • 64. Derived Attribute or Calculation at Run Time?  How complicated is the calculation to be made?  Does it involve multiple table joins and so could impact performance?  How often would a derived attribute be updated? Could this affect performance.
  • 65. Other Types of Derived Fields – Non Numeric  Potentially any type of business rule could be used to derive data  e.g. Items of a particular sort will all be the same colour  Would need to used more complex embedded procedural logic such as a database trigger or macro
  • 66. PL(Procedural Language)-SQL  PL/SQL is the language to use when writing code that resides in the database.  The purpose of PL/SQL is to combine database language and procedural programming language.  The basic unit in PL/SQL is called a block, which is made up of three parts: a declarative part, an executable part, and an exception-building part.
  • 67. PL(Procedural Language)-SQL SQL Server: Declare Variables DECLARE @first_name VARCHAR(50); DECLARE @student_id int; DECLARE @dob date;
  • 68. PL(Procedural Language)-SQL SQL Server: Declare Variables DECLARE @first_name VARCHAR(50); DECLARE @student_id int; DECLARE @dob date; DECLARE @test VARCHAR(50) = 'Example showing how to declare variable'; DECLARE @Age INT = 40;
  • 69. PL(Procedural Language)-SQL Conditional Statements DECLARE @age INT; SET @age= 15; IF @age< 25 PRINT ‘You are Younger’; ELSE PRINT ‘You are Elder ';
  • 70. Nested Else If DECLARE @age INT; SET @age= (select age from person); IF @age< 25 PRINT ‘Younger’; ELSE BEGIN IF @age< 50 PRINT ‘Print Something'; ELSE PRINT ‘Elder'; END;
  • 71. Loop/while DECLARE @site_value INT; SET @site_value = 0; WHILE @site_value <= 10 BEGIN PRINT 'Inside WHILE LOOP on TechOnTheNet.com'; SET @site_value = @site_value + 1; END; PRINT 'Done WHILE LOOP on TechOnTheNet.com'; GO
  • 72. Break and Continue DECLARE @site_value INT; SET @site_value = 0; WHILE @site_value <= 10 BEGIN IF @site_value = 2 BREAK; ELSE PRINT 'Inside WHILE LOOP on TechOnTheNet.com'; SET @site_value = @site_value + 1; END;
  • 75. Stored Procedure A stored procedure is a set of Structured Query Language (SQL) statements with an assigned name, which are stored in a relational database management system as a group, so it can be reused and shared by multiple programs.
  • 76. Stored Procedure CREATE proc get_all_courses AS SELECT * FROM courses; Execute get_all_courses; -- Creating Stored Procedure with parameters CREATE proc get_course_name @course_id INT AS SELECT course_name FROM courses WHERE course_id = @course_id; EXEC get_course_name 1;
  • 77. Stored Procedure -- Creating Stored Procedure with 2 parameters CREATE proc get_course_name @course_id INT , @course_name varchar(20) as SELECT course_name FROM courses WHERE course_id = @course_id and course_name=@course_name; EXEC get_course_name 1,’Computing Science’;
  • 78. Trigger Triggers are a specialized type of stored procedure that can be written to act on a table action such as an INSERT, UPDATE, or DELETE
  • 79. Trigger CREATE TABLE job_log ( job_log_id INT PRIMARY KEY identity, job_action TEXT, action_date_time DATETIME ); Create table jobs ( Job_id int primary key identity, Job_type varchar(30) ) CREATE TRIGGER job_trigger ON jobs FOR INSERT AS PRINT 'Data Inserted’; --Now insert single row of data and see the result.
  • 80. Trigger CREATE TRIGGER job_insert_trigger ON jobs FOR INSERT AS PRINT 'Data Inserted’; INSERT INTO job_log (job_action, action_date_time) VALUES ('Data is Inserted.', CURRENT_TIMESTAMP);
  • 81. System table use in Trigger INSERTED: This table is use to store last inserted row. DELETED: This table is use to store last deleted row.
  • 82. System table use in Trigger ALTER TRIGGER job_delete_trigger ON jobs FOR DELETE AS DECLARE @job_id INT = 0; SELECT @job_id = job_id FROM deleted; print @job_id; IF @job_id = '' print 'No row deleted.'; ELSE INSERT INTO job_log (job_action, action_date_time) VALUES ('Data is being deleted.',CURRENT_TIMESTAMP); CREATE TRIGGER job_last_insert_row ON jobs FOR INSERT AS SELECT * FROM inserted
  • 83. Log System using Trigger
  • 84. Learning Outcomes  By the end of this unit students will be able to:  Understand the concept of derived data  Design a representation of derived data  Recognise the tradeoffs between different ways of implementing derived data Did we meet them?
  • 85. References - 1  Connolly, Thomas M., and Begg, Carolyn E., Database Systems: A Practical Approach to Design and Implementation Addision-Wesley, Fourth Edition 2005 Chapter 17  Connolly, Thomas and Begg, Carolyn Database Solutions: A step-by- step guide to building database Addison-Wesley 2nd Edition 2004 Chapter 12
  • 86. References - 2  The Derivation in the Data Model at http://wiki.webratio.com/index.php/The_derivation_in_the_data_mod el Retrieved 7th June 2011  SQL derived data http://forums.mysql.com/read.php?10,361286,361286 Retrieved 20th July 2011
  • 87. References 3  Connolly, Thomas and Begg, Carolyn Database Solutions: A step-by-step guide to building database Addison-Wesley 2nd Edition 2004 Chapter 12  Choosing a database http://databases.about.com/od/administration/a/choosing_a_db.htm Accessed 1st June 2011  Examples of different vendor’s SQL syntax http://www.1keydata.com/sql/sql- foreign-key.html Accessed 5th June 2011

Hinweis der Redaktion

  1. DBDL-Database Design Language