0% found this document useful (0 votes)
20 views

Mysql Query Screen Shot

The document outlines the structure and creation of multiple database tables for a fired up repair and sales database. It includes the CREATE TABLE statements to define the structure of tables for customers, customer contact info, orders, order lines, parts, repairs, and stoves. It also provides examples of INSERT statements to add data to the customer table and instructions for viewing the data and structure of all tables.

Uploaded by

Kalai Vani
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
20 views

Mysql Query Screen Shot

The document outlines the structure and creation of multiple database tables for a fired up repair and sales database. It includes the CREATE TABLE statements to define the structure of tables for customers, customer contact info, orders, order lines, parts, repairs, and stoves. It also provides examples of INSERT statements to add data to the customer table and instructions for viewing the data and structure of all tables.

Uploaded by

Kalai Vani
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 14

Screen Shot Fired Up Database

Tables :

Customer Table Structure

Data:

CustomerPhone Table Structure

Data:

CustomerEmail Table Structure

Data:

Orderline Table Structure

Data:

Orders Table Structure

Data:

Parts Table Structure

Data:

Repairs Table Structure

Data:

Stoves Table Structure

Data:

Queries Create Database: create database firedup; use Database: use firedup; create Table: CREATE TABLE Table_Name (column_specifications) Customer Table: CREATE TABLE customer (CustID INT NOT NULL, PrimaryKey, VARCHAR(20) NOT NULL, VARCHAR(20) NOT NULL, VARCHAR(20) NOT NULL, VARCHAR(20) NOT NULL, VARCHAR(20) NOT NULL, VARCHAR(10) NOT NULL, VARCHAR(10) NOT NULL, bigint(10), VARCHAR(10), NOT NULL, NOT NULL);

CustFname CustMiddle CustLname Address1 Address2 City State PostalCode Country

Customer Phone Table: CREATE TABLE CustomerPhone (CustID INT NOT NULL, CustPhone bigint(10) NOT NULL);

Customer Email Table: CREATE TABLE Customer Email (CustID INT NOT NULL, CustEmail VarChar(20) NOT NULL);

Orderline Table: CREATE TABLE Orderline (OrderNum ModelID PartID SerialNum Quantity QuotedPrice SellingPrice OrdersTable: CREATE TABLE Orders (OrderNum CustID OrderID INT (10) NOT NULL, PrimaryKey, INT (20) NOT NULL, date NOT NULL); INT (10) NOT NULL, PrimaryKey, INT (20) NOT NULL, INT (20) NOT NULL, INT (20) NOT NULL, INT (20) NOT NULL, float (20) NOT NULL, float (10) NOT NULL);

Parts Table: CREATE TABLE Parts (PartID SerialNum PartCost INT (10) NOT NULL, PrimaryKey, INT (20) NOT NULL, float NOT NULL, NOT NULL,

PartSellingPrice float PartOnHand Repairs Table: CREATE TABLE Repairs (RepairID CustID RepairDate ModelID PartID SerialNum RepairCost RepairType

INT (20) NOT NULL);

INT (10) NOT NULL, PrimaryKey, INT (20) NOT NULL, date NOT NULL,

INT (20) NOT NULL, INT (20) NOT NULL, INT (20) NOT NULL, float NOT NULL,

Varchar (20) NOT NULL);

Stoves Table: CREATE TABLE Stoves ( ModelID SerialNum MfgDate InspectorIns ModelPrice StovesOnHand INT (10) NOT NULL, PrimaryKey, INT (20) NOT NULL, date NOT NULL,

VarChar (20) NOT NULL, float NOT NULL,

INT (20) NOT NULL,

WarrentyPeriod INT (20) NOT NULL);

View Tables: Show Tables;

Inserting Data to Tables: General: Insert into tablename (values); Example: Customer Table: Insert into customer values(1,David,Roy,Witold,1.BStreet,12/1,F Street,ArrowTown,Auckland,1151,NewZealand); Using above query u can insert value into any tables. If data type is varchar means then mention with in single quotation.

View the Data: General: Select * from tablename; Example: Customer Table: Select * from customer;

You might also like