create database Huma1
create database Huma1
To create a merchant database with customer, supplier, customer_order, orderItem and product
table their respective relationships Equipment tools and materials: SQL server 2008 Step 1:
Create database merchant;
Step 2: create customer table In order to create customer table, we will write the following SQL
statement
CREATE TABLE Customers ( Id int identity primary key, FirstName nvarchar(40) not null,
LastName nvarchar(40) not null, City nvarchar(40) null, Country nvarchar(40) null, Phone
nvarchar(20) null)
Step 4: To retrieve the customers table, we can write the following SQL statement
Step 7: To retrieve the supplier table, we can write the following SQL statement
Step 8: Here we will create Customer_order table In order to create the customer_order table, we
will write the following SQL statement
CREATE TABLE "customer_Order" ( Id int identity primary key, OrderDate datetime not null
default getdate(), OrderNumber nvarchar(10) null, CustomerId int not null foreign key references
customers (id) TotalAmount decimal(12,2) null default 0,) Constraint PK_ORDER primary key
(Id) )
Step 10: To retrieve the Customer_order table, we can write the following SQL statement
Select * from Customer_order Quality Criteria: your output should look like this
Step 11: Here we will create OrderItem table (refer step 8
Step 13: To retrieve the OrderItem table, we can write the following SQL statement Select *
from OrderItem Quality Criteria: your output should look like this
Step 16: To retrieve the Product table, we can write the following SQL statement