Question: 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

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!