BOOKSTORE DATABASE

 CREATE DATABASE BOOKSTORE;

USE BOOKSTORE;


CREATE TABLE BOOKTABLE

(ID INT NOT NULL, 

BOOK_NAME VARCHAR(100) NOT NULL,

BOOK_PRICE INT NOT NULL,

PRIMARY KEY (ID)

);


ALTER TABLE BOOKTABLE ADD (YEAROFPUBLICATION INT);


INSERT INTO BOOKTABLE (ID,BOOK_NAME,BOOK_PRICE,

YEAROFPUBLICATION) VALUES (100,'Finding Me, by Viola Davis',265,2022);

INSERT INTO BOOKTABLE (ID,BOOK_NAME,BOOK_PRICE,

YEAROFPUBLICATION) VALUES (101,'The Psychology of Money by Morgan Housel',210,2020);

INSERT INTO BOOKTABLE (ID,BOOK_NAME,BOOK_PRICE,

YEAROFPUBLICATION) VALUES (102,'Naked Statistics – Stripping the Dread from the Data by Charles Wheelan',

3899,2013);


DROP TABLE BOOKTABLE;


TRUNCATE TABLE BOOKTABLE;


RENAME TABLE BOOKTABLE TO MYSTORE;


UPDATE BOOKTABLE SET BOOK_PRICE=2000 WHERE ID=102;


DELETE FROM BOOKTABLE WHERE ID=102;


SELECT * FROM BOOKTABLE;

SELECT * FROM MYSTORE;

Comments

Popular posts from this blog

2. Create 3 private networks namely N1, N2 and N3, Send the data from N1 to N2. If the packets are transferring from N3, it shouldn't accept the packets. Accordingly develop the security features.Create 3 private networks namely N1, N2 and N3, Send the data from N1 to N2. If the packets are transferring from N3, it shouldn't accept the packets. Accordingly develop the security features.

Kruskal algorithm using greedy technique.