The document contains SQL commands that define the schema for a wellness application database. It includes tables for users, interests, steps, themes, and relationships between them such as which users are following other users and which interests and themes are associated with different steps. Sample data is inserted into the tables to establish an initial set of 20 users along with their interests, the steps they have taken, and the relationships between them.
set FOREIGN_KEY_CHECKS=false;-- --------------------------.docx
1. set FOREIGN_KEY_CHECKS=false;
-- -----------------------------------------------------
-- uncomment and run these 3 SCHEMA commands if you are
using your own server
-- -----------------------------------------------------
DROP SCHEMA IF EXISTS wellness_app ;
CREATE SCHEMA IF NOT EXISTS wellness_app DEFAULT
CHARACTER SET utf8 ;
USE wellness_app ;
-- ----------------------------------------------------
-- End uncomment
-- ----------------------------------------------------
-- -----------------------------------------------------
-- Table user
-- -----------------------------------------------------
DROP TABLE IF EXISTS user ;
CREATE TABLE IF NOT EXISTS user (
id INT NOT NULL AUTO_INCREMENT,
first_name VARCHAR(128) NOT NULL,
last_name VARCHAR(128) NOT NULL,
DOB DATE NULL,
PRIMARY KEY (id))
ENGINE = InnoDB
ROW_FORMAT = COMPRESSED;
2. -- -----------------------------------------------------
-- Table interest
-- -----------------------------------------------------
DROP TABLE IF EXISTS interest ;
CREATE TABLE IF NOT EXISTS interest (
id INT NOT NULL AUTO_INCREMENT,
name VARCHAR(100) NOT NULL,
PRIMARY KEY (id))
ENGINE = InnoDB;
-- -----------------------------------------------------
-- Table step
-- -----------------------------------------------------
DROP TABLE IF EXISTS step ;
CREATE TABLE IF NOT EXISTS step (
id INT NOT NULL AUTO_INCREMENT,
title VARCHAR(50) NOT NULL,
PRIMARY KEY (id))
ENGINE = InnoDB;
3. -- -----------------------------------------------------
-- Table theme
-- -----------------------------------------------------
DROP TABLE IF EXISTS theme ;
CREATE TABLE IF NOT EXISTS theme (
id INT NOT NULL AUTO_INCREMENT,
name VARCHAR(100) NOT NULL,
PRIMARY KEY (id))
ENGINE = InnoDB;
-- -----------------------------------------------------
-- Table user_follow
-- -----------------------------------------------------
DROP TABLE IF EXISTS user_follow ;
CREATE TABLE IF NOT EXISTS user_follow (
id INT NOT NULL AUTO_INCREMENT,
following_user_id INT NOT NULL,
followed_user_id INT NOT NULL,
weight INT NOT NULL DEFAULT 0,
PRIMARY KEY (id),
INDEX fk_user_user_connection_user1_idx
(following_user_id ASC),
INDEX fk_user_user_connection_user2_idx (followed_user_id
4. ASC),
CONSTRAINT fk_user_user_connection_user1
FOREIGN KEY (following_user_id)
REFERENCES user (id)
ON DELETE NO ACTION
ON UPDATE NO ACTION,
CONSTRAINT fk_user_user_connection_user2
FOREIGN KEY (followed_user_id)
REFERENCES user (id)
ON DELETE NO ACTION
ON UPDATE NO ACTION)
ENGINE = InnoDB;
-- -----------------------------------------------------
-- Table user_interest
-- -----------------------------------------------------
DROP TABLE IF EXISTS user_interest ;
CREATE TABLE IF NOT EXISTS user_interest (
user_id INT NOT NULL,
interest_id INT NOT NULL,
INDEX fk_user_interest_user1_idx (user_id ASC),
INDEX fk_user_interest_interest1_idx (interest_id ASC),
PRIMARY KEY (user_id, interest_id),
CONSTRAINT fk_user_interest_user1
FOREIGN KEY (user_id)
REFERENCES user (id)
ON DELETE NO ACTION
ON UPDATE NO ACTION,
CONSTRAINT fk_user_interest_interest1
FOREIGN KEY (interest_id)
REFERENCES interest (id)
ON DELETE NO ACTION
ON UPDATE NO ACTION)
ENGINE = InnoDB;
5. -- -----------------------------------------------------
-- Table step_taken
-- -----------------------------------------------------
DROP TABLE IF EXISTS step_taken ;
CREATE TABLE IF NOT EXISTS step_taken (
id INT NOT NULL AUTO_INCREMENT,
user_id INT NOT NULL,
step_id INT NOT NULL,
when_started TIMESTAMP NOT NULL DEFAULT
CURRENT_TIMESTAMP,
when_finished TIMESTAMP NULL,
rating TINYINT NULL,
INDEX fk_StepsTaken_User1 (user_id ASC),
INDEX fk_steps_taken_step1_idx (step_id ASC),
PRIMARY KEY (id),
CONSTRAINT fk_StepsTaken_User1
FOREIGN KEY (user_id)
REFERENCES user (id)
ON DELETE NO ACTION
ON UPDATE NO ACTION,
CONSTRAINT fk_steps_taken_step1
FOREIGN KEY (step_id)
REFERENCES step (id)
ON DELETE NO ACTION
ON UPDATE NO ACTION)
ENGINE = InnoDB;
6. -- -----------------------------------------------------
-- Table step_theme
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS step_theme (
theme_id INT NOT NULL,
step_id INT NOT NULL,
PRIMARY KEY (theme_id, step_id),
INDEX fk_pathway_step_pathway1_idx (theme_id ASC),
INDEX fk_pathway_step_step1_idx (step_id ASC),
CONSTRAINT fk_pathway_step_pathway1
FOREIGN KEY (theme_id)
REFERENCES theme (id)
ON DELETE NO ACTION
ON UPDATE NO ACTION,
CONSTRAINT fk_pathway_step_step1
FOREIGN KEY (step_id)
REFERENCES step (id)
ON DELETE NO ACTION
ON UPDATE NO ACTION)
ENGINE = InnoDB;
INSERT INTO user VALUES(1,'Alice','Smith', '1999-01-01');
INSERT INTO user VALUES(2,'Bob','Singh', '2000-03-04');
INSERT INTO user VALUES(3,'Charlie','Nguyen', '2001-05-
23');
INSERT INTO user VALUES(4,'Dan','Williams', '1999-01-11');
INSERT INTO user VALUES(5,'Eve','Brown', '1995-07-07');
7. INSERT INTO user VALUES(6,'Frank','Jones', '1998-02-22');
INSERT INTO user VALUES(7,'Grace','Wilson', '2001-10-02');
INSERT INTO user VALUES(8,'Heidi','Taylor', '1997-04-21');
INSERT INTO user VALUES(9,'Ian','Lee', '1997-12-30');
INSERT INTO user VALUES(10,'Judy','Tran', '1995-05-12');
INSERT INTO user VALUES(11,'Kath','Anderson', '1996-09-
11');
INSERT INTO user VALUES(12,'Lee','Thomas', '1998-02-02');
INSERT INTO user VALUES(13,'Mallory','White', '2002-05-
13');
INSERT INTO user VALUES(14,'Nick','Johnson', '1999-11-
14');
INSERT INTO user VALUES(15,'Olivia','Martin', '2000-11-
01');
INSERT INTO user VALUES(16,'Pat','Wang', '1995-01-01');
INSERT INTO user VALUES(17,'Quentin','Chen', '1996-04-
12');
INSERT INTO user VALUES(18,'Robbie','Ryan', '1997-06-21');
INSERT INTO user VALUES(19,'Sam','Thompson', '2000-02-
15');
INSERT INTO user VALUES(20,'Tracey','Young', '2001-03-
25');
INSERT INTO user_follow VALUES(1, 1,2,0);
INSERT INTO user_follow VALUES(2, 2,1,0);
INSERT INTO user_follow VALUES(3, 3,20,0);
INSERT INTO user_follow VALUES(4, 4,14,0);
INSERT INTO user_follow VALUES(5, 5,6,0);
INSERT INTO user_follow VALUES(6, 19,3,0);
INSERT INTO user_follow VALUES(7, 19,4,0);
INSERT INTO user_follow VALUES(8, 4,20,0);
INSERT INTO user_follow VALUES(9, 15,7,0);
INSERT INTO user_follow VALUES(10, 7,8,0);
INSERT INTO user_follow VALUES(11, 7,15,0);
INSERT INTO user_follow VALUES(12, 14,12,0);
INSERT INTO user_follow VALUES(13, 14,13,0);
8. INSERT INTO user_follow VALUES(14, 5,7,0);
INSERT INTO user_follow VALUES(15, 5,8,0);
INSERT INTO user_follow VALUES(16, 3,2,0);
INSERT INTO user_follow VALUES(17, 3,18,0);
INSERT INTO user_follow VALUES(18, 18,17,0);
INSERT INTO user_follow VALUES(19, 16,11,0);
INSERT INTO user_follow VALUES(20, 11,10,0);
INSERT INTO interest VALUES(1, 'Rock Climbing');
INSERT INTO interest VALUES(2, 'The Simpsons');
INSERT INTO interest VALUES(3, 'Football');
INSERT INTO interest VALUES(4, 'Tennis');
INSERT INTO interest VALUES(5, 'Python');
INSERT INTO interest VALUES(6, 'SQL');
INSERT INTO interest VALUES(7, 'Data Science');
INSERT INTO interest VALUES(8, 'Science Fiction');
INSERT INTO interest VALUES(9, 'Cycling');
INSERT INTO interest VALUES(10, 'Cinema');
INSERT INTO interest VALUES(11, 'Classical Music');
INSERT INTO interest VALUES(12, 'Poetry');
INSERT INTO user_interest VALUES(1, 1);
INSERT INTO user_interest VALUES(2, 2);
INSERT INTO user_interest VALUES(3, 3);
9. INSERT INTO user_interest VALUES(4, 4);
INSERT INTO user_interest VALUES(5, 5);
INSERT INTO user_interest VALUES(6, 6);
INSERT INTO user_interest VALUES(7, 7);
INSERT INTO user_interest VALUES(8, 8);
INSERT INTO user_interest VALUES(9, 9);
INSERT INTO user_interest VALUES(10, 10);
INSERT INTO user_interest VALUES(11, 11);
INSERT INTO user_interest VALUES(12, 12);
INSERT INTO user_interest VALUES(9, 1);
INSERT INTO user_interest VALUES(10, 2);
INSERT INTO user_interest VALUES(11, 3);
INSERT INTO user_interest VALUES(12, 4);
INSERT INTO user_interest VALUES(13, 5);
INSERT INTO user_interest VALUES(14, 6);
INSERT INTO user_interest VALUES(15, 7);
INSERT INTO user_interest VALUES(16, 8);
INSERT INTO user_interest VALUES(17, 9);
INSERT INTO user_interest VALUES(18, 10);
INSERT INTO user_interest VALUES(19, 11);
INSERT INTO user_interest VALUES(20, 12);
INSERT INTO user_interest VALUES(7, 1);
INSERT INTO user_interest VALUES(6, 2);
INSERT INTO user_interest VALUES(5, 3);
INSERT INTO user_interest VALUES(3, 5);
INSERT INTO user_interest VALUES(2, 6);
INSERT INTO user_interest VALUES(1, 7);
INSERT INTO user_interest VALUES(20, 8);
INSERT INTO user_interest VALUES(19, 9);
INSERT INTO user_interest VALUES(10, 18);
INSERT INTO user_interest VALUES(17, 11);
INSERT INTO user_interest VALUES(16, 12);
INSERT INTO user_interest VALUES(14, 1);
INSERT INTO user_interest VALUES(15, 2);
INSERT INTO user_interest VALUES(16, 3);
INSERT INTO user_interest VALUES(17, 4);
10. INSERT INTO user_interest VALUES(18, 5);
INSERT INTO user_interest VALUES(19, 6);
INSERT INTO user_interest VALUES(20, 7);
INSERT INTO user_interest VALUES(1, 8);
INSERT INTO user_interest VALUES(2, 9);
INSERT INTO user_interest VALUES(3, 10);
INSERT INTO user_interest VALUES(4, 11);
INSERT INTO user_interest VALUES(5, 12);
INSERT INTO step VALUES(51, 'Body scan');
INSERT INTO step VALUES(54, 'Body and breath');
INSERT INTO step VALUES(55, 'Tuning in');
INSERT INTO step VALUES(56, 'Anchor yourself');
INSERT INTO step VALUES(57, 'Everyday mindfulness');
INSERT INTO step VALUES(67, 'Mindful movement');
INSERT INTO step VALUES(68, 'Mindful emotions');
INSERT INTO step VALUES(69, 'Mindful thoughts');
INSERT INTO step VALUES(70, 'Heartfulness');
INSERT INTO step VALUES(73, 'Being with difficulty');
INSERT INTO step VALUES(74, 'Self talk');
INSERT INTO step VALUES(75, 'Compassion for others');
INSERT INTO step VALUES(111, 'Introduction to
mindfulness');
INSERT INTO step VALUES(112, 'Introduction to self
11. compassion');
INSERT INTO step VALUES(113, 'Things that go bump in the
night');
INSERT INTO step VALUES(115, 'Introduction to anxiety');
INSERT INTO step VALUES(116, 'The banshee');
INSERT INTO step VALUES(117, 'Breathing relaxation');
INSERT INTO step VALUES(122, 'Introduction to depression');
INSERT INTO step VALUES(123, 'Rumination');
INSERT INTO step VALUES(124, 'Introduction to social
anxiety');
INSERT INTO step VALUES(125, 'Fortune telling');
INSERT INTO step VALUES(126, 'Unpopular mechanics');
INSERT INTO step VALUES(127, 'Navigating physical
symptoms');
INSERT INTO step VALUES(128, 'Ice breaking and
conversation making');
INSERT INTO step VALUES(129, 'Chameleon dreams');
INSERT INTO step VALUES(130, 'Perfectly rolled');
INSERT INTO step VALUES(131, 'Dark skies, bright stars');
INSERT INTO step VALUES(132, 'Monsters, kittens and
popcorn');
INSERT INTO step VALUES(133, 'Beautiful broken things');
INSERT INTO step VALUES(134, 'Connecting with strengths');
INSERT INTO step VALUES(135, 'Three minute breathing
space');
INSERT INTO step VALUES(136, 'Coping with strengths');
INSERT INTO step VALUES(137, 'Enhancing with strengths');
INSERT INTO step VALUES(138, 'Introduction to strengths');
INSERT INTO step VALUES(139, 'Strengths for work and
study');
INSERT INTO step VALUES(140, 'Savouring');
INSERT INTO step VALUES(141, 'Doing and being');
INSERT INTO step VALUES(142, 'Exposure song');
INSERT INTO step VALUES(143, 'Panic');
INSERT INTO step VALUES(144, 'Negative thought spirals');
INSERT INTO step VALUES(145, 'Positive thought spirals');
12. INSERT INTO step VALUES(146, 'A thought is a thought');
INSERT INTO step VALUES(148, 'Triggers and warning
signs');
INSERT INTO step VALUES(149, 'Wellness action plan');
INSERT INTO step VALUES(150, 'Depression and
motivation');
INSERT INTO step VALUES(152, 'Night of the Bloodstones');
INSERT INTO step VALUES(155, 'What ifs');
INSERT INTO step VALUES(156, 'The problem with
perfection');
INSERT INTO theme VALUES(1, 'Social Anxiety');
INSERT INTO theme VALUES(2, 'Your Strengths');
INSERT INTO theme VALUES(6, 'Depression');
INSERT INTO theme VALUES(7, 'Anxiety');
INSERT INTO theme VALUES(8, 'Self Compassion');
INSERT INTO theme VALUES(9, 'Mindfulness');
INSERT INTO step_theme VALUES(6, 51);
INSERT INTO step_theme VALUES(9, 51);
INSERT INTO step_theme VALUES(9, 54);
INSERT INTO step_theme VALUES(9, 55);
INSERT INTO step_theme VALUES(9, 56);
INSERT INTO step_theme VALUES(7, 57);
INSERT INTO step_theme VALUES(9, 57);
13. INSERT INTO step_theme VALUES(6, 67);
INSERT INTO step_theme VALUES(9, 67);
INSERT INTO step_theme VALUES(9, 68);
INSERT INTO step_theme VALUES(7, 69);
INSERT INTO step_theme VALUES(9, 69);
INSERT INTO step_theme VALUES(9, 70);
INSERT INTO step_theme VALUES(6, 73);
INSERT INTO step_theme VALUES(7, 73);
INSERT INTO step_theme VALUES(8, 73);
INSERT INTO step_theme VALUES(7, 74);
INSERT INTO step_theme VALUES(8, 74);
INSERT INTO step_theme VALUES(8, 75);
INSERT INTO step_theme VALUES(9, 111);
INSERT INTO step_theme VALUES(8, 112);
INSERT INTO step_theme VALUES(7, 113);
INSERT INTO step_theme VALUES(7, 115);
INSERT INTO step_theme VALUES(7, 116);
INSERT INTO step_theme VALUES(7, 117);
INSERT INTO step_theme VALUES(6, 122);
INSERT INTO step_theme VALUES(6, 123);
INSERT INTO step_theme VALUES(1, 124);
INSERT INTO step_theme VALUES(1, 125);
INSERT INTO step_theme VALUES(1, 126);
INSERT INTO step_theme VALUES(1, 127);
INSERT INTO step_theme VALUES(1, 128);
INSERT INTO step_theme VALUES(1, 129);
INSERT INTO step_theme VALUES(1, 130);
INSERT INTO step_theme VALUES(1, 131);
INSERT INTO step_theme VALUES(1, 132);
INSERT INTO step_theme VALUES(1, 133);
INSERT INTO step_theme VALUES(2, 134);
INSERT INTO step_theme VALUES(6, 135);
INSERT INTO step_theme VALUES(2, 136);
INSERT INTO step_theme VALUES(2, 137);
INSERT INTO step_theme VALUES(2, 138);
INSERT INTO step_theme VALUES(2, 139);
14. INSERT INTO step_theme VALUES(6, 141);
INSERT INTO step_theme VALUES(7, 142);
INSERT INTO step_theme VALUES(7, 143);
INSERT INTO step_theme VALUES(6, 144);
INSERT INTO step_theme VALUES(6, 146);
INSERT INTO step_theme VALUES(6, 148);
INSERT INTO step_theme VALUES(6, 149);
INSERT INTO step_theme VALUES(6, 150);
INSERT INTO step_theme VALUES(7, 152);
INSERT INTO step_theme VALUES(7, 155);
INSERT INTO step_theme VALUES(7, 156);
21. 1
Written Assessment ECO10004 Economic Principles
Part B
Due Date – See Canvas under the assessment tab
All work must be submitted using the turnitin link (see below
for more instructions)
Please do not attach a coversheet to your assignment. Also,
do not include a copy of the questions in your document.
You can insert pictures in your document but they must be
low resolution pictures. If your file is larger than 1 to 2 MB
then convert your file to pdf and upload this into turnitin.
Marking Scheme and word count
• The total marks for the written assessment is 50 and represents
50% of
your total mark for the unit. Part A is worth 12; Part B is worth
20 and
Part C is worth 18.
• Each question is worth either 1, 2 or 4 marks as indicated (at
the end of
each question).
22. • A word count is set for each question (at the end of each
question).
Answers should be within 10% of the word count.
2
Task 2: Elasticity
1. Consider the following two products: an ‘overseas trip’ and
‘prescription medication’
(prescribed by a doctor). Which product would have a higher
price elasticity of demand in
absolute value? Explain your answer including identifying the
determinant of elasticity. (1
mark) – Word count 60
2. Consider the following two products: ‘coffee’ sold in a café
and ‘hotel accommodation’ in
Sydney during the Olympic Games. Which product would have
a higher price elasticity of
supply in absolute value? Explain your answer including
identifying the determinant of
elasticity. (1 mark) – Word count 60
23. 3. A storm in North Coast of New South Wales destroyed
thousands of hectares of pineapple
crops. Pineapple farmers whose crops were destroyed by the
storm were much worse off, but
those whose crops were not destroyed benefited from the floods.
Assume that the demand
curve for pineapples is inelastic. Have pineapple farmers as a
group been hurt or helped by the
floods? Explain using supply and demand diagrams. (2 marks)
Word count 100.
3
Task 3: Costs of Production
Explain whether the following events in questions 1 and 2 will
affect fixed costs or variable costs
(make sure you justify your answer):
1. The federal government applies a licence fee on every
‘television network’ of 1 million AUD. (1
mark) Word count 40
2. Samsung signs a new contract changing the price it pays for
the ‘camera lens’ that are used in
its mobile phones. (1 mark) Word count 40
24. 3. With the use of a graph explain what is minimum efficient
scale? What is likely to happen in
the long run to firms that do not reach minimum efficient scale?
(2 marks) Word count 100.
4. What is the difference between explicit costs and implicit
costs? List three examples each of
explicit costs and implicit costs that may be experienced by a
small business. (1 mark) Word
count 80.
4
Task 4: Market Power
1. 'Being the only seller in the market, the monopolist can
choose any price and quantity it
desires. It can therefore price its product as high as it wants.'
Evaluate this statement: Is it true
or false? Explain your answer using a graph. (2 marks) – Word
count 120
2. Callaway is a company that sells golf clubs. Callaway
25. recently engaged in research and
development leading to the production, and released, of a new
set of clubs designed for
women that provides a significant advantage to players.
Explain, using a graph, how will this
impact on the price, quantity and profit of Callaway in the long
run if the company is a
monopoly? Explain, using a graph, how this will change if many
other companies start selling
similar products? (2 marks) – Word count 200
5
Task 5: Business Strategy and Market Failure
Read the following excerpt and answer question 1.
TRAFFIC on Sydney’s clogged roads and motorways is now so
congested it is
costing the majority of businesses in Western Sydney up to
$5000 a year. The
startling figures were revealed as part of the NRMA Motoring &
Services
BusinessWise survey of almost 730 businesses that run vehicle
fleets.
Frustrated local businesses who took part in the survey said
travel times for
each of their work vehicles had jumped, on average, by 59
minutes every day
26. due to roads clogged by commuters forced into their cars
because of poor
public transport options. In the past year about six out of 10
Western Sydney
firms said their fuel bills had risen as a result of congestion
…….
Author Jim O’Rourke
Source: The Australian web site April 08, 2014 12:00AM
(http://www.theaustralian.com.au/news/fair-go-for-the-west-
theres-a-costly-message-in-a-
bottleneck-on-our-congested-roads/story-e6frg6n6-
1226877298328) accessed 8th April 2014
1. Identify the negative externality discussed in the article?
Explain, using a graph, how the
negative externality leads to an inefficient price and level of
output. Provide two solutions
that you would recommend to the government to address the
externality? (4 marks) Word
count 350.
Consider the example where Intel and AMD are a duopoly that
produces CPU chips. Intel and AMD
can conduct R&D or they cannot conduct R&D. The table below
shows the payoff matrix for the
two firms. The numbers are millions of dollars of profit.
Answer questions 2 and 3.
2. Define Nash equilibrium. (1 mark) – Word count 50
27. 3. What is (are) the Nash equilibrium(s) in this game. Explain.
(2 marks) – Word count 150
http://www.theaustralian.com.au/news/fair-go-for-the-west-
theres-a-costly-message-in-a-bottleneck-on-our-congested-
roads/story-e6frg6n6-1226877298328
http://www.theaustralian.com.au/news/fair-go-for-the-west-
theres-a-costly-message-in-a-bottleneck-on-our-congested-
roads/story-e6frg6n6-1226877298328