Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

USING LINUX IN MYSQL 1) Find all line items that are higher in price than all those sold by Mary Halvorson. 2) Select all columns

USING LINUX IN MYSQL

1) Find all line items that are higher in price than all those sold by Mary Halvorson.

2) Select all columns from orders table, then using a join, get the customer last name from customer table, and have it print in alphabetical order by customer's last name.

3) Modify order #3 of the orders table. (Modify any of the attributes of order #3, such as order date, customer number, etc.)l print all data of the orders table before and after the modification.

4) Delete orders #18 and higher from, the orders table; print all data of the orders table before and after the deletion.

mysql> select * from customer; +-------+----------+---------+ | fname | lname | acctnum | +-------+----------+---------+ | Heidi | Wonder | 4552 | | Sam | Goodwin | 3679 | | Marge | Toledo | 1234 | | Frank | James | 5623 | | Scott | Newcomer | 7654 | +-------+----------+---------+ 5 rows in set (0.00 sec)

mysql> select * from orders; +---------+----------+------------+----------+-------------+ | acctnum | ordernum | orderdate | storenum | salesrepnum | +---------+----------+------------+----------+-------------+ | 4552 | 3 | 2004-01-03 | 1 | 1 | | 3679 | 6 | 2004-01-05 | 1 | 1 | | 1234 | 7 | 2004-01-07 | 1 | 2 | | 5623 | 8 | 2004-01-09 | 1 | 2 | | 4552 | 9 | 2004-01-11 | 1 | 3 | | 3679 | 10 | 2004-01-13 | 1 | 3 | | 1234 | 11 | 2004-01-15 | 1 | 1 | | 5623 | 12 | 2004-01-17 | 1 | 2 | | 4552 | 13 | 2004-01-19 | 1 | 3 | | 3679 | 14 | 2004-01-21 | 1 | 3 | | 1234 | 15 | 2004-01-23 | 1 | 2 | | 5623 | 16 | 2004-01-25 | 1 | 1 | | 4552 | 17 | 2004-01-27 | 1 | NULL | +---------+----------+------------+----------+-------------+ 13 rows in set (0.00 sec)

mysql> select * from order_detail; +----------+---------+----------------------+------+--------+-----------+ | ordernum | linenum | prodnum | qty | color | unitprice | +----------+---------+----------------------+------+--------+-----------+ | 3 | 1 | Bike28A | 1 | Red | 300.00 | | 6 | 1 | Bike28A | 2 | Blue | 259.00 | | 7 | 1 | Bike28A | NULL | Green | 525.00 | | 8 | 1 | Bike28B | 3 | Red | 455.00 | | 8 | 2 | ridinggloves | 7 | White | 60.00 | | 9 | 1 | Bike28B | 2 | Blue | 255.00 | | 10 | 1 | Bike28B | 5 | Green | 199.00 | | 11 | 1 | Moped77 | 1 | Black | 955.00 | | 12 | 1 | Bike31A | 1 | Red | 525.00 | | 12 | 2 | Helmet | 4 | Red | 75.00 | | 13 | 1 | Bike31A | 1 | Blue | 455.00 | | 14 | 1 | Bike28 | 1 | Orange | 255.00 | | 15 | 1 | Bike28Cruiser | 3 | White | 199.00 | | 16 | 1 | Bike28Schwinn | 1 | Red | 955.00 | | 17 | 1 | SchwinBike28Mountain | 2 | Blue | 855.00 | +----------+---------+----------------------+------+--------+-----------+ 15 rows in set (0.00 sec) mysql> select * from product; +----------------------+-------------------------+---------------+----------+----------+ | prodnum | prodname | prodsupy | colorgrp | prodcost | +----------------------+-------------------------+---------------+----------+----------+ | Bike28 | standard29InBike | Generic | 8colors | NULL | | Bike28A | Trek28InBike | Trek | 8colors | NULL | | Bike28B | Speedo28InBike | Speedo | 8colors | NULL | | Bike28Cruiser | Cruiser28InBike | AmBike | 8colors | NULL | | Bike28Schwinn | Schwinn28InBike | Schwinn | 8colors | NULL | | Bike31A | Trek31InBike | Trek | 8colors | NULL | | Helmet | standardhelmet | AmManuf | RWB | NULL | | Moped77 | Moped77KPN | KPNEnterprise | WhtBlk | NULL | | ridinggloves | standardRidingGloves | RidingSuppInc | WhtBlk | NULL | | SchwinBike28Mountain | Schwinn28InMountainBike | Schwinn | 8colors | NULL | +----------------------+-------------------------+---------------+----------+----------+ 10 rows in set (0.00 sec)

mysql> select * from salesrep; +-------------+------------+------------+-------------+------------+------------+------------+ | salesrepnum | salesfname | saleslname | salesssn | saleshdate | saleshrate | salesbonus | +-------------+------------+------------+-------------+------------+------------+------------+ | 1 | Mike | Smith | 222-33-4444 | 2001-01-01 | 25 | 4000.00 | | 2 | Alice | Johnson | 999-11-8888 | 2004-05-01 | 27 | 8000.00 | | 3 | Mary | Halvorson | 333-00-9999 | 2004-06-01 | 22 | NULL | +-------------+------------+------------+-------------+------------+------------+------------+ 3 rows in set (0.00 sec)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Practical Neo4j

Authors: Gregory Jordan

1st Edition

1484200225, 9781484200223

More Books

Students also viewed these Databases questions

Question

How wide are Salary Structure Ranges?

Answered: 1 week ago