Question: Enrollments table ID varchar (255) Class varchar (255) Section varchar (255) Campus varchar (255) Hours Int (11) School varchar (255) Supplier table supplier_id Int (11)

Enrollments table

ID varchar (255) Class varchar (255) Section varchar (255) Campus varchar (255) Hours Int (11) School varchar (255)

Supplier table

supplier_id Int (11) supplier_name varchar (50)

Parts table

part_id Int (11) part_name varchar (50) supplier_id Int (11)

1. Write a query which selects rows from the enrollments table and filters rows containing 'Biology' in the class_name column.

2. Write a query which selects rows from the enrollments table and filters rows containing '101' in the class_name column.

3. Write a query which returns a count of the rows from the enrollments table containing 'Intro' in the class_name column. (Tip: you need to use an aggregate function.)

4. Write a query which returns a sum of the hours from the enrollments table containing 'Intro' in the class_name column. (Tip: you need to use an aggregate function.)

5. Write a SQL statement which joins the parts table with the suppliers table and lists the part_id, name, and the supplier name for all parts in the part table. The part_id column in the parts table is the primary key, and this key has been exported to the supplier table where it is a foreign key.

6. Write a SQL statement which joins the parts table with the suppliers table and lists the part_id, name, and the supplier_name for all parts in the part table. Only return the parts supplied by 'Marys Quilts'.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!