Challenge

Project 1

/*Task-3*/

1.SELECT * FROM customers ORDER BY city;

2. ALTER TABLE products CHANGE product_id prod_id INT;
ALTER TABLE products CHANGE product_name prod_name VARCHAR(100);
ALTER TABLE products CHANGE category prod_category VARCHAR(100);
ALTER TABLE products CHANGE price prod_price INT;
ALTER TABLE products CHANGE brand prod_brand VARCHAR(100);
ALTER TABLE products CHANGE tot_quantity prod_tot_quantity INT;
ALTER TABLE products CHANGE color prod_color VARCHAR(100);
ALTER TABLE products CHANGE salesman_id prod_salesman_id INT;
ALTER TABLE products CHANGE size prod_size VARCHAR(100);
ALTER TABLE products CHANGE current_discount prod_current_discount DECIMAL(3,2);
ALTER TABLE products CHANGE placeoforigin prod_placeoforigin VARCHAR(100);
ALTER TABLE products CHANGE avgratings prod_avgratings INT;
ALTER TABLE products CHANGE totalratings prod_totalratings INT;
ALTER TABLE products CHANGE review prod_review VARCHAR(100);
ALTER TABLE products CHANGE reviewcountry prod_reviewcountry VARCHAR(100);
ALTER TABLE products CHANGE isOnSale prod_isOnSale VARCHAR(100);
ALTER TABLE products CHANGE images prod_images VARCHAR(100);
ALTER TABLE products CHANGE question_with_answer prod_question_with_answer VARCHAR(100);

3. SELECT *FROM customers;

4. SELECT * FROM customers HAVING COUNT(customer_id)>1;

5. SELECT *FROM orders WHERE purch_amt >10000 AND STATUS = 'delivered' HAVING COUNT(customer_id)>1;


6.  Procedure:

  • create database like ecommerce1 by using CREATE DATABASE database_name; (sqlcommand). 

  •  create tables like customers,products,orders,salesman,admin,payment and Transaction_detail by using CREATE TABLE table_name(col_name1 datatype,col_name2 datatype,col_name3 datatype,...);

  • Inserting suitable values for mentioned tables by using INSERT INTO sql command like INSERT INTO table_name(col_name1,col_name2,col_name3,....) VALUES(value1,value2,value3,.....);

  • And then renaming the column name by ALTER TABLE table_name CHANGE oldcol_name newcol_name datatype;

  • Now run the queries which are crreated for e-commerce1 database.
Your portfolio, next

Ship work like this
in your own course.

Talk to a career counsellor

Free 20-minute call. We'll map the right course to where you want to work.

By submitting you agree to our Terms and Privacy Policy.