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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started