Write a SQL statement which joins the parts table with the supplier table and lists the...

90.2K

Verified Solution

Question

Programming

  1. Write a SQL statement which joins the parts table with thesupplier table and lists the part_name, supplier_name for all partsin the part table. The supplier_id column in the suppliers table isthe primary key in the suppliers table, and this key has beenexported to the parts table where it is a foreign key. You shoulduse an inner join for this query.
  2. Write a SQL statement which joins the parts table with thesuppliers table and lists the part_name, supplier_name. You shouldreturn all rows from the parts table whether or not there arecorresponding rows in the supplier table. You should use anouter join for this query.
  3. Write a SQL statement which joins the parts table with thesupplier table and lists the part_no, part_name, supplier_name fromparts and suppliers table. Only return the parts supplied by ‘FredSmith ..'. You should use an inner join for this query.
  4. The faculty table contains faculty information and has afaculty_id as the primary key. The faculty_department table has thedepartment assignments for faculty members and has the faculty_idfrom the faculty table as an exported key or foreign key. Thedepartment table has information about departments and has adepartment_id column as its primary key. The faculty_departmenttable also has the exported key or foreign key for the departmenttable.

Write a SQL statement to displayfaculty_id, first name, last name, department_id, department name(need to joins the faculty table with the faculty_department tablewith the department table. )Use an inner join for this query.

Answer & Explanation Solved by verified expert
4.3 Ratings (787 Votes)
HI Below are SQL queries for you given statements SQL1 SELECT ssuppliername ppartname FROM supplier s INNER JOIN parts p ON ssupplierid psupplierid SQL2 I am using SQlite for the query and SQLite does    See Answer
Get Answers to Unlimited Questions

Join us to gain access to millions of questions and expert answers. Enjoy exclusive benefits tailored just for you!

Membership Benefits:
  • Unlimited Question Access with detailed Answers
  • Zin AI - 3 Million Words
  • 10 Dall-E 3 Images
  • 20 Plot Generations
  • Conversation with Dialogue Memory
  • No Ads, Ever!
  • Access to Our Best AI Platform: Flex AI - Your personal assistant for all your inquiries!
Become a Member

Other questions asked by students