Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

write the sql queries for : 1- the years when more than 10 cars where sold 2- the car models sold more than 10 cars

write the sql queries for :

1- the years when more than 10 cars where sold

2- the car models sold more than 10 cars in one year

3- the customers registered or not with their license number and loyalty points

4- the rented cars that will be returned before end of march

table structure:

create table car(car_id int,brand varchar(10),model varchar(10),color varchar(10),rental_category varchar(10),selling_price int , primary key( car_id));

create table customer(customer_id int,name varchar(15),date_of_birth date ,primary key(customer_id ));

create table registered(customer_id int,liscense_number int,loyalty_points int, primary key(customer_id ) ,foreign key(customer_id) references customer(customer_id));

create table registered_tel(customer_id int,name number int, primary key(customer_id,number) ,foreign key(customer_id) references customer(customer_id));

create table buy(customer_id int,car_id int,date date,cc_number int,cc_expiry_date date,cc_security_code int , primary key(customer_id,car_id,date ), foreign key(customer_id) references customer(customer_id) ,foreign key(car_id) references car(car_id));

create table rent(customer_id int,car_id int,rental_date date,retur_date date , primary key( customer_id,car_id,rental_date) ,foreign key(customer_id) references customer(customer_id),foreign key(car_id) references car(car_id));

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Design Using Entity Relationship Diagrams

Authors: Sikha Saha Bagui, Richard Walsh Earp

3rd Edition

103201718X, 978-1032017181

More Books

Students also viewed these Databases questions

Question

=+What is the nature of the plant or site-level role of unions?

Answered: 1 week ago