|
| 1 | +create database CUSTOMER; |
| 2 | +create table customer_details( |
| 3 | + CUSTOMER_IDcustomer_detailscustomer_detailscustomer_details int , |
| 4 | + CUSTOMER_Name varchar(15), |
| 5 | + CUSTOMER_Number bigint, |
| 6 | + CUSTOMER_Address varchar(200) |
| 7 | + |
| 8 | +); |
| 9 | +select * from customer_details; |
| 10 | + |
| 11 | +desc customer_details; |
| 12 | + |
| 13 | +create table customer_order( |
| 14 | +customer_order_ID int, |
| 15 | +customer_order_Name varchar(15), |
| 16 | +customer_order_Price double |
| 17 | + |
| 18 | +); |
| 19 | + |
| 20 | +select * from customer_order; |
| 21 | + |
| 22 | +desc customer_order; |
| 23 | +show columns from customer_order; |
| 24 | + |
| 25 | +create table customer_transaction( |
| 26 | +transaction_Id int , |
| 27 | +transaction_Time time unique, |
| 28 | +transaction_Amount double check (transaction_Amount>1), |
| 29 | +transaction_Type varchar(10) not null, |
| 30 | +transaction_status boolean, |
| 31 | +primary key (transaction_Id) |
| 32 | +); |
| 33 | +desc customer_transaction; |
| 34 | + |
| 35 | +alter table customer_transaction modify transaction_status boolean default false; |
| 36 | +desc customer_transaction; |
| 37 | +alter table customer_transaction modify transaction_status varchAR(20) default false; |
| 38 | +desc customer_transaction; |
| 39 | +alter table customer_transaction add transaction_Addreses varchAR(20) not null; |
| 40 | +alter table customer_transaction drop transaction_Addreses; |
| 41 | +desc customer_transaction; |
| 42 | +show tables; |
| 43 | + |
| 44 | +create table product( |
| 45 | +product_id int, |
| 46 | +product_Name varchar(15), |
| 47 | +product_price double, |
| 48 | +primary key (product_id) |
| 49 | +); |
| 50 | +show tables; |
| 51 | +select * from product; |
| 52 | +drop table product; |
| 53 | +create database student; |
| 54 | + |
| 55 | +drop database student; |
| 56 | + |
| 57 | +alter table product rename to product_Details; |
| 58 | +alter table product_details rename column product_price to productPRice; |
| 59 | +desc product_details; |
| 60 | +alter table product_details rename column product_price to product_Price; |
| 61 | +insert into product_details (product_id,product_Name,productPRice) values (1,'tv',15000.0); |
| 62 | +insert into product_details (product_id,product_Name,productPRice) values (2,"watch",4500.0); |
| 63 | +insert into product_details (product_id,product_Name,productPRice) values (3,'MObile',10000.0); |
| 64 | +-- insert into product_details values (4,'Bike',450000.0),(5,'Sanitizer',50); |
| 65 | +insert into product_details (product_id,productPRice) values (5,15000.0); |
| 66 | +select * from product_details; |
| 67 | + |
| 68 | +-- delete the table records ------------------------------ |
| 69 | +truncate product_details; |
| 70 | +select * from product_details; |
| 71 | +-- -------------------------------------------------------- |
| 72 | + |
| 73 | + |
| 74 | + |
| 75 | + |
| 76 | + |
| 77 | + |
| 78 | + |
| 79 | + |
0 commit comments