Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

questions #21

Open
SjxSubham opened this issue Feb 18, 2025 · 0 comments
Open

questions #21

SjxSubham opened this issue Feb 18, 2025 · 0 comments

Comments

@SjxSubham
Copy link
Owner

SjxSubham commented Feb 18, 2025

Assignment 3

insert data into customer table

INSERT INTO CUSTOMER (Cust_no, Cust_name, State) VALUES (1001, 'Prakash', 'UP');
INSERT INTO CUSTOMER (Cust_no, Cust_name, State) VALUES (1002, 'Mukesh', 'AP');
INSERT INTO CUSTOMER (Cust_no, Cust_name, State) VALUES (1003, 'Murti', 'UP'); -- Fixed special character issue
INSERT INTO CUSTOMER (Cust_no, Cust_name, State) VALUES (1004, 'Rajan', 'WB');
COMMIT;
  1. SELECT * FROM ITEM;
  2. SELECT * FROM CUSTOMER WHERE State = 'UP';
  3. SELECT * FROM CUSTOMER WHERE Cust_name = 'Prakash';
  4. SELECT * FROM CUSTOMER WHERE State IN ('AP', 'WB');
  5. SELECT * FROM CUSTOMER WHERE State <> 'UP';
  6. SELECT * FROM ITEM WHERE I_name = 'Nail';
  7. SELECT * FROM ITEM WHERE I_price BETWEEN 2 AND 6;
  8. SELECT * FROM ITEM WHERE I_price NOT BETWEEN 2 AND 6;
  9. SELECT * FROM ITEM WHERE I_price > 1.00 AND I_qty < 200;
  10. SELECT * FROM ITEM WHERE I_name LIKE '%o%';
  11. SELECT * FROM ITEM WHERE I_name LIKE 'A%';
  12. SELECT * FROM ITEM WHERE I_name LIKE '%r';
  13. SELECT * FROM CUSTOMER ORDER BY State DESC;

Assignment 3

Insert the following data into the ITEM table
I_no I_name I_price I_qty
1 Sword 2.25 50
2 Nut 5.00 110
3 Bolt 3.99 75
4 Hammer 9.99 125
5 Washer 1.99 100
6 Nail 0.99 300
7 Axe 3.55 25
8 Scissor 2.19 15

@SjxSubham SjxSubham changed the title 1. Create a table named as ITEM with the following specificaƟons AƩribute Name Data Types Constraints I_no Integer in nature Primary Key, values within 1 to 1000 I_name String with maximum 20 characters Cannot be null, will be in UPPERCASE I_price Decimal in nature Should be within 1.00 to 25.95 I_qty Integer in nature Should not be less than 1 2. Create a table named as DUMMY_ITEM_1 with the same specificaƟons as of ITEM. 3. Create a table named as DUMMY_ITEM_2 with the same specificaƟons as of ITEM but aƩributes names will be as follows: I_no --- > Item_no , I_name ---> Item_name, I_price --- > Item_price, I_qty ---> Item_quanƟty 4. Drop the Primary key from ITEM table. 5. Add the Primary Key in the ITEM table. 1. Create a table named as ITEM with the following specificaƟons AƩribute Name Data Types Constraints I_no Integer in nature Primary Key, values within 1 to 1000 I_name String with maximum 20 characters Cannot be null, will be in UPPERCASE I_price Decimal in nature Should be within 1.00 to 25.95 I_qty Integer in nature Should not be less than 1 2. Create a table named as DUMMY_ITEM_1 with the same specificaƟons as of ITEM. 3. Create a table named as DUMMY_ITEM_2 with the same specificaƟons as of ITEM but aƩributes names will be as follows: I_no --- > Item_no , I_name ---> Item_name, I_price --- > Item_price, I_qty ---> Item_quanƟty 4. Drop the Primary key from ITEM table. 5. Add the Primary Key in the ITEM table. https://drive.google.com/file/d/1iRkKc8YZ0BPv71ZXCHMwdxZNGhVcD58_/view?usp=drivesdk Feb 18, 2025
@SjxSubham SjxSubham changed the title 1. Create a table named as ITEM with the following specificaƟons AƩribute Name Data Types Constraints I_no Integer in nature Primary Key, values within 1 to 1000 I_name String with maximum 20 characters Cannot be null, will be in UPPERCASE I_price Decimal in nature Should be within 1.00 to 25.95 I_qty Integer in nature Should not be less than 1 2. Create a table named as DUMMY_ITEM_1 with the same specificaƟons as of ITEM. 3. Create a table named as DUMMY_ITEM_2 with the same specificaƟons as of ITEM but aƩributes names will be as follows: I_no --- > Item_no , I_name ---> Item_name, I_price --- > Item_price, I_qty ---> Item_quanƟty 4. Drop the Primary key from ITEM table. 5. Add the Primary Key in the ITEM table. https://drive.google.com/file/d/1iRkKc8YZ0BPv71ZXCHMwdxZNGhVcD58_/view?usp=drivesdk 1. Create a table named as ITEM with the following specificaƟons AƩribute Name Data Types Constraints I_no Integer in nature Primary Key, values within 1 to 1000 I_name String with maximum 20 characters Cannot be null, will be in UPPERCASE I_price Decimal in nature Should be within 1.00 to 25.95 I_qty Integer in nature Should not be less than 1 2. Create a table named as DUMMY_ITEM_1 with the same specificaƟons as of ITEM. 3. Create a table named as DUMMY_ITEM_2 with the same specificaƟons as of ITEM but aƩributes names will be as follows: I_no --- > Item_no , I_name ---> Item_name, I_price --- > Item_price, I_qty ---> Item_quanƟty 4. Drop the Primary key from ITEM table. 5. Add the Primary Key in the ITEM table. https://drive.google.com/file/d/1idul32ADYIyBkFMIWtCb4LkVTcR2bvKC/view?usp=drivesdk Feb 18, 2025
@SjxSubham SjxSubham changed the title 1. Create a table named as ITEM with the following specificaƟons AƩribute Name Data Types Constraints I_no Integer in nature Primary Key, values within 1 to 1000 I_name String with maximum 20 characters Cannot be null, will be in UPPERCASE I_price Decimal in nature Should be within 1.00 to 25.95 I_qty Integer in nature Should not be less than 1 2. Create a table named as DUMMY_ITEM_1 with the same specificaƟons as of ITEM. 3. Create a table named as DUMMY_ITEM_2 with the same specificaƟons as of ITEM but aƩributes names will be as follows: I_no --- > Item_no , I_name ---> Item_name, I_price --- > Item_price, I_qty ---> Item_quanƟty 4. Drop the Primary key from ITEM table. 5. Add the Primary Key in the ITEM table. https://drive.google.com/file/d/1idul32ADYIyBkFMIWtCb4LkVTcR2bvKC/view?usp=drivesdk questions Mar 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant