Data Table

 

Create a database Customers and Transaction  

Solution :- 

Create database Cust_trans

Output :- 

Select the database Cust_trans

Solution :- 

use Cust_trans;

Output :-

Create table Customer?

Solution :- 

create table Customer
(
Cno int primary key,
Cname varchar(50),
address varchar(50));

Output :- 

Create table Transaction ?

Solution :- 

create table Transaction
(
TRNO varchar(10) primary key,
CNO int,
Amount int,
Type varchar(50),
DOT date,
foreign key (CNO) references Customer(CNO));

Output :- 

 

Write a query to insert data into customer table.

Solution :- 

 

Write a query to inset data into Transaction table.