Exercise: Introduction to Database Concepts
Test your understanding of fundamental database concepts.
We'll cover the following...
Time to roll up our sleeves and put our knowledge into practice!
Question 1
Given the following structure of the Products table:
Field | Type |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Where ProductID is the primary key and CategoryID is the foreign key from the Categories table. The table contains information about products.
Write an SQL query to find the ProductName and Stock for all products in the Products table that have a Price less than $50.00.
-- Select the product name and stock for products priced under $50
If you’re stuck, click the “Show Solution” button.
Question 2
Given the following structure of the Customers table:
Field | Type |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Where CustomerID is the primary key and ReferralID is self-referencing to CustomerID. The table contains information about customers. ...