0% found this document useful (0 votes)
140 views2 pages

Create Database Carshowroom

The document creates a car showroom database with tables for inventory, customers, sales, and employees. It defines the structure and relationships between the tables.

Uploaded by

Shweta Gajre
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
140 views2 pages

Create Database Carshowroom

The document creates a car showroom database with tables for inventory, customers, sales, and employees. It defines the structure and relationships between the tables.

Uploaded by

Shweta Gajre
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

CREATE DATABASE CARSHOWROOM;

USE CARSHOWROOM;

CREATE TABLE INVENTORY (


car_id INT PRIMARY KEY,
name VARCHAR(255),
price DECIMAL(10, 2),
model VARCHAR(50),
year_of_manufacturing INT,
fuel_type VARCHAR(50)
);

CREATE TABLE CUSTOMER (


customer_id INT PRIMARY KEY,
name VARCHAR(255),
address VARCHAR(255),
phone_number VARCHAR(20),
email VARCHAR(255)
);
CREATE TABLE SALE (
invoice_number INT PRIMARY KEY,
car_id INT,
customer_id INT,
sale_date DATE,
mode_of_payment VARCHAR(50),
employee_id INT,
selling_price DECIMAL(10, 2),
FOREIGN KEY (car_id) REFERENCES INVENTORY(car_id),
FOREIGN KEY (customer_id) REFERENCES CUSTOMER(customer_id),
FOREIGN KEY (employee_id) REFERENCES EMPLOYEE(employee_id)
);
CREATE TABLE EMPLOYEE (
employee_id INT PRIMARY KEY,
name VARCHAR(255),
date_of_birth DATE,
date_of_joining DATE,
designation VARCHAR(50),
salary DECIMAL(10, 2)
);

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy