Consider the following relations. Product: (Product#, p-description, p-indate, p-price) Vendor: (V-code, v-name, v-address) Purchase: (Product#, V-code, date) Write an SQL query to list the prices of the products that were purchased on 9 December 2019
Dear Student ,
As per requirement submitted above kindly find below solution.
SQL query :
select p-price from Product,Purchase where Product.Product#=Purchase.Product# and date='2019/12/09';
Explanation :
NOTE :PLEASE FEEL FREE TO PROVIDE FEEDBACK ABOUT THE SOLUTION.
Consider the following relations. Product: (Product#, p-description, p-indate, p-price) Vendor: (V-code, v-name, v-address) Purchase: (Product#, V-code,...
Answer all questions on paper: Consider the database model below The database model FIGURE 7.1 CUSTOMER INVOICE LINE PK CUS CODE INV NUMBER FK1 CUS_COOE NV DATE CUS LNAME CUS FNAME CUS INITIAL CUS AREACODE CUS PHONE CUS BALANCE LINE UNITS LINEPRICE - isfound in VENDOR PRODUCT V NAME supplies P INDATE P DESCRIPT CONTACT de- V AREACODE V PHONE V STATE V ORDER ?,.QOH P MIN P PRICE Write the SQL code for creating the database and all the...
consider the following schema: Product(pid, name, type, manufacturer, price) key: pid Buys(cid, pid) key: cid and pid together Customer(cid, cname, age, gender) key: cid 1) write the following query in relational algebra; find the names of all customers who have purchased all products manufactured by sears. 2)write the following in sql: find the names of all the customers who have not purchased the most expensive product. 3)write the following query in sql: find the best selling products (in terms of...
consider the following schema: Product(pid, name, type, manufacturer, price) key: pid Buys(cid, pid) key: cid and pid together Customer(cid, cname, age, gender) key: cid 1) write the following query in relational algebra; find the names of all customers who have purchased all products manufactured by sears. 2)write the following in sql: find the names of all the customers who have not purchased the most expensive product. 3)write the following query in sql: find the best selling products (in terms of...
PLease answer the question in SQL plus: vendor (vid, vendorname, address) mis (fedid, stateid, name, address) storerequest (requestno, storeno, date) vendorcatalog (vid, itemno) storerequestItem (requestno, itemno, quantity) inventory (itemno, location, quantity) inventorydes (itemno, itemdescription, unitcost) store (storeno, name, address, fedid, description) List the store number and store name that has not put in an order during January 2019.
1- Consider the following SQL query and related relations SELECT P.Name FROM Players P, Games G WHERE P.Id = G.PlayerId AND P.Game = 'Football' AND G.Season ='2019' where: Players (Id, Name, Game) Games (PlayerId, GameCode, Season) A- Translate the above SQL query to a relational algebra expression. B- Draw the Query tree for above relational algebra expression in part (a). Note: Please no screenshot
31. (15 pts) Consider the following relations and relationship: Student (studentID, name, address, gender, major) Course (courselD, title, hour, department) Enrollment (StudentID, courselD, date Write the SQL statements to perf orm the following operations: List all the students' information for those majoring in "Computer Science". (2 pts) List the majors, and the numbers of the students in every major. (2 pts) List the departments, and the total number of hours of the courses offered by every department. (2 pts) List...
Write a SQL query that shows the price of each order made by customers whose last name starts with the letter M. Display the order number, the last name on the order, and the price of the order (Order Price). Show the results with the highest order price first. Write a SQL query that determines the most expensive item purchased in each order (Item Price). Display the order number, the date of the order, the last name of the customer...
using SQL Assume the relations shown below (underlined attributes are primary and foreign keys): merchants(mid, name, city, state) products(pid, name, category, description) sell(mid, pid, price, quantity_available) orders(oid, shipping_method, shipping_cost) contain(oid,pid) customers(cid, fullname, city, state) place(cid, oid, order_date) For each of the following questions write a SQL query: List names and sellers of products that are no longer available (quantity=0) List names and descriptions of products that are not sold. How many customers bought SATA drives but not any routers between 2009...
DML: Illustrative DataBase Column DataType SizeDecimal Domain PK? FK? Positions PRODUCT LINE PCODE PDESCRIPT Character1-35 Character 8 P INDATE Date P ONHAND Numeric P MIN P PRICE P DISCOUNT Numeric V CODE Numeric601000000 VENDOR PRODUCT Valid date Numeric Numeric z 0 0.00 & s 1.00 V NAME Character 1-35 V CONTACT Character 1 2 V AREACODE Numeric V PHONE Numeric Character Character 100 & 5 999 e 1010000 Alphabetic Y. 'N V ORDER Questions Given the metadata above for columns...
We will use a simple database composed of the following tables: CUSTOMER, INVOICE, LINE, PRODUCT, and VENDOR. This database model is shown in Figure 1. The database model in Figure 1 reflects the following business rules: - A customer may generate many invoices. Each invoice is generated by one customer. - An invoice contains one or more invoice lines. Each invoice line is associated with one invoice. - Each invoice line references one product. A product may be found in...