This assignment is based on the books database built by BookoRama Example. Write
ID: 3838564 • Letter: T
Question
This assignment is based on the books database built by BookoRama Example. Write SQL statements in MySQL Workbrench to make the following queries:
You need to submit all your SQL statements in a .sql file like the example file "assignment3_yourfirstname_lastname.sql", which has three example questions (the assignment has 5 questions). You also need to test your SQL statements and submit screenshot(s) to show your test is successful. Please put all the screenshot results in a word file with the name as “assignment3_yourfirstname_lastname.docx”.
Note: For the SQL code that you do not need and do not want to delete, or the comments in .sql file, you comment them out through using commands:
-- this is a comment
# this is also a comment
Or a multi-line comment:
/*
multiline
comment
*/
Book insert
book insert sq otepad Eile Edit Format View Help USE books INSERT INTO customers VALUES (NULL, Julie Smith 25 Oak Street Airport West") (NULL, Alan Wong "1/47 Haines Avenue", "Box Hill"), (NULL, Michelle Arthur 357 North Road Yarraville" INSERT INTO orders VALUES (NULL, 3, 69.98 "2000-04-02"), (NULL, 1, 49.99 2000-04-15'') (NULL, 2, 74.98 2000-04-19'') (NULL, 3, 24.99 2000-05-01") INSERT INTO books VALUES ("0-672-31697-8", Michael Morgan Java 2 for Professional Developers 34.99) ("0-672-31745-1", Thomas Down Installing Debian GNU/Linux 24.99) ("0-672-31509-2", Pruitt et al. Teach Yourself GIMP in 24 Hours 24.99) 0-672-31769-9 Thomas Schenk Caldera OpenLinux System Administration Unleashed 49.99); INSERT INTO order items VALUES (1, 0-672-31697-8 2), (2, 0-672-31769-9 1), (3, 0-672-31769-9 1), (3, 0-672-31509-2 1), (4, "0-672-31745-1", 3); INSERT INTO book reviews VALUES 0-672-31697-8 Morgan's book is clearly written and goes well beyond most of the basic Java books out thereExplanation / Answer
1. select count(*) from orders where cutomerid=3;
2. select name,city from customers order by city DESC;
3. SELECT * from Orders where customerid in (select customerid from customers where name='Michelle Arthur');
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.