Database and Scripts v1
Database and Scripts v1
GROUP 6
YOUSEF NAIF A ALHARBI
NOHA JAMALI A SALEM
FAISAL ABDULLAH M BIN GHIMLAS
AHMED AL SHAMISI
ABDULLAH ALDOKHIIL
Table of Contents
Table of Contents..................................................................................................................................2
1.0 Introduction.....................................................................................................................................3
1.1 Document Purpose......................................................................................................................3
2.0 Introduction.....................................................................................................................................3
2.1 Entity Relationship Diagram........................................................................................................3
3.0 Database Structure.........................................................................................................................3
3.1 Database Tables...........................................................................................................................3
3.2 Admin Table.................................................................................................................................4
3.3 Customer Table............................................................................................................................4
3.4 Delivery Table..............................................................................................................................4
3.5 Item Table....................................................................................................................................4
3.6 OrderItem Table..........................................................................................................................5
3.7 Orders Table................................................................................................................................5
4.0 Database Script................................................................................................................................5
4.1 MySQL Database Script................................................................................................................5
14.0 References...................................................................................................................................14
2.0 Introduction
2.1 Entity Relationship Diagram
Source: Creating Database Entity Relationship Diagram using PHPMyAdmin (2014)
-- version 4.0.9
--
-- Host: 127.0.0.1
--
-- Database: `shoppingdb`
--
-- --------------------------------------------------------
--
--
--
--
-- --------------------------------------------------------
--
--
--
-- --------------------------------------------------------
--
--
--
--
('ACT', '6.00'),
('NSW', '5.50'),
('NT', '9.50'),
('QLD', '5.50'),
('SA', '15.50'),
('TAS', '8.50'),
('VIC', '5.50'),
('WA', '7.50');
-- --------------------------------------------------------
--
--
--
('A001', 'Nineteen Eighty-Four', '''Who controls the past controls the future: who
controls the present controls the past'' Hidden away in the Record Department of
the sprawling Ministry of Truth, Winston Smith skilfully rewrites the past to suit
the needs of the Party.', 'FICTION', 200, '27.50', 'book1.jpg', 'book6.jpg',
'book5.jpg', 'book1Thumb.jpg', 1),
('A002', 'Dune', 'Dune tells the story of young Paul Atreides, the heir apparent to
Duke Leto Atreides as his family accepts control of the desert planet Arrakis, the
only source of the ''spice'' melange.', 'FICTION', 250, '30.20', 'book2.jpg', NULL,
NULL, 'book2Thumb.jpg', 1),
('A003', 'Harry Potter and the Deat', 'Harry Potter and the Deathly Hallows is the
seventh and final of the Harry Potter novels. The novel chronicles the events
directly following Harry Potter and the Half-Blood Prince (2005), and the final
confrontation between the wizards Harry Potter and Lo', 'FICTION', 100, '20.00',
'book3.jpg', NULL, NULL, 'book3Thumb.jpg', 0),
('A004', 'A Tale of Two Cities', 'A Tale of Two Cities is a novel by Charles
Dickens, set in London and Paris before and during the French Revolution.',
'FICTION', 229, '26.00', 'book4.jpg', NULL, NULL, 'book4Thumb.jpg', 0),
('A005', 'A Brief History of Time', 'A Brief History of Time attempts to explain a
range of subjects in cosmology, including the Big Bang, black holes and light
cones, to the nonspecialist reader.', 'SCIENCE', 89, '26.00', 'book5.jpg', NULL,
NULL, 'book5Thumb.jpg', 0),
('A006', 'The Selfish Gene', 'The Selfish Gene is a book on evolution by Richard
Dawkins, published in 1976. It builds upon the principal theory of George C.
Williams''s first book Adaptation and Natural Selection.', 'SCIENCE', 98, '20.00',
'book6.jpg', NULL, NULL, 'book6Thumb.jpg', 0),
('A007', 'The World Without Us', 'The World Without Us is a non-fiction book about
what would happen to the natural and built environment if humans suddenly
disappeared, written by American journalist Alan Weisman.', 'SCIENCE', 105,
'23.00', 'book7.jpg', NULL, NULL, 'book7Thumb.jpg', 0),
('A008', 'The Blind Watchmaker', 'The Blind Watchmaker: Why the Evidence of
Evolution Reveals a Universe without Design is a 1986 book by Richard Dawkins in
which he presents an explanation of, and argument for, the theory of evolution by
means of natural selection.', 'SCIENCE', 125, '39.00', 'book8.jpg', NULL, NULL,
'book8Thumb.jpg', 0),
('A010', 'The Magic of Reality', 'How We Know What''s Really True is a 2011 book by
British biologist Richard Dawkins, with illustrations by Dave McKean.', 'SCIENCE',
118, '23.00', 'book10.jpg', NULL, NULL, 'book10Thumb.jpg', 0),
SIT302 Project (Group 6) Database Design and Database Scripts Page #10
('A011', 'Perfect Health', 'A decade ago, Deepak Chopra, M.D., wrote Perfect
Health, the first practical guide to harnessing the healing power of the mind,
which became a national bestseller.', 'HEALTH', 53, '45.00', 'book11.jpg', NULL,
NULL, 'book11Thumb.jpg', 0),
('A013', 'Lies My Teacher Told Me', 'Lies My Teacher Told Me: Everything Your
American History Textbook Got Wrong is a 1995 book by sociologist James Loewen.',
'HISTORY', 62, '45.00', 'book13.jpg', NULL, NULL, 'book13Thumb.jpg', 0),
('A015', 'Australian Legends', 'This book, covers the development of the Australian
Quarter Horse history, which began a relatively short time ago with the 1954
arrival of the first four King Ranch stallions – Vaquero, Jackaroo, Gold
Standard and Mescal.', 'HISTORY', 40, '10.99', 'book15.jpg', NULL, NULL,
'book15Thumb.jpg', 0),
('A016', 'The Walking Dead', 'Popularized by the hit AMC television show, the
series follows a band of survivors struggling to live from one day to the next
amidst a zombie apocalypse.', 'COMICS', 500, '15.50', 'book16.jpg', NULL, NULL,
'book16Thumb.jpg', 0),
('A018', 'Saga', 'Borrowing elements from both science-fiction and fantasy, two
star-crossed lovers escape across the galaxy amidst a war between worlds.',
'COMICS', 200, '15.50', 'book18.jpg', NULL, NULL, 'book18Thumb.jpg', 0),
-- --------------------------------------------------------
--
SIT302 Project (Group 6) Database Design and Database Scripts Page #11
--
--
--
-- --------------------------------------------------------
--
--
SIT302 Project (Group 6) Database Design and Database Scripts Page #12
`orderNetValue` decimal(10,2) unsigned NOT NULL,
--
--
SIT302 Project (Group 6) Database Design and Database Scripts Page #13
14.0 References
PHP MyAdmin Tool, used to generate database scripts
SIT302 Project (Group 6) Database Design and Database Scripts Page #14