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 AutoMotors Design and create the following table. 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. Design and create the following table. 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
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.
Query Data
A Write a query to list all vehicles made after the year 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.
Update Data
A Write an SQL command to increase the price of all vehicles by that were made before the year
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
