The normalization process involved performing the following checks on each entity from the entity relationship diagram.
Normalization of the entities is done using bottom up approach for all the entities specified in the entity relation diagram. Thus to demonstrate the normalization process for each entity involves the following steps;
Implementation of the database was done MySQL which is accessed from PHPMyAdmin using a browser. Below is the code for each table and a screenshot of the structure of the table.
Code
-- User Id: 227171
create table category(
categoryID integer primary key,
name varchar(50) not null
Code
-- User Id: 227171
create table item(
itemID integer primary key,
categoryID integer not null,
name varchar(50) not null,
costPrice decimal(10,2) not null,
sellingPrice decimal(10,2) not null,
description varchar(500) not null,
foreign key (categoryID) references category (categoryID),
check (costprice>0),
check (sellingPrice>0)
Code
-- User Id: 227171
create table seller(
sellerID integer primary key,
firstName varchar(50) not null,
lastname varchar(50) not null,
phoneNo varchar(25) not null,
email varchar(50) null,
type varchar(25) not null
Code
-- User Id: 227171
create table buyer(
buyerID integer primary key,
firstName varchar(50) not null,
lastname varchar(50) not null,
phoneNo varchar(25) not null,
email varchar(50) null
Table sales
Code
-- User Id: 227171
create table sales(
saleID integer primary key,
saleDate date not null,
buyerID integer not null,
foreign key (buyerID) references buyer (buyerID)
Code
-- User Id: 227171
create table purchases(
purchaseID integer primary key,
purchaseDate date not null,
sellerID integer not null,
foreign key (sellerID) references seller (sellerID)
Code
-- User Id: 227171
create table sales_items(
saleID integer not null,
itemID integer not null,
primary key (saleID,itemID),
foreign key (saleID) references sales(saleID),
foreign key (itemID) references item (itemID)
Code
-- User Id: 227171
create table purchases_items(
purchaseID integer not null,
itemID integer not null,
primary key (purchaseID,itemID),
foreign key (purchaseID) references purchases(purchaseID),
foreign key (itemID) references item (itemID)
Code
-- User Id: 227171
create table expert(
expertID integer primary key,
firstName varchar(50) not null,
lastName varchar(50) not null,
type varchar(15) not null,
email varchar(50) not null,
phone varchar(15) not null,
address varchar(100) not null,
check (type in ('repairer','restorer','valuer'))
Code
-- User Id: 227171
create table item_actions(
actionID integer primary key,
itemID integer not null,
dateDone date not null,
expertID integer not null,
cost decimal(10,2) not null,
type varchar(15) not null,
foreign key (itemID) references item (itemID),
foreign key (expertID) references expert (expertID)
Code
-- User Id: 227171
create table lease(
leaseID integer primary key,
itemID integer not null,
leaseDate date not null,
period integer not null,
client varchar(50) not null,
cost decimal (10,2) not null,
foreign key (itemID) references item (itemID)
Code
-- User Id: 227171
create table staff(
staffID integer primary key,
firstname varchar(50) not null,
lastname varchar(50) not null,
email varchar(50) not null,
phone varchar(50) not null,
position varchar(50) not null
Code
-- User Id: 227171
create table expenses(
expenseID integer primary key,
type varchar(25) not null,
amount decimal(10,2) not null,
expenseDate date not null,
staffID integer not null,
foreign key (staffID) references staff (staffID)
Code
-- User Id: 227171
create table collection(
collectionID integer primary key,
itemID integer not null,
dateRetained date not null,
staffID integer not null,
foreign key (staffID) references staff (staffID),
foreign key (itemID) references item (itemID)
Code
-- User Id: 227171
create table payment(
paymentID integer primary key,
expenseID integer not null,
paymentMethod varchar(30) not null default 'cash',
foreign key (expenseID) references expenses (expenseID)
Question 4
Populating the tables with fictional data.
Code
INSERT INTO `antiques`.`category` (`categoryID`, `name`) VALUES ('1', 'Militaria'), ('2', 'Furniture'), ('3', 'Clothing'), ('4', 'clocks & watches'), ('5', 'Optical'), ('6', 'electrical'), ('7', 'sporting'), ('8', 'motors'), ('9', 'assorted');
Code
INSERT INTO `antiques`.`item` (`itemID`, `categoryID`, `name`, `costPrice`, `sellingPrice`, `description`) VALUES ('1', '1', 'ak 47', '120', '150', 'ak 47 ancient world war 2 riffle'), ('2', '2', '1 seater chair', '50', '80', 'a good relaxation chair'), ('3', '3', 'Cap', '15', '20', 'a good ancient chinese cap'), ('4', '4', 'Rolex watch', '200', '250', 'rolex watch'), ('5', '4', 'Rolex wall clock', '150', '180', 'A good old rolex wall clock'), ('6', '6', 'optical telescope', '80', '90', 'a good old stelescope'), ('7', '7', 'cooker', '123', '154', 'ancient cooker with oven'), ('8', '8', 'football', '50', '70', 'Lionel Messis first football'), ('9', '8', 'bm3 320 i gt', '3000', '4000', 'buy and drive old school BMW'), ('10', '9', 'sculpture', '300', '350', 'ancient rome sculpture');
Code
INSERT INTO `antiques`.`seller` (`sellerID`, `firstName`, `lastname`, `phoneNo`, `email`, `type`) VALUES ('1', 'Peter', 'Griffin', '+2332332432', '[email protected]', 'individual'), ('2', 'Lois', 'Griffin', '+2343243242', '[email protected]', 'individual'), ('3', 'Stewie', 'Griffin', '+32432423', '[email protected]', 'individual'), ('4', 'Brian ', 'Girffiin', '+223423423', '[email protected]', 'individual'), ('5', 'Meg', 'Griffin', '+32423232', '[email protected]', 'individual'), ('6', 'Cleveland', 'Brown', '+23211312', '[email protected]', 'individual'), ('7', 'Cleveland', 'Jr', '+24342323', '[email protected]', 'individual'), ('8', 'Rallo', 'tabbs', '+43423423', '[email protected]', 'individual'), ('9', 'ROberta', 'tabbs', '+3243423423', '[email protected]', 'indivual'), ('10', 'labada', 'tabbs', '+234234232', '[email protected]', 'individual');
Code
INSERT INTO `antiques`.`buyer` (`buyerID`, `firstName`, `lastname`, `phoneNo`, `email`) VALUES ('1', 'Lebron', 'James', '+344342232', '[email protected]'), ('2', 'Brandon', 'Ingram', '+43434423', '[email protected]'), ('3', 'Rajon', 'Rondo', '[email protected]', '+3444343434'), ('4', 'Lonzo', 'Ball', '+343434343', '[email protected]'), ('5', 'Lance ', 'steph', '+34343434', '[email protected]'), ('6', 'Kyle', 'Kuzma', '+34343434', '[email protected]'), ('7', 'Josh', 'Hart', '+43434232332', '[email protected]'), ('8', 'Chris', 'Paul', '+334343243', '[email protected]'), ('9', 'Carmello', 'ANthony', '+34432434', '[email protected]'), ('10', 'James', 'Harden', '+43434234', '[email protected]');
Code
INSERT INTO `antiques`.`sales` (`saleID`, `saleDate`, `buyerID`) VALUES ('1', '2018-10-09', '1'), ('2', '2018-10-10', '1'), ('3', '2018-10-10', '3'), ('4', '2018-10-10', '4'), ('5', '2018-10-10', '5'), ('6', '2018-10-10', '6'), ('7', '2018-10-10', '8'), ('8', '2018-10-10', '8'), ('9', '2018-10-10', '9'), ('10', '2018-10-10', '10');
Code
INSERT INTO `antiques`.`sales_items` (`saleID`, `itemID`) VALUES ('1', '1'), ('1', '2'), ('2', '3'), ('3', '3'), ('4', '5'), ('6', '7'), ('7', '8'), ('9', '9'), ('9', '10'), ('10', '10');
Code
INSERT INTO `antiques`.`purchases` (`purchaseID`, `purchaseDate`, `sellerID`) VALUES ('1', '2018-10-27', '1'), ('2', '2018-10-31', '2'), ('3', '2018-10-31', '3'), ('4', '2018-10-31', '4'), ('5', '2018-10-31', '5'), ('6', '2018-10-31', '6'), ('7', '2018-10-31', '7'), ('8', '2018-10-31', '8'), ('9', '2018-10-31', '10'), ('10', '2018-10-31', '10');
Code
INSERT INTO `antiques`.`purchases_items` (`purchaseID`, `itemID`) VALUES ('1', '1'), ('2', '2'), ('3', '3'), ('4', '4'), ('5', '5'), ('6', '6'), ('7', '7'), ('8', '8'), ('9', '9'), ('10', '10');
Code
INSERT INTO `antiques`.`expert` (`expertID`, `firstName`, `lastName`, `type`, `email`, `phone`, `address`) VALUES ('1', 'Kyrie ', 'Irving', 'valuer', '[email protected]', '+343423423', 'cletics td garden'), ('2', 'terry', 'Rozier', 'valuer', '[email protected]', '+324234234', 'td garden, celtics'), ('3', 'Jaylen', 'Brown', 'valuer', '[email protected]', '+223423434', 'td cgarden, celtics'), ('4', 'Gordon', 'Hayward', 'restorer', '[email protected]', '+3244342', 'td garden celtics'), ('5', 'Al', 'Hroford', 'restorer', '[email protected]', '+3223232', 'td garden,celtics'), ('6', 'Marcus', 'Smart', 'restorer', '[email protected]', '+32234234', 'td garden, celtics'), ('7', 'Markeif', 'Morris', 'repairer', '[email protected]', '+32342342', 'td garden celtics'), ('8', 'Jayson', 'Tatum', 'repairer', '[email protected]', '+23312321', 'td garden celtics'), ('9', 'Jr', 'smith', 'repairer', '[email protected]', '+2332343', 'quick loans arena'), ('10', 'kevin', 'Love', 'repairer', '[email protected]', '+334334', 'quick loans arena');
Code
INSERT INTO `antiques`.`lease` (`leaseID`, `itemID`, `leaseDate`, `period`, `client`, `cost`) VALUES ('1', '1', '2018-10-17', '2', 'Marvel', '300'), ('2', '2', '2018-10-18', '3', 'Warner Bros', '400'), ('3', '3', '2018-10-18', '3', 'Warner Bros', '500'), ('4', '4', '2018-10-18', '4', 'Netflix', '434'), ('5', '5', '2018-10-18', '4', 'universal', '432'), ('6', '6', '2018-10-18', '4', 'universal', '3434'), ('7', '7', '2018-10-18', '4', 'Columbia ', '323'), ('8', '8', '2018-10-18', '4', 'Sony', '3422'), ('9', '9', '2018-10-18', '2', 'Sony', '342'), ('10', '10', '2018-10-18', '2', 'Warner Bros', '2432');
Code
INSERT INTO `antiques`.`staff` (`staffID`, `firstname`, `lastname`, `email`, `phone`, `position`) VALUES ('1', 'Steph', 'curry', '[email protected]', '+33434323', 'manager'), ('2', 'Demarcus', 'cousins', '[email protected]', '+3343423', 'assisttant manager'), ('3', 'Klay', 'Thompson', '[email protected]', '[email protected]', 'salesperson'), ('4', 'kevin', 'Durant', '[email protected]', '+43434334', 'salesperson'), ('5', 'Jon', 'smith', '[email protected]', '+4343434', 'salesperson'), ('6', 'Mike', 'Looney', '[email protected]', '+4343432', 'field agent'), ('7', 'Danerys', 'Teagryn', 'khaleesi', '[email protected]', 'field agent'), ('8', 'khal', 'drogo', '[email protected]', '+4343423', 'salesperson'), ('9', 'Brianner', 'Tarth', '[email protected]', '+324234324', 'salesperson'), ('10', 'Jon', 'White', '[email protected]', '+4343434', 'salesperson');
Code
INSERT INTO `antiques`.`item_actions` (`actionID`, `itemID`, `dateDone`, `expertID`, `cost`, `type`) VALUES ('1', '1', '2018-10-09', '1', '322', 'valuation'), ('2', '2', '2018-10-26', '3', '232', 'valuation'), ('3', '3', '2018-10-26', '3', '323', 'valuation'), ('4', '4', '2018-10-26', '4', '32', 'repair'), ('5', '5', '2018-10-26', '5', '232', 'repair'), ('6', '6', '2018-10-26', '6', '233', 'repair'), ('7', '7', '2018-10-26', '7', '232', 'restoration'), ('8', '8', '2018-10-26', '8', '32', 'restoration'), ('9', '9', '2018-10-26', '9', '232', 'restoration'), ('10', '10', '2018-10-26', '10', '223', 'restoration');
Code
INSERT INTO `antiques`.`collection` (`collectionID`, `itemID`, `dateRetained`, `staffID`) VALUES ('1', '1', '2018-10-23', '1'), ('2', '2', '2018-10-17', '2'), ('3', '3', '2018-10-17', '3'), ('4', '4', '2018-10-17', '4'), ('5', '5', '2018-10-17', '5'), ('6', '6', '2018-10-17', '6'), ('7', '7', '2018-10-17', '7'), ('8', '8', '2018-10-17', '8'), ('9', '9', '2018-10-17', '9'), ('10', '10', '2018-10-17', '10')
Code
INSERT INTO `antiques`.`expenses` (`expenseID`, `type`, `amount`, `expenseDate`, `staffID`) VALUES ('1', 'accomodation', '233', '2018-10-09', '1'), ('2', 'accomodation', '2324', '2018-10-09', '2'), ('3', 'fuel', '3223', '2018-10-09', '3'), ('4', 'fuel', '2323', '2018-10-09', '4'), ('5', 'acommodation', '2324', '2018-10-09', '5'), ('6', 'accommodation', '323', '2018-10-09', '6'), ('7', 'accommodation', '23443', '2018-10-09', '8'), ('8', 'accommodation', '432', '2018-10-09', '8'), ('9', 'acommodation', '3232', '2018-10-09', '9'), ('10', 'fuel', '334', '2018-10-09', '10');
Code
INSERT INTO `antiques`.`payment` (`paymentID`, `expenseID`, `paymentMethod`) VALUES ('1', '1', 'cash'), ('2', '2', 'cash'), ('3', '3', 'cash'), ('4', '4', 'cash'), ('5', '5', 'cash'), ('6', '6', 'cash'), ('7', '7', 'cash'), ('8', '8', 'cash'), ('9', '9', 'cash'), ('10', '10', 'cash');
Question 5
Queries
1.
Code
-- User Id: 227171
select * from item_actions where type='valuation';
2.
Code
-- User Id: 227171
select * from sales where saledate<curdate();
3.
Code
-- User Id: 227171
select paymentMethod,count(paymentID) from payment;
4.
Code
-- User Id: 227171
select sum(amount) from expenses;
5.
Code
-- User Id: 227171
select firstname,lastname,expensedate from expenses inner join staff on staff.staffID=expenses.staffID ;
6.
Code
-- User Id: 227171
select * from item_actions group by type;
7.
Code
-- User Id: 227171
select * from staff where staffID in (select staffID from expenses);
Code
-- User Id: 227171
select * from staff where staffID not in (select staffID from expenses);
9.
Code
-- User Id: 227171
select min(amount) from expenses;
10.
Code
-- User Id: 227171
select * from expenses having max(amount);
To export a reference to this article please select a referencing stye below:
My Assignment Help. (2021). Database Design. Retrieved from https://myassignmenthelp.com/free-samples/com4003-database-design/more-items.html.
"Database Design." My Assignment Help, 2021, https://myassignmenthelp.com/free-samples/com4003-database-design/more-items.html.
My Assignment Help (2021) Database Design [Online]. Available from: https://myassignmenthelp.com/free-samples/com4003-database-design/more-items.html
[Accessed 22 April 2021].
My Assignment Help. 'Database Design' (My Assignment Help, 2021) <https://myassignmenthelp.com/free-samples/com4003-database-design/more-items.html> accessed 22 April 2021.
My Assignment Help. Database Design [Internet]. My Assignment Help. 2021 [cited 22 April 2021]. Available from: https://myassignmenthelp.com/free-samples/com4003-database-design/more-items.html.
Get a conclusive summary, detailed notes, annotations, informative intro paragraphs, descriptions of setting, summary of the plot and lot more with our book report writers. Our book report writers let you know how to write a report to get positive reviews and better critics. Connect with our book report writers to create impactful book report, so that your readers and faculty appreciates it. Our reports are the best analysis of what the book intends to deliver to the readers and how far they have been sucessful. Also learn how to write a book review with us. Connect with us now.
Answer A USB Type-C connection is a port which is available on the MacBook which has mandatory headphone jack; it is responsible for taking care of power, data transfers and display output. Thunderbolt was developed with a promise of leaving behind the USB ports. Because according to the developers of Intel and Apple it was must fatter and the data transfer rate was faster than USBs (Intel, 2015). Along with this, it helps users to connect to ...
Read MoreAnswer: The database given was normalized to achieve a better database. Normalization of the database involved following the following steps; Ensuring no entity has any repeating groups to normalize the relations to 1NF. Ensuring all entities achieved as a result of normalization to 1NF have no partial dependencies thus normalizing them to 2NF. This involves making sure that an entity has only one candidate key that the other keys depend o...
Read MoreAnswer: The database should be able to store the details of all the courses in the system and each course in the system should be identified with a unique identity that would be helpful in distinguishing the different entries in the tables. The database should be able to store the details of all the students each data should be identified by a unique identification key. The database should be able to store the details of the enro...
Read MoreAnswer: Part 1: Use Case Realisation for the ‘Record New Tour’ Use Case 1.1 Analysis Class Diagram: In the paradigm of software engineering, the class diagram is a part of UML that represents the static structure of an application. The class diagram, as the name suggests, represents the classes of the application. These classes has attributes and operations. The class diagram are mainly used for describing the element...
Read MoreAnswer: Assumption: - A APPLIED_STAFF has many QUALIFICATION_DETAIL and a QUALIFICATION_DETAIL is related to many APPLIED_STAFF. Here many too many relationships occur. So I create a new table that is STAFF_QUALIFICATION. Here a staff has one or many STAFF_QUALIFICATION and each STAFF_QUALIFICATION is related to one and only one APPLIED_STAFF. A qualification is related to one or many STAFF_QUALIFICATION and each STAFF_QUALIFICATION is ...
Read MoreJust share requirement and get customized Solution.
Orders
Overall Rating
Experts
Our writers make sure that all orders are submitted, prior to the deadline.
Using reliable plagiarism detection software, Turnitin.com.We only provide customized 100 percent original papers.
Feel free to contact our assignment writing services any time via phone, email or live chat. If you are unable to calculate word count online, ask our customer executives.
Our writers can provide you professional writing assistance on any subject at any level.
Our best price guarantee ensures that the features we offer cannot be matched by any of the competitors.
Get all your documents checked for plagiarism or duplicacy with us.
Get different kinds of essays typed in minutes with clicks.
Calculate your semester grades and cumulative GPa with our GPA Calculator.
Balance any chemical equation in minutes just by entering the formula.
Calculate the number of words and number of pages of all your academic documents.
Our Mission Client Satisfaction
received 72 marks this is first assignment which i have received above 70 i have given so many assignment after this i received a good marks. but expected is 75 above as i had paid too much money.
Australia
received 74 marks this is first assignment which i have received above 74 i have given so many assignment after this i received a good marks. but expected is 85 above as i had paid too much money.
Australia
received 69 marks this is first assignment which i have received above 69 i have given so many assignment after this i received a good marks. but expected is 75 above as i had paid too much money.
Australia
Literally a life saver with everything going on. It was my first time seeking for assignment help and was really pleased. I definitely will recommend to others and use this platform again.
Australia