Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
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