0 ratings0% found this document useful (0 votes) 3 views14 pagesDbms Module 1
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content,
claim it here.
Available Formats
Download as PDF or read online on Scribd
10714124, 2:81 AN Mt-Create Alter Insert: tempt review | SEC
Started on Wechesday, 9 October 2024, 803 PM
State Finished
Completed on Wedhestsy, 9 October 2024, 603 PM
Time taken 1 hour
Grade 80.00 out of 100.00
ntps:[Link] saveetha inimodiquiairevlew php attempt
\412948emid=22502 ane10714124, 2:81 AN Mt-Create Alter Insert: Altempt review | SEC
aueionY
‘Create table named bonuses withthe following constant:
‘+ sorusto a5 INTEGER shouldbe the primary key.
‘+ employee as INTEGER should bea foreign key referencing Exp ioyees E9981).
‘+ sorastroun as REAL should be greater than 0
+ torusoate as DATE
‘season 36 TEXT should not be NULL
For example:
Test Result
TASERT 110 Bonuses (BonusD, EnployeeiD, Soussnourt, Boruiace, REBEOn) VALUES (3, 6, SonusTO [Link] donabste
000.2, "2022-08-01", ‘Outstanding aerfortnee")s eoeon
outstanding performance
“Answer: (penalty regime: 0%)
Tr] ERERTE TABLE Bonuses (
4 | caployeeto aniesce,
| Sorusdmoune 268 CHK (BonusAmount >
4 | rORELCN KEY CEnpoyeesD) REFERENCES Employees. (EnployeelO)
sh
4
Test Expected Got
‘YWSERT IMO wenuses (BapuSID, LmployelD, borustmount, —GonusiD ployee orusid eaployeeio v
anusoste, Reason) VALUES (3, 6) 1690-0, 2878-86-01", onusiaount Boneeate Beaton forusAnount Gonutbate Reason
‘utstanding performance"); eee ceeeeee ectenneee one oe
‘Y |rsseer 0 wonuses (Bonst0, EmployeerD, Worusinount, | evar: CAEOK constraint fatled: Errors CHECK constraint fallea: [V
orasdate, feason) VALUES (2y 1, -500.8, 2928-88-62", | sonuses borates
"Sales target sentevenant”):
Passed altests!
ke forthe soir 10.09/1090,
ntps:[Link] infmodquiireview phpattempt=141284&cmid=22502 ane10714124, 2:81 AN
Inset all employees from Forner_empioyees into Employee
Tnble stibutes ae eoioyectD, vane, dopartnens, Sa32-y
Mt-Create Alter Insert: Altempt review | SEC
For example:
Test eeu
select * fron Employee: |ExployeeID Wane Departvent Salary
ae Dune Sth Engineerin 75000
Es nity Oa Marketing 68680
“Answer: (ponalty regime: 0%)
2 |stiecr exptoyeetD, dane, oepartnent, Salary
3 [Fron rormer-ensloyeess
5
JASERT 1070 Exployee (EaplyayeeID, Nave, Department, Salary)
Test Expected Got
X | gelact * fron | EaployeeD Rane aun erroreee x
ployer apartment Salary Error: naar line 5: tae fnployee has no colunn nated EnplyoyeeID
Tracetoek (nost recent e321 last)
outoik = subprocess, [Link](l'salites", doworking]»
Fite "/r/labipytions.8/[Link]", ine 435, in check output
return runt*popenargs, stdout=PIPE, tineovt-tineout, checkeTrue,
Fite */usr/ib/pytnen.t/[Link]", Line S36, in mun
raite Callederocesterrar(reteate, [Link]
[Link]: Command “[sqiites", “Insert dupttcate’)*
returned non-zero ovit S345 1
During handing of the above exceotion, another exception occurred
Traceosc (oost recent ca last)
raise Exception("sqiites error: * + strCe))
exception: salted error: Comand *['seites", "snsert_eipicate')*
ntps:[Link] inmodiquizreview php attempt
\412948mid=22502
ane10714124, 2:81 AN Mt-Create Alter Insert: Altempt review | SEC
‘esting was aborted due o error
Your code must pass ll test to eaen ary marks Try agin
Show dferences
(om)
ke forth oision- 00/1000,
ntps:[Link] infmodquiireview phpattempt=141284&cmid=22502 ang10714124, 2:81 AN
Create 2 new tbe nama products withthe folowing speciatons
“+ product_id as INTEGER and primary Key.
1 product_pane a8 TEXT and not NULL
1+ 1st price as DECIMAL (10,2) and not NULL
‘+ exscoune as DECIMAL (10,2) witha default value of 0 and not NULL
1 ACHECK constant a the table level to ensure
1 List price is greater han or equal to ciscount
12 esscount greater than of equal 10.0
© List price is greater than or equal to
For example:
Mt-Create Alter Insert: Altempt review | SEC
Test
Result
IMSEAT 10 products (praduct_{a, product
8.00):
st price) VALUES (2, “Product,
2 Product 858 °
‘Answer: {penalty regime’ 0%)
1 sfoneate TABLE products «
3 preduct_t4 INTEGER PRIRARY KEY,
4 fproductiname sbxT WOT NULL,
5 [ise price occim (18, 2)' vor muLL,
6 fesseoune oecinat (2, 3) betauct @ hor MULL,
> fenton Cisse prsce >» tscours)
2 fontcx (asscoune 9-0)
8 fontex (se prices
ah
4
Test Expected Got
YTNSERT mo prosucts (product_ie, preduct_pane, List_pce) | product_id product mane product_id prosuct_nane
VALUES (2, “Proguce 8", 50.08); Hist orice dlscoure Hat price dlscaumt
Y [aasckr o prosicts (proce te, product pane, 21st prize, | erors CHECK constraint erors aw eonstratne v
ftecount) YAWUES (3, ‘Prosier€°, 28.00, 3.08); fated: products fatles: prosuets
Passed alters!
ar forth svomison 1000/1000,
ntps:[Link] inmodiquizreview php attempt
\412948emid=22502
sna10714124, 2:81 AN
suction
Inset the following students int the Student detals able:
Subject
RN
MARKS
Name Gander
202 ElaKing Chemisty 87
203 James ond M_—Lterature 78
For example:
Test Result
2 eu king
subgect
‘Answer: (penalty reoime: 0%)
2 fuauues (2e2 , "elle king's "Fy "Cheaistey",
5 [uauues (203 , “anes y ‘tierature", 78))
1 [insenr two studert-detatis ( RolINo, sane , ender Subject, ARS)
ixsear into student detatis ( RolINo, sane , Gender, Subject, ARS)
Mt-Create Alter Insert: Altempt review | SEC
Test Expected ot
Yseuecr + Fron folINe Nave Gander subject RollNo Wane Gander, subyect
Passed alters!
sk fori iin 18.0/7000
ntps:[Link] infmodquiireview phpattempt=141284&cmid=22502 eng10714124, 2:81 AN Mt-Create Alter Insert: Altempt review | SEC
Inserts recor with EmployeelD oe, Name sarah Parker, Postion vanager, Department i and Salary 6696 nto the Enpoee table
For example:
Test Result
SELECT * FROH Ewpioyee MERE ExployeeTD = 891; ExployeeTD Nene
“Answer: panalty regime: 0%)
T [INSERT INO Exployee ( EmployeeID, Wave, Position, Department Salary)
2 [waives (oor, "Sarah Parker's "Manager", WR 6000
et taped nt im
Departnent Salary Department Salary
Sarah Parker Manager UR
assed alters!
for his ssn 10.0/1000.
ntps:[Link] infmodquiireview phpattempt=141284&cmid=22502
m610714124, 2:81 AN Mt-Create Alter Insert: Altempt review | SEC
cuein
white 2 Sal query to Add anew column Mobilenumber as number inthe Student details able.
Somple tobe Student. seals
olin oe . a
tne vires) 3 .
simject wawciacsey 6 °
anes ast) ° ®
For example:
Test Result
pragma Cable info ‘Student details"); cid mane be retny it_value pe
© pollke sot . :
2 tine vwawcmnecieay 2 °
3 subgect wircman(so) 6 °
maces ax @) ° °
“Answer: (penalty regime: 0%)
T [ALTER TABLE Stadent_detaiie
2 [co coum neottensiver rowers
4
ntps:[Link] infmodquiireview phpattempt=141284&cmid=22502 ane10714124, 2:81 AN Mt-Create Alter Insert: Altempt review | SEC
Test Expected Got
Ypreana cid name type eta nane tne v
{able info'stusertdetais'); otra efit value pe rat dit valve pe
1 Wane vamcuancioey 22 Noe vwwoianci9e) a
3 sunject wawcmnecsey 83 sect wwromecsey —@
2 ms a) es mn > .
Passed alltests!
ars for hi sion T0.00/1000,
ntps:[Link] infmodquiireview phpattempt=141284&cmid=22502 ong10714124, 2:81 AN Mt-Create Alter Insert: Altempt review | SEC
ton?
‘Create table named orders withthe folawing centr
‘+ ovsortb as INTEGER shouldbe the primary key.
“+ ovceroate as DATE shoul be nat NULL,
‘+ castoneri as INTEGER should bea foreign key referencing Custoners(ustonerI).
For example:
Test
Result
“alee. Jotrsongexiple. con");
INSERT IMT orders (Order, orderbate, CuscoveriO) VALUES (1, "2826
solect * fon orders
[SEAT Uo Custorars (CastoreriD, FArsthane, Lastane, Gaal) LIES (2, “ALLER,
ay
‘Answer: (panalty regime: 06)
To] FRERTE TABLE Orders (
(rderiO INTEGER PRIMARY KY,
FOREIGN KEY (Custotor 10) REFERENCES Custoners(Custoner 1D)
bs
Test
Expected
Got
2X SERT ITO Custoners (Castoner, Flesthane, Lattane, Email) VALUES (2,
‘nakce”, "Donson', ‘alice fbmsendexanpe. cn"
2:
ZASERT 1M Orders (Grder23,Oraeroote, Custaneri0) VALUES (1, 2624-00-0",
2X | SeRT Tato orders (Grdert8, ordeaste, CuRtOner) VALLES (2, "902-08-82
Some hidden test cases fled, too,
Your code must pass al test to eaen any marks. Try again
‘Show citferences
Mors forth svnsion 00/1000,
\412948emid=22502
ntps:[Link] inmodiquizreview php attempt
sone10714124, 2:81 AN
white 2 Sal query to Adda new column mobilenu
Somple tobe Student details
Mt-Create Alter Insert: Altempt review | SEC
rin the Student details table,
aa — ‘jee retrall aI alue pe
olin ae :
simject vane @ °
aes mre °
For example:
Test Result
pragma table info ‘Student details"); ela nase pt ntnull dele lve pe
° Folin int e :
2 ave VARCHAR °
3 Subgect VARENAR(S0.@ 6
: mans or) °
‘Answer:
penalty regime: 0%)
T [ALTER TABLE Seadent_detatie
2 [aco nobsienunoer ninoens
ntps:[Link] inmodiquizreview php attempt
\412948emid=22502
ne10714124, 2:81 AN Mt-Create Alter Insert: Altempt review | SEC
Test Expected Got
Ypreana ais ane type atu
table-info'stasant-detatis 5
ine ype otmlh
1 ane vavouacae 2 1 one vancnancae +
2 subject vaRownne @ 3 supject —vanownae @
+ rusts ar) 4 raats or)
Passed alltests!
ar forth svomison T0.00/1090,
ntps:[Link] infmodquiireview phpattempt=141284&cmid=22502 rane10714124, 2:81 AN Mt-Create Alter Insert: Altempt review | SEC
“create a table named cstoners with the following columns:
1 fost a8 107
For example:
Test Result
pragna fable_info(‘Custoners"); cd retype netnall alta pe
[Ansmer: poalty regime: 0%)
1 /orenre TABLE custonerst
3 | none Tex,
a] Emin vext,
obi
4
Test Expected Got
Y prog table tnfotcustoners'): a rae hype ae rane type v
otrall —eftvalue otwit — afitvalue 9k
v [mseer mmo customers (cscorert0, Hane, | CustonenrO tame Fast Curtoneri> tine att v
frst, Joidste) Dolnaate dotnbate
VALUES (2, “Enily oovis', - -
‘entiy sovistexanpievcon', "702608-61 | none a :
saceorea"); 2 enily bavi : nly One
select * fra customers: [Link] 2024-08-01 | [Link] 2824-08-01
ntps:[Link] infmodiquiireview phpatempt=141284&emid=22502 sa1074124, 2:81 AN Mt-Create Alter Insert: Altempt review | SEC
Passe atest
fori iain 100/700
covtan 10
(Crete table named ProsectAssipmants wih the following consraints
‘+ sgcignrone a INTEGER shouldbe the primary key.
‘+ Enployent a INTEGER shoul bea foreign key referencing Exployes( pape}.
“+ progecti0 a INTEGER should be a foreign key referencing Prosecte(2roec320),
‘+ sssipnentte a DATE should be NOT NULL
For example:
rest Result
"AGERT Tmo ProgectAcrigments (AesSpMeent, ExplayeeED, Proect!S, Aretgmentaste) VALUES (2, 98, 2, | Ersons FOREIGN KEY conetraine
*e2e-03-89"); ‘fastee
“Answer: (penalty regime: 0%)
T|EREATE TABLE Projectassigorents (
2°] “recigrmenti9 invest PRIMIRY KEY,
3.| enployeero rerecen,
4 | projectzo avrcecr,
S| kesienentoate DATE Wor NULL,
5 | roneton nev (EnployeezD) aerEnences Enployees(EnployeetD),
2 | Foncrcn Kev (Projectio REFERENCES Projects(ProjectID)
‘
oh
4
Test Expected Got
YTASERT Mo ProjectAssigmerts (AesigmentlD, EmployeeI9, Errors FORLIN KEY constraint Eerors REIGN KEY constraint |
ProsectD, AssigrmentDate) VALUES (2, 99, 1, 2828-61-63"); fatled ‘atted
v | rsseer tuo Projectassigmerts (ASsigmsentiD, Employeero, | ASSigomentIO EmployeerO —_|ASSigmenti9 caployeerd |W
Prosecti, Assignertoata) VALUES (1, 2, 1, 2826-81-02"); | projecttD Assignnentoate | projectz0._assignmentoate
setece fron ProjectAssigments:
Passed alltess!
i forthe smi 10.00/1000
ntps:[Link] phpattempt=141284&emid=22502 sane