0% found this document useful (0 votes)
40 views

DBMS (LAB) Source Code by Tejal Waghmare

DBMS

Uploaded by

Jopi mof
Copyright
© © All Rights Reserved
Available Formats
Download as PDF or read online on Scribd
0% found this document useful (0 votes)
40 views

DBMS (LAB) Source Code by Tejal Waghmare

DBMS

Uploaded by

Jopi mof
Copyright
© © All Rights Reserved
Available Formats
Download as PDF or read online on Scribd
You are on page 1/ 18
Assignment NO+02 L> connect system Inter password: onnected. BoL> ate table hospital (i¢ int,name ver iraple created. Let )radiele verchar Lf ne) [SQL> insert into hospital values (01, ‘sa! i 1 row created. [SQL> insert into hospital values (02, 'Aditi', ‘letur'); 1 row created. LLL | SQL> insert into hospital values (03, ‘pranjal', 'pune'); \ 1 row created. I SQL> insert into hospital velues (04, ‘Bhagyashra',"pune"); 1 row created. LL SQL> select + from hospit | ID NAME ADDR Sian 1 Sakshi 4 2 Aditi 3 pranjal diene hae 4 Bhagyashri ot t t | a SQL> alter table hospital add blooderp varc’ Table altered. SQL> update hospital set bloods: 2 row yy ‘SQL> update hospital set bloodorp="A+' where ic=2; | 1 row updated. SQL> update hospital set bloodgrp='E-' where ic | os : 2 row updated. SQL> update hospital set bloodgrp='0" where i "2 row updated "SQL> select - from hospital: on HITT LL la ae AAAs SQL> insert into hospital values SQL> insert into hospital values (02, SQL> insert into hospital values(04, SQL> insert into hospital values (04, 'bhagys Assignment NOLO SQL> connect system Enter password Connected. SQL> create table hospital (id int,name varchar (20), addr yarehar (20) 14 Table created. shit, pune!) i 5(01, "90k! 1 row created. spaitat, Mature )s 1 row created. ‘pranjal', tpune')? 1 row created. eit, tpunet)s 1 row created. SQL> select * from hospitals ID NAME 1 sakshi 2 Adits Latur 3 pranjal pune pune 4 Bhagyashri yarenar (1015 soL> alter table hospital 204 bloodgrp gable altered. ideli squ> update hospital set ploodgrp= hit! where pdate hospital set ploodyrpetht! where S$ ‘SQL> uj 1 row updated. SQL> update hi 1 row updated. ospital set bloodgry='*" unere soL> update hospital ser ploodgrp=/0" where ide4i 1 row updated. soir select * from hospital! ie SQL> create table Doctor (dz_id int, dr_name varchar(19)), Table created. S0i> insert into Doctor (dz_id,dx_nane)values (02, "DR parry), 1 row created. . SOl> insert into Doctor (dr_id,dr_nane)values(Sdr_id, édr_nana), ‘Enter value for dr_id: 02 . ‘Enter value for dr_name: 'DR_shendre 1: insert into Doctor (dr_id,dr_name) values (sdr_ig Ad, Sdr_nang) it insert into Doctor (dr_id,dr_name)values (02, *DR_shehdre'y ro Doctor (dr _id,dr_name)values (sdr_id, s¢r_name); Enter value for dr_id: 03 nter value for dr name: 'DR_AROHI' i: insert into Doctor (dr_id,dr_name) values (sdr_id, cdr nane} 1: insert into Doctor (dr_id, dr name) value: s (03, "DR_AROHI"} 1 row created. SQL> insert into Doctor (dr_id,dr Enter value for dr_id: 04 Enter value for dr_name: 'DR_POOJA' Gg Lt insert into Doctor (@r_id,dr_name) values (éd: “id, 6dy_name) new 2: Ansert into Doctor (dr_id,dr_name) values (04, *DR_POOIA") fame) values (&dr_id, édr_name); 1 row created. SQL> select * from Doctor; DR_ID DR_NAME . SQL> insert into doctor values (oi, DR_PATIL DR_shendre DR_AROHI DR_PoogA, ‘aay; 1 row created. SQL> insert into doctor values (02, 'bbb') ; fracifoal Noo > create table product detalls (predict i varchar (30),quantity number, price jumber 14 hers Table created, nari! 1b, 400) § S0L> Insert into product details values (Mil, 1 row created, UL SALAASLZ, SQL> insert inte product details valums (S002, warddiakt, 200, 00) y 1 row created, SQL> insert into product details values (i004, "headphone! , Hill, 600) | 1 row created, SOL Insert inte product details values (S004, Mduat , fy 160) i 1 row created, SQL> insert into praduct_details values (4005, "apeakar! , 60,1200) 4 1 row created, SOL? insert into product details values (2006, tp! sf, HOOZ0N) 1 1 row created, SQL> select*from product_detaiisy FRODUCT_ID PRODUCT NAME punuriay beter 5001 pendrive lou on 5002 harddisk 200 su 5003 neadphane vonn on a ar 5005 600 1700 | 6 rows sele SQL> create table sales details(sale_ne number, product ia Rumber,quantity number, price nusbe,cintomer nate varchar (2) )1 create table sales detaila(sale no number, promuck 1d number quant it number, price nunt name varchar (20) ) ERFOR at line 1: OPA-00902: invalid datatype SQL> create“table sales details (sale_no number, product id husbeF, quantity mumber,price number, customer name varchar (20) \4 iibinadhasevvabinaslainleaclicalisiel \ ‘table created. ats val goi> insert into sales_detatl? 1 row created. st into sales_detatis values (2002, 5004, 10, 1GRRE a sou inst "y 1 row created. values (2003, 5003, 120, 6 sgl> insert into sales details values 90 aoepann, 1 row created. soL> insert into sales_details values (200415005, 420, 1200) *harayy, | 1 row created. .QL> insert into sales_details values (2005, 5002, 40, 3500, "Jacky, row created. ‘SQL> select*fron sales_ details: qu custom SALE_NO PRODUCT_ID 900 sanavi 2002 5004 10 1500 sanavi 2003 5003 120 600 deepak 2004 5005 420 1200 harsh 2005 5002 40 3500 jack P ney SaleS_datails.gumt _ ity, product_* details.price from product Getails ianer join sales details i sales_details.product_id? | CUSTONER_NANE = 01 pendrive sanavi, 002 harddisk jack d 003 headphone deepak CUSTONER_NAME ava S008 speaker 1200 peers f= i : Sanavi i f sanavi % E CUSTOMER_naM 5005 speaker © 1200 harsh 420 i 5002 haracisk pack 40 } 3500 ° 5006 cpu | 100200 6 rows selected, SQL> select product_details.product_id, product_details.product_nane, sales_details.cus toner_name from product details left outer join sales details on sales_details.product_id=product_details.product_id: PRODUCT_ID PRODUCT_NAME CUSTOMER_NAME pendrive sanavi SI 004 dvd sanavi 5003 headphone deepak ee Tj see] a S005 speaker 5002 harddisk 5006 cpu hares, 3 6 rows selected. SQL> select product_details.prod d, product_detatis. prog tomer_nane fron product details right outer jin sales details.proguct_1d ct_details-proxat talent! PRODUCT_ID PRODUCT_NAME : # ny 5001 pendrive 5002 harddisx 5003 headphone 5004 dvd 5005 speaker SQL> select*from product_details where product_na from product_details where product_name='headphe select*from product_details where product_nam product_details where product_nane='headphone’) ERROR at line 1: ORA-00936: missing expression details where product_nane='heades SQL> select*from product, PRODUCT_ID PRODUCT_NAME quasitity Pa 1900 5002 headphone SQL> select*from product_details where price?10007 PRODUCT_ID PRODUCT_NAME Quantity Price 5002 harddisk 5004 dvd 5005 speaker 5006 cpu soL> select*from product_details where product_name=(select produc headphone!) 7 from product_details where product_nam QUANTITY PRICE CT _NAME 5003 headphone 1000 rom product_detai. go1> select product-details.product_name £ PPoauct_deterts product, 1d sniselect ‘sales details.product_i4 pRODUCT_ID PRODU' 600 ls where fet s)t reduct-details-product_nane from product details unere select Pecrails.product_id in(Select sales details product_ia from an) sne 1: "DETAILS" ."PRODUCT NAME": invalid identifier ject product_details.product_name from product_details where sou> 8¢ = ao x S00, fe getails- Product Ad in (select sales detatie.prisuct ia free jetails) i pracitcet noro* ten 14,2007 table areas (radius number (5),area number ( LIISA) pp radius, 2)? values (radius, area) e successfully completed. alte /a, wilicclosalalealt [| sla lies | ey 2) \ 2022.00 17:51 gractical No.oe ble stud_mark(name varchar (50), total_marks Table created. SQL> create table results (rollno number (10), name ‘char (50), class varchar (50))7 Table created. or replace procedure proc_grade(rno nunber,name atynarks nunber)is class varchar (20); LLM) 2 beg. 3 :f(nsrks<-1800 and marks>=990) then 4 Glass :="distinction'; 5 clsitimarks<=359 and marks. 6 class:="firet'; 7 elsiz(marks<=989 and marks 8 class:='higher second! 3 end it; 10. insert into stud_mark values (name,marks) ; ii insert into results values (rno, name, class); 137 Procedure created. exec proc_grade(1, 'sam', 1000) ; PL/S: Procedure successfully completed. SQL> select + from stud mark: TOTAL_MARKS rerlitleleelmial /< /-/; SQL> ~~ Fracifeal noo Seen curds oop 12°E, curl into 2ne nmi ‘etch curd inte ey Seiten cuttteindetadae; theese Into N Relieald vatves(sno,am) 3 Sha doops 3 Stoee corn: 2 oe! ; y LU pu/SQb procedure successfully completed. sou> select* from 0 Rollcall; ROLL_NO NAME, 2 rahul 2 kunal 2 Sarika eo ——~ ee ee =~ eo =~ aan aa — — sou> select* from N_RollCall; ROLL_NO NAME 1 rahul 2 kunal~ 2 Sarika Fe a Vv “i oo ‘o' a SQL> connect system Enter paseword: Connected. SQL> SQL> create table ORelCall (reli ne Aung, ~ er (3) Table created, a“ SQL> insert into 0 Rolicaly values (1,1 Fahuls, , : 1 row created. SQi> insert inte 0 Rollcall values (2, “unas, i row created, SQL> insert into 0 Rollcal) values (2) "Sarinary, i row created. S$Qi> create table w Rollcall (z0l1_no PUREE (3) ang oe Table created, hi St Ansere into 1 Rollcall values 1, "rebul'y, i row created, Sai> select fron 0 olicali; -RO-nane from ©_Rollcall; Fo izem N Policall; Practical NO:07 ™~ connect syouen 282 esword SV erieicfes uibrary tb le Library(bno number (5) -bnane varchar? (20) author | Eanecreee etal concreate =) $907 cfg (a0) ,a}towed_ days number (5)) 7 ae ated: ye cr ansort into Library values(1,‘Java", "Mr-Patil',10); i created: | insert into 1ibrary values (2, "VB", "Mr.Sharma",15); so ou created qr snsort anto Library values (3, 'CPP', 'Mr.Surve',15)7 1 row created gqi> set serveroutPut On vp ereate table Library_audit (bno nunber (5), old al1_days number $0) gew_all_days number (9))7 gape created. create or replace trigger tri > sav fefore update or delete on library 2 be 3 for each row 4 begin 5 insert into yalues (:neW.DNO, + 6 end: on Library audit old.allowed_days, :new.allowed_days) ; trigger created. sg} select*from library? AUTHOR ALLOWED_DAYS Mr. Patil 10 Mr. Sharma 15 Mr. Surve 15 S01> update library set allowed_days=15 where bno=1; 1 row updated. 5Ql> select*from library? E ane t ee NAME AUTHOR ALLOWED_DAYS 1 Java Mr. Patil 2 vB Mr. Sharma 3 CRP Mr. Surve SQL> select*from library audit; BNO OLD_ALL_DAYS NEW_ALL_ pays 1 10 1s SQL> delete from library where bno=1; 1 row deleted. SQL> select*from library; BNO BNAME AUTHOR 2 vB Mr. Sharma 3 CPP Mr. surve SQL> select*from library audit; BNO OLD_ALL DAYS NEW_ALL pays 10 15 15 | I Assignment No. 8 pectin FN sing the Default JREMJDK fost © installing Java is to use the version packaged with Ubuntu, By default, Ubuntu 22.04 ot IDK 11, which isan open-source variant ofthe JRE and JDK. ito sie penJDK version of Java first update your apt package inden th joins ing id to install the JRE from OpenJDK 11: she following comman peste aoe ag willalfow you 10 run almost all Java software ‘pelRES y efi the installation with: as {ul receve output similar to the following ee ETT] a SRT ESE RLS CES Ne MN ETS TT] \oumay need the JDK in addition to the JRE in order to compile and run some specific Java-based

You might also like