Please answer each question using these tables above, it is SQL
SELECT Top 5 description, price FROM part ORDER BY price DESC;
Explaination: Top will fetch top 5 from the list and we are ordering the list by price in descending order.
SELECT on_hand * price as on_hand from part;
Exp: We can use * to multiply two columns and rename that column as on_hand.
Select part_num, description, on_hand, warehouse where class in ('HW','AP') and warehouse in (1,2);
Exp: IN function is used to check if the element is present in the given set.
Select customer_name from customer where city NOT IN ('Sheldon', 'Grove', 'Fillmore')
Exp: NOT IN is reverse of IN clause.
Select Distinct(city) from customer;
Exp: Distinct is used to omit duplicates.
Select customer_name from customer where zip like
'33%'
Exp: LIKE is used as regular expression and % is used as all the characters. Here I have used '33%' which means match with expression that starts with 33.
Regards.
Please answer each question using these tables above, it is SQL Display the descriptions and prices of the 5 most expe...
Program: MYSQL (please show screenshots of the solution) Ill give good rating! Define a view named TopLevelCust that consists of the number, name, address, balance and credit limit of all customers with credit limits that are greater than or equal to $5,000. Address is defined as street, city, state and zip. Concatenate these into one field named Address. A. Type in your view construct here: B. Write a query to retrieve the number and name of all customers in the TopLevelCust...
Using the Premier Products database answer the following questions 1. Using a union, display all customers that have rep number 65 or live in the town of Sheldon. Display all customer information. Insert your snip of the query and resultset together here: 2. Using a subquery, list the rep information for all customers who have the same credit limit as customer number 725. To receive credit for this question, do not explicitly query for rep number 35. Let MySQL do...
8.Write the commands to obtain the following information from the systems catalog. List every table that you own, list every column in the PART table and its associated data type, then add ORDER_NUM as a foreign key in the ORDER_LINE table. this is the SQL for the database: CREATE DATABASE PREMIERE; USE PREMIERE; CREATE TABLE REP (REP_NUM CHAR(2) PRIMARY KEY, LAST_NAME CHAR(15), FIRST_NAME CHAR(15), STREET CHAR(15), CITY CHAR(15), STATE CHAR(2), ZIP CHAR(5), COMMISSION DECIMAL(7,2), RATE DECIMAL(3,2) ); CREATE TABLE CUSTOMER...
Answer the following questions using mysql. Please show screenshots to make sure the queries work. 1. Use a sub-query and the IN operator to find the number and name of each customer that placed an order on October 23, 2007. 2. Repeat step 2, but this time use the EXISTS operator in your answer. 3. Using a sub-query, find the number and name of each customer that did not place an order on October 23, 2007. 4. Using a sub-query,...
Use the Premiere Products database (see Figure 1-2 in Chapter 1) to complete the following exercises. If directed to do so by your instructor, use the information provided with the Chapter 3 Exercises to print your output. 1. List the part number and description for all parts. The part descriptions should appear in uppercase letters. 2. List the customer number and name for all customers located in the city of Grove.Your query should ignore case. For example, a customer with...
Using MySQL commands answer the questions listed below using the Premier Products Company schema. 1.Using Views a) Create a view called part_location that has the following attributes: part_num, part_description, part_quantity, warehouse_name, warehouse_address. This data comes from the part and warehouse entities. b) Write a query using the view that shows the total number of parts ordered from each warehouse. The output should look like this: 2. Using Triggers a) Execute the following SQL to create the customer_audit table in the...
The common requirements of all questions are the same. Read each question carefully and submit a query to fulfill for each question. Also, students need to submit the result of the corresponding query under the query. Also, assignment has to be written with Microsoft Word for feedback. For technical issue, other formats, such as image, sql, are not appropriate to receive feedback and comments. Don’t delete or change questions. For assignment 5 and 6, you don’t need to submit screenshots....