Question: (Normalize these tables). Store System Use SQL to answer the queries below: (20 Marks) 1. Write a SQL statement to add new column in Address

(Normalize these tables). Store System

Use SQL to answer the queries below: (20 Marks) 1. Write a SQL statement to add new column in Address Table with column name as District with data type varchar and length 40 and insert data in that column. (2) 2. Write a SQL statement to find name of the product and total no of that product sales till date.

Table Name: Product

ProductCode

Product_name

Unit_Price

P1

Noodles

30

P2

Rice

900

P3

Coffee

400

P4

Oil

200

P5

Biscuits

60

P6

Dishwasher

90

Table Name: Order Detaits

Order

_id

Product

_id

Custom

er_id

Customer_nam

e

Customer _address

Order_date

Quantity

Ord1

P3

C1

Saroj Karki

Add1

2020-01-20

3

Ord1

P4

C1

Saroj Karki

Add1

2020-01-20

4

Ord2

P5

C2

Rohit Pandey

Add2

2020-04-05

2

Ord3

P3

C1

Saroj Karki

Add2

2020-04-05

1

Ord4

P2

C3

Santos Katuwal

Add3

2020-06-25

5

Ord4

P4

C3

Santos Katuwal

Add4

2020-06-25

4

Ord4

P1

C3

Santos Katuwal

Add2

2020-06-25

4

Ord5

P6

C4

Bidur Khanal

Add1

2020-07-21

2

Ord6

P6

C5

Kusum Tamang

Add5

2020-07-08

1

Ord7

P3

C3

Santos Katuwal

Add5

2020-04-03

6

Table Name: Address

Address_i d

Country

Zone

City

Add1

Nepal

Koshi

Itahari

Add2

Nepal

Mechi

Jhapa

Add3

Nepal

Bagmati

Kathmandu

Add4

Nepal

Bagmati

Lalitpur

Add5

Nepal

Koshi

Dharan

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!