1. Learn
  2. /
  3. Courses
  4. /
  5. Hierarchical and Recursive Queries in SQL Server

Connected

Exercise

Inserting data to person and order history

Next, you will insert data into the two newly generated tables, Person and History. Enter the following orders:

  1. Andrew Anderson bought an iPhone XS for 1000
  2. Sam Smith bought a MacBook Pro for 1800

When inserting the customers and their orders into the tables make sure that:

  • the primary key is unique
  • you use the correct foreign key

Instructions

100 XP
  • Insert new data for the person with ID=1, Andrew Anderson.
  • Insert new data for the second person with ID=2, Sam Smith.
  • Insert a new order for Andrew Anderson: iPhone XS for 1000.
  • Insert a new order for Sam Smith: MacBook Pro for 1800.