c)
SELECT sid, sname, address
FROM Suppliers, Parts , Catalog
WHERE Suppliers.sid=Catalog.sid AND Catalog.pid=Parts.pid
d)
SELECT DISTINCT pid
FROM Parts
WHERE Parts.color= "black"
*****************************************************************************
PLEASE DO UPVOTE IF THE ANSWER IS HELPFUL AS IT GIVES THE
CONFIDENCE TO HELP MORE STUDENTS
*****************************************************************************
Chegg allows me to answer specific no of questions including the
sub parts , so please do post the rest of the questions as a
separate query as per Chegg Guidelines. Thank you :)
*****************************************************************************
In .sql Given the following relational schemas, answer the following questions: Suppliers(sid: int, sname: VARCHAR(30), address:...
Consider the following schema: Suppliers (sid: integer, sname: varchar, address: varchar) Parts (pid: integer, pname: varchar, color: varchar) Catalog (sid: integer, pid: integer, cost: real) that order) (1pt.) Where sid is the supplier’s id (primary key in Suppliers), pid is the part’s id (primary key in Parts), and sid together with pid is the primary key of Catalog. The Catalog relation lists the prices charged for parts by Suppliers. Write the following queries using relational algebra: Find the names...
Consider the following database Relation Schemas: Relation Schemas: Suppliers(SID CHAR(5), Parts(pID VARCHAR(5), type VARCHAR(15), pName VARCHAR(35), sName VARCHAR(15), address VARCHAR(30, city VARCHAR(20), state CHAR(2), PRIMARY KEY(sID); PRIMARY KEY(pID) Catalog(sID CHAR(5), pID VARCHAR(5), ty SMALLINT, cost FLOAT (10,2), PRIMARY KEY(sid, pid), FOREIGN KEY(sid) REFERENCES Suppliers(SID), FOREIGN KEY (pid) REFERENCES Parts pID) The meaning of these relations is straightforward; for example, the Catalog relation lists the prices charged for parts by Suppliers. Instances of the relations Suppliers sName address SID cit state...
EXERCISE 1 (SQL Queries) Consider the following schema: SUPPLIERS (SID : integer, SNAME : string, CITY : string) PARTS (PID : integer, PNAME : string, COLOR : string) CATALOG (SID : integer, PID : integer, COST : real) The key fields are underlined, and the domain of each field is listed after the field name. Thus, SID is the key for SUPPLIERS, PID is the key for PARTS, and SID and PID together form the key for CATALOG. The CATALOG...
Please finish all parts, thanks!
2) Consider the following schema: Suppliers(sid: integer, sname: string, address: string) Parts(pid:integer, pname: string, color: string ) Catalog( sid: integer, pid: integer, cost: real) Write the following queries in relational algebra. a) Find the names of suppliers who supply some red part b) Find the sids of suppliers who supply some red or green part c) Find the sids of suppliers who supply some red and some green part. d) Find the sids of suppliers...
Consider the following schema: SUPPLIERS (SID: integer, SNAME: string, STREET: string, CITY: string, ZIP: string) PARTS (PID: integer, PNAME: string, COLOR: string) CATALOG (SID: integer, PID: integer, COST: real) The primary key attributes are underlined, and the domain of each attribute is listed after the attribute name. Thus, SID is the primary key for SUPPLIERS, PID is the primary key for PARTS, and SID and PID together form the primary key for CATALOG. Attribute SID in CATALOG is a foreign...
consider the following relational database that records details
of parts and suppliers. Primary keys are underlined and the Foreign
Keys are identified with (FK).
Suppliers (sid, sname, address, credit)
Parts (pid, pname, color)
Catalog (sid (FK), pid (FK), cost)
The credit attribute denotes the size of the supplier’s credit
account. The Catalog relation lists the prices charged for parts by
Suppliers.
Which of the following queries returns the snames of suppliers who supply every part? Select one or more: a....
Suppliers(sid: integer, sname: string, address:string)Parts(pid: integer, pname: string, color: string)Catalog(sid: integer, pid: integer, cost: real)The Catalog relation lists the prices charged for parts bySuppliers. Write the following queries in SQL:1) Find the pnames of parts supplied by Acme Widget Suppliers andno one else.2) Find the sids of suppliers who charge more for some partthan the average cost of that part (averaged over all the supplierswho supply that part).3) For each part, find the sname of the supplier who chargesthe most...
C. Answer the following five (5) questions, based on the schema provided.Consider the following schema:Supplier (sid: integer, sname: string, address: string)Part(pid: integer, pname: string, , color: string)Catalog(sid: integer, pid: integer, cost: real)The relation Supplier stores suppliers and the primary key of that relation is sid. The relation Part stores parts, and pid is the primary key of that relation. Finally, Catalog stores which supplier supplies which part and at which cost (price). The primary key is the combination of the...
Express the following queries in SQL. Only standard SQL syntax is allowed. Each query should be answered in a single SQL statement: 1. Find the name of suppliers that are located in Mumbai. 2. Find the name of suppliers and the names of parts they sell. List the result in descending order suppliers name. 3. Find the names of parts that are sold by exactly two suppliers. 4. Find the names of parts that are sold by all suppliers. 5....
***SQL DML*** Write SQL statements to answer the following questions. Note that you do not need data tuples to answer these questions. Use the following relational schema. Supplier (sid, name, status, city) Part (pid, name, color, weight, city) Job (jid, name, city) Supplies (/sid/, /pid/, /jid/, quantity) Use subquery, what are the id and the name of all suppliers, whose total quantity is larger than the total quantity of all suppliers in city ‘London’?