Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Help me check my SQL statement. There are errors in that. I cannot run the SQL. I need a copy of brief correction/answer of that

Help me check my SQL statement. There are errors in that. I cannot run the SQL. I need a copy of brief correction/answer of that SQL. As soon as possible. Thank You.

DROP TABLE Customer;

CREATE TABLE Customer

( CustomerNo Char(10),

FirstName Varchar(25),

LastName Varchar(25),

Email Varchar(25),

Username Char(20),

Country Varchar(20),

PhoneNo char (20),

PRIMARY KEY (CustomerNo));

insert into Customer

values('A01', 'Josh', 'Karen' ,'joshkaren@yahoo.com', 'Josh.K', 'Australia', '+61 412 345 678');

insert into Customer

values('A02','Abdul','Hadi','abdhadi95@yahoo.com','Hadi28', 'Malaysia', '+60 1111132677');

insert into Customer

values('A03','Alice','Steward','aliceS11@yahoo.com','AliceS','United Kingdom','+44 7911 123456');

insert into Customer

values('A04','Nurul','Amnah','n.amanah@yahoo.com','Amnah01','Malaysia','+60 136727142');

insert into Customer

values('A05','Siti','Hanie','haniee@yahoo.com','SitiHanie','Malaysia','+60 124538899');

insert into Customer

values('A06','Zahra','Nawra','zhranawra@yahoo.com','Z.Nawra','Malaysia','+60 112546653');

DROP table Plant;

CREATE table Plant

(PlantID char(5) not null,

NameOfPlant varchar(100),

Species_Plant varchar(80),

Diseases_Plant varchar(80),

PestsOfPlant varchar(80),

PlantCare varchar(150),

Fertilizers varchar(100),

PRIMARY KEY (PlantID)

);

insert into Plant

values('AA11','Hibiscus','Tiliaceus','Leaf spot','Adoretus Sinicus','Grows best in full sun','Organic');

insert into Plant

values('BB11','Lavandula','Angustifolia','Root rot','Pythium','Bright sunlight','Organic');

insert into Plant

values('CC11','Dianthus','Barbatus','Fusarium Wilt','Fusarium Oxysporum','Grows in all conditions','General');

insert into Plant

values('BB21','Lavandula','Latifolia','Root rot','Pythium','Bright sunlight','Organic');

insert into Plant

values('CC21','Dianthus','Chinensis','Root and stem rot','Phytophthora','Grows best in alkaline soil','Liquid');

insert into Plant

values('AA21','Hibiscus','Arnottianus','Leaf spot','Adoretus Sinicus','Grows best in full/partial sun','Organic');

DROP table Orders;

CREATE TABLE Orders

( OrderID Char(10) not null,

CustomerNo Varchar(25),

Package Varchar(25),

PaymentDate Varchar(25),

PRIMARY KEY (OrderID),

FOREIGN KEY (CustomerNo) references Customer(CustomerNo));

insert into Orders

values('B01', 'A05', 'Premium' , to_date('14-Jun-2019', 'dd-Mon-YYYY'));

insert into Orders

values('B02','A01','Premium', to_date('5-Apr-2020', 'dd-Mon-YYYY'));

insert into Orders

values('B03','A06','Premium', to_date('8-Mar-2020', 'dd-Mon-YYYY'));

insert into Orders

values('B04','A03',NULL, to_date('3-Jan-2019', 'dd-Mon-YYYY'));

insert into Orders

values('B05','A02','Premium', to_date('19-May-2020', 'dd-Mon-YYYY'));

insert into Orders

values('B06','A04',NULL, to_date('13-Jun-2020', 'dd-Mon-YYYY'));

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Case Studies In Business Data Bases

Authors: James Bradley

1st Edition

0030141346, 978-0030141348

More Books

Students also viewed these Databases questions

Question

4. Choose appropriate and powerful language

Answered: 1 week ago

Question

2. Choose an appropriate organizational pattern for your speech

Answered: 1 week ago