Baselight

Car Showroom

DataBase Carshowroom

@kaggle.jockeroika_car_showr

Loading...
Loading...

About this Dataset

Car Showroom

🚗 SQL Questions – Car Showroom Schema
1️⃣ Display the employee’s name + the name of the branch in which he works
2️⃣ Display all cars with the name of the manufacturer
3️⃣ Display all contracts with the employee’s name and the client’s name
4️⃣ Show all cars in each branch
5️⃣ Show the employees who have a supervisor
6️⃣ Display the contracts concluded in a specific branch
7️⃣ Show cars model after 2020
8️⃣ Show the employees who work in the same city as the branch
9️⃣ Show customers who have a second phone number
🔟 Show cars that have more than one color
1️⃣1️⃣ Show branches that have more than 5 employees
1️⃣2️⃣ Show companies that have more than 3 Arab models
1️⃣3️⃣ Show cars that have more than one contract.
1️⃣4️⃣ Show employees who have worked for more than two decades
1️⃣5️⃣ Show the branches in which the total number of cars is greater than 10
1️⃣6️⃣ Show employees whose salary is higher than the average salary
1️⃣7️⃣ Show cars whose price is higher than the average price of cars
1️⃣8️⃣ Show clients who have worked on contracts in more than one branch
1️⃣9️⃣ Show the employees who work in the same branch as their manager
2️⃣0️⃣ Only display cars with the latest price
2️⃣1️⃣ Show the employees whose number of contracts is greater than the average
2️⃣2️⃣ Show the branches whose income (sum car_price) is greater than the rest of the branches
2️⃣3️⃣ Show companies whose cars have been followed more than 5 times
2️⃣4️⃣ Show clients whose total contract money is higher than any other client
2️⃣5️⃣ Show the employees who worked on all types of cars
2️⃣6️⃣ Show the branch with the largest number of contracts
2️⃣7️⃣ Show the best-selling Arabic
2️⃣8️⃣ Show the top selling employee
2️⃣9️⃣ Show customers who have dealt with all payment methods
3️⃣0️⃣ Show the company whose average car prices are the highest

Tables

Branch Data

@kaggle.jockeroika_car_showr.branch_data
  • 4.46 kB
  • 5 rows
  • 5 columns
Loading...
CREATE TABLE branch_data (
  "branch_id" BIGINT,
  "street" VARCHAR,
  "city" VARCHAR,
  "building_number" BIGINT,
  "contact_number" BIGINT
);

Car Branch Data

@kaggle.jockeroika_car_showr.car_branch_data
  • 3.31 kB
  • 50 rows
  • 3 columns
Loading...
CREATE TABLE car_branch_data (
  "car_id" BIGINT,
  "branch_id" BIGINT,
  "no_of_cars" BIGINT
);

Car Color Data

@kaggle.jockeroika_car_showr.car_color_data
  • 2.66 kB
  • 101 rows
  • 2 columns
Loading...
CREATE TABLE car_color_data (
  "car_id" BIGINT,
  "color_id" BIGINT
);

Car Data

@kaggle.jockeroika_car_showr.car_data
  • 4.36 kB
  • 50 rows
  • 4 columns
Loading...
CREATE TABLE car_data (
  "car_id" BIGINT,
  "company_id" BIGINT,
  "model" VARCHAR,
  "year" BIGINT
);

Car Price History Data

@kaggle.jockeroika_car_showr.car_price_history_data
  • 7.16 kB
  • 150 rows
  • 4 columns
Loading...
CREATE TABLE car_price_history_data (
  "car_price_id" BIGINT,
  "car_id" BIGINT,
  "price" DOUBLE,
  "price_date" TIMESTAMP
);

Company Data

@kaggle.jockeroika_car_showr.company_data
  • 2.44 kB
  • 10 rows
  • 2 columns
Loading...
CREATE TABLE company_data (
  "company_id" BIGINT,
  "name" VARCHAR
);

Contract Data

@kaggle.jockeroika_car_showr.contract_data
  • 10.95 kB
  • 176 rows
  • 8 columns
Loading...
CREATE TABLE contract_data (
  "contract_id" BIGINT,
  "car_id" BIGINT,
  "branch_id" BIGINT,
  "emp_ssn" BIGINT,
  "cust_ssn" BIGINT,
  "method_id" BIGINT,
  "car_price_id" BIGINT,
  "contract_date" TIMESTAMP
);

Customer Data

@kaggle.jockeroika_car_showr.customer_data
  • 16.39 kB
  • 249 rows
  • 10 columns
Loading...
CREATE TABLE customer_data (
  "ssn" BIGINT,
  "fname" VARCHAR,
  "lname" VARCHAR,
  "street" VARCHAR,
  "city" VARCHAR,
  "building_number" BIGINT,
  "phone_1" BIGINT,
  "phone_2" BIGINT,
  "gender" VARCHAR,
  "birthdate" TIMESTAMP
);

Employee Data

@kaggle.jockeroika_car_showr.employee_data
  • 11.71 kB
  • 50 rows
  • 13 columns
Loading...
CREATE TABLE employee_data (
  "ssn" BIGINT,
  "fname" VARCHAR,
  "lname" VARCHAR,
  "street" VARCHAR,
  "city" VARCHAR,
  "building_number" BIGINT,
  "phone_1" BIGINT,
  "phone_2" BIGINT,
  "gender" VARCHAR,
  "birth_date" TIMESTAMP,
  "job_id" BIGINT,
  "supervisor_id" BIGINT,
  "branch_id" BIGINT
);

Job Data

@kaggle.jockeroika_car_showr.job_data
  • 2.44 kB
  • 10 rows
  • 2 columns
Loading...
CREATE TABLE job_data (
  "job_id" BIGINT,
  "title" VARCHAR
);

Payment Method

@kaggle.jockeroika_car_showr.payment_method
  • 2.31 kB
  • 3 rows
  • 2 columns
Loading...
CREATE TABLE payment_method (
  "method_id" BIGINT,
  "method" VARCHAR
);

Salary History

@kaggle.jockeroika_car_showr.salary_history
  • 5.4 kB
  • 43 rows
  • 5 columns
Loading...
CREATE TABLE salary_history (
  "job_id" BIGINT,
  "emp_ssn" BIGINT,
  "salary" DOUBLE,
  "comm_pct" DOUBLE,
  "date" TIMESTAMP
);

Share link

Anyone who has the link will be able to view this.