Question: Using Microsoft SQL , design and create a database system called Auto _ Motors 1 . 2 Design and create the following table. 1 .

Using Microsoft SQL , design and create a database system called Auto_Motors 1.2 Design and create the following table. 1. Vehicles VehicleID as an integer, primary key. Make as a variable character string, not null. Model as a variable character string, not null. Year as an integer, not null. Price as a decimal. 1.3 Design and create the following table. 2. Customers CustomerID as an integer, primary key. FirstName as a variable character string, not null. LastName as a variable character string, not null. Phone as a variable character string. Email as a variable character string.
Add a table called Sales containing CustomerID and VehicleID
2.2 Add Constraints
Add a foreign key constraint that references VehicleID from the Vehicles table.
Ensure Email in the Customers table is unique across all entries.
Insert Data
A. Insert at least five records into the Vehicles table.
B. Insert at least five records into the Customer table.
3.2 Query Data
A. Write a query to list all vehicles made after the year 2015, including their make, model, and price
B. Write a SQL query to find the total number of vehicles each customer has purchased, listing customer's
name and the count of vehicles incorporating the Sales table with CustomerID and VehicleID.
3.3 Update Data
A. Write an SQL command to increase the price of all vehicles by 5% that were made before the year 2010.

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!