0% found this document useful (0 votes)
19 views17 pages

ISM LAB File Sample-1

The document discusses information systems management lab assignments. It includes an explanation of entity relationship diagrams and their components. It also discusses the different types of SQL commands including DDL, DML, and SELECT and provides examples of creating tables and dropping tables using DDL commands.

Uploaded by

Ram Gopal
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
19 views17 pages

ISM LAB File Sample-1

The document discusses information systems management lab assignments. It includes an explanation of entity relationship diagrams and their components. It also discusses the different types of SQL commands including DDL, DML, and SELECT and provides examples of creating tables and dropping tables using DDL commands.

Uploaded by

Ram Gopal
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 17

INFORMATIONSYSTEMSMANAGEMENTLAB

Paper Code:
BBA307AcademicSession:20
23-2024

DepartmentofBusinessAdministration

SubmittedTo: Submittedby:

NameofFaculty:Dr. SushilaGupta Name:Harnoor Singh Bedi


Designation:AssistantProfessor EnrollmentNo.:02661101721
Semester:5th
Class/Section:5–D

Maharaja Agrasen Institute of Management


StudiesAffiliatedtoGuruGobindSinghIndraprasthaUniversity,Delhi
Sector-22,Rohini,Delhi-110086,India;www.maims.ac.in
MaharajaAgrasenInstituteofManagementStudies
AffiliatedtoGGSIPUniversity,Recognizedu/s2(f)ofUGCRecognizedbyBa
rCouncilof India,ISO9001:2015CertifiedInstitutionSector22,
Rohini,Delhi-110086, India;www.maims.ac.in

CourseObjectiveandProgramObjective

COPOISMLab PO PO PO PO PO PO PO PO
1 2 3 4 5 6 7 8
CO1 Select the relevant data 3 1 3 2 3 1 2 2
fordecisionmakingusingSQ
L
CO2 Understandthe relevance ofE- 3 3 3 2 3 1 2 3
RModels
CO3 CreateandManipulate 3 3 3 2 3 1 2 3
databases

PO1 Applyknowledgeofvariousfunctional areasofbusiness


PO2 Developcommunicationandprofessionalpresentationskills
PO3 DemonstratecriticalthinkingandAnalyticalskillsforbusinessdecisionmaking
PO4 Illustrateleadershipabilitiestomakeeffectiveandproductiveteams
PO5 Exploretheimplications and understandingtheprocessofstartinganewventure
PO6 Imbiberesponsiblecitizenshiptowardssustainablesocietyandecological
environment
PO7 Appreciateinclusivitytowardsdiversecultureand imbibeuniversalvalues
PO8 FosterCreativethinkingtofindinnovativesolutionsfordiversebusiness situations

1
MaharajaAgrasenInstituteofManagementStudies
AffiliatedtoGGSIPUniversity,Recognizedu/s2(f)ofUGCRecognizedbyBa
rCouncilof India,ISO9001:2015CertifiedInstitutionSector22,
Rohini,Delhi-110086, India;www.maims.ac.in

S.No. TITLE Signature


1 ERDiagram,DBMSbasicSQL
2 SQLCOMMANDS– DDL,DML, DCL, TCL,DQL
3 Assignment1
4 Assignment2
5 Assignment3
6 Assignment4

7 Assignment5

8 Assignment6

9 Assignment7

10 Assignment8

11 Assignment9

12 Assignment10

13 Assignment11

14 Assignment12

15 Assignment13

16 Assignment14

17 Assignment15

18 Assignment16–NestedQuery

19 Assignment17–NestedQuery

20 Assignment18– JoinQuery

21 Assignment19– JoinQuery

22 Assignment20 –ERDiagram

23 Assignment21 –ERDiagram

24 Assignment22 –ERDiagram

2
MaharajaAgrasenInstituteofManagementStudies
AffiliatedtoGGSIPUniversity,Recognizedu/s2(f)ofUGCRecognizedbyBa
rCouncilof India,ISO9001:2015CertifiedInstitutionSector22,
Rohini,Delhi-110086, India;www.maims.ac.in

ERDiagram,DBMS basicSQL

Q.1. ExplainERDiagram.What thedifferent typesof


symbolsusedinERDiagram.Explainthetypeof entity and attributes inER Diagram.
ER Diagram stands for Entity Relationship Diagram, also known as ERD is a diagram that
displaysthe relationship of entity sets stored in a database. In other words, ER diagrams help to
explain thelogical structure of databases. ER diagrams are created based on three basic concepts:
entities,attributes and relationships. ER Diagrams contain different symbols that use rectangles to
represententities,ovalstodefineattributesanddiamondshapestorepresentrelationships.Atfirstlook,anE
Rdiagram looks very similar to the flowchart. However, ER Diagram includes many
specializedsymbols, and its meanings make this model unique. The purpose of ER Diagram is to
represent theentityframework infrastructure.

Followingarethemaincomponents anditssymbolsinERDiagrams:
• Rectangles:ThisEntityRelationshipDiagramsymbolrepresentsentitytypes
• Ellipses:Symbolrepresentattributes
• Diamonds:Thissymbolrepresentsrelationship types
• Lines:Itlinksattributestoentitytypesandentitytypeswithotherrelationshiptypes
• Primarykey:attributes areunderlined
• DoubleEllipses:Representmulti-valuedattributes

WHATISENTITY?
A real-world thing either living or non-living that is easily recognizable and non-recognizable. It
isanything in the enterprise that is to be represented in our database. It may be a physical thing
orsimplyafact abouttheenterpriseoran event thathappens inthereal world.

An entity can be place, person, object, event or a concept, which stores data in the database.
Thecharacteristics of entities are must have an attribute, and a unique key. Every entity is made up
ofsome‘attributes’whichrepresentthat entity.

Examplesofentities:
• Person:Employee,Student,Patient
• Place:Store,Building
• Object:Machine,product,and Car

3
MaharajaAgrasenInstituteofManagementStudies
AffiliatedtoGGSIPUniversity,Recognizedu/s2(f)ofUGCRecognizedbyBa
rCouncilof India,ISO9001:2015CertifiedInstitutionSector22,
Rohini,Delhi-110086, India;www.maims.ac.in

• Event:Sale,Registration,Renewal
• Concept:Account, Course
WeakEntities
Aweakentityis a typeofentity whichdoesn’thaveitskeyattribute.Itcanbeidentifieduniquely
byconsideringtheprimarykey ofanotherentity.Forthat,weakentitysets needtohaveparticipation.

Attributes
Itisasingle-valuedpropertyofeitheranentity-typeorarelationship-type.
Forexample,alecturemighthaveattributes: time,date,duration,place,etc.Anattributein
ERDiagramexamples, is represented byan Ellipse

TypesofAttributes Description

Simpleattribute Simpleattributescan’tbedividedanyfurther.For example,a


student’scontactnumber.Itisalsocalledanatomicvalue.
Compositeattribute It is possible to break down composite attribute. For example,
astudent’sfullnamemay
befurtherdividedintofirstname,secondname,and last name.
Derivedattribute Thistypeofattributedoesnotincludeinthephysicaldatabase.
However,theirvalues
arederivedfromotherattributespresentinthedatabase. For example,
age should not be stored directly. Instead, itshouldbederived from
Multivaluedattribute Multivalued attributes can have more than one values. For
example,astudentcanhavemorethanonemobilenumber,email
address,etc.
theDOB of that employee.

Q.2. ConvertERtotabledatabaseofanyspecificERDiagram.

4
MaharajaAgrasenInstituteofManagementStudies
AffiliatedtoGGSIPUniversity,Recognizedu/s2(f)ofUGCRecognizedbyBa
rCouncilof India,ISO9001:2015CertifiedInstitutionSector22,
Rohini,Delhi-110086, India;www.maims.ac.in

Entityrelationshipdiagramisthegraphicalrepresentationofentitiesandrelationshipsamongthoseentities
in thedatabase.
Example

Aftersuccessfulconversion, theresult willbeas follows–


Emp_No Emp_name Salary

Schema:Employee(Emp_No,Emp_name,Salary)
Emp_No Emp_name Salary

Schema:Department(Dept_id,Dept_name)
Emp_No Dept_id since

Schema:Worksin(Emp_no,Dept_id,since)
Q.3. What are the types of SQL? Briefly Explain DDL, DML & SELECT
command.TypesofSQL Commands:-

5
MaharajaAgrasenInstituteofManagementStudies
AffiliatedtoGGSIPUniversity,Recognizedu/s2(f)ofUGCRecognizedbyBa
rCouncilof India,ISO9001:2015CertifiedInstitutionSector22,
Rohini,Delhi-110086, India;www.maims.ac.in

1. DataDefinitionLanguage(DDL)
DDL changes the structure of the table like creating a table, deleting a table, altering a
table,etc. All the command of DDL are auto-committed that means it permanently save all
thechangesin thedatabase.
Herearesomecommands thatcomeunderDDL:

a. CREATEItisusedtocreateanewtableinthedatabase.Synta
x
CREATETABLEtable_name(colu
mn1datatype,column2data
type,column3datatype,
.....
columnNdatatype,
PRIMARYKEY(oneormorecolumns)
);
Example:
CREATETABLECUSTOMERS(
ID INTNOTNULL,
NAME VARCHAR(20)NOTNULL,
AGE INTNOTNULL,
ADDRESS CHAR(25),

6
MaharajaAgrasenInstituteofManagementStudies
AffiliatedtoGGSIPUniversity,Recognizedu/s2(f)ofUGCRecognizedbyBa
rCouncilof India,ISO9001:2015CertifiedInstitutionSector22,
Rohini,Delhi-110086, India;www.maims.ac.in

SALARY DECIMAL(18,2),
PRIMARYKEY(ID)
);
b. DROP:Itisusedtodeleteboththestructureandrecord stored inthetable.
Syntax
DROPTABLEtable_name;
Example
DROPTABLECUSTOMERS;
c. ALTER: It is used to alter the structure of the database. The ALTER TABLE command can add
ordelete columns, create or destroy indexes, change the type of existing columns, or rename columns

orthetableitself.

TheALTERTABLEcommandcanalsochangecharacteristicsofatablesuchasthestorageengineusedforthe

table.

Syntax
FollowingisthebasicsyntaxofanALTERTABLEcommand−

ALTERTABLEtable_name[alter_option...];
ALTERTABLE−ADDColumn
If you need to add a new column to a table, you should use the ADD COLUMN option along with
ALTERTABLEstatementasshown below−
ALTERTABLEtable_nameADDcolumn_namedatatype;
Example
FollowingistheexampletoADDaNewColumntoanexistingtable−

ALTERTABLECUSTOMERSADDSEXchar(1);
ALTERTABLE−DROPCOLUMN
Ifyouneedtodropanexistingcolumnfromatable,youshouldusetheDROPCOLUMNoptionalongwithALTERTA
BLEstatementasshown below.

ALTERTABLEtable_nameDROPCOLUMNcolumn_name;
Example
FollowingistheexampletoDROPsexcolumnfromtheexistingtable.

ALTERTABLECUSTOMERSDROPCOLUMNSEX;

7
MaharajaAgrasenInstituteofManagementStudies
AffiliatedtoGGSIPUniversity,Recognizedu/s2(f)ofUGCRecognizedbyBa
rCouncilof India,ISO9001:2015CertifiedInstitutionSector22,
Rohini,Delhi-110086, India;www.maims.ac.in

ALTERTABLE−ADDPRIMARYKEY
Syntaxtoaddaprimarykeyinanexistingtableofadatabase−
ALTERTABLEtable_name
ADD CONSTRAINT
constraint_namePRIMARYKEY(colu
mn1,column2...);
Example
Before we add a primary key to an existing table, first let's create a new table called EMPLOYEES
asfollows:
ALTERTABLEEMPLOYEES
ADDCONSTRAINTMyPrimaryKeyPRIMAR

YKEY(ID);
ALTERTABLE−DROPPRIMARYKEY
Syntaxtodeleteaprimarykeyfromanexistingtableofadatabase−
ALTERTABLEtable_nameDROPPRIMARYKEY;
Example
FollowingquerydeletesprimarykeyconstraintfromthecolumnIDofEMPLOYEEStable−
ALTERTABLEEMPLOYEESDROPPRIMARYKEY;
ALTERTABLE−ADDCONSTRAINT
Syntaxtoaddauniqueconstrainttoacolumnofanexistingtable−
ALTERTABLEtable_name
ADD CONSTRAINT
constraint_nameUNIQUE(column1,
column2...);
Example
FollowingqueryaddsUNIQUEconstrainttothetableCUSTOMERS−
ALTER TABLE EMPLOYEES ADD CONSTRAINT
CONSTUNIQUE(NAME);
ALTERTABLE−DROPCONSTRAINT
Syntaxtodropauniqueconstraintfromanexistingtable−
ALTERTABLEtable_nameDROPCONSTRAINT
constraint_name;
Example
FollowingqueryaddsUNIQUEconstrainttothetableCUSTOMERS−
ALTERTABLEEMPLOYEESDROPCONSTRAINTCONST;

8
MaharajaAgrasenInstituteofManagementStudies
AffiliatedtoGGSIPUniversity,Recognizedu/s2(f)ofUGCRecognizedbyBa
rCouncilof India,ISO9001:2015CertifiedInstitutionSector22,
Rohini,Delhi-110086, India;www.maims.ac.in

ALTERTABLE−RENAMECOLUMN
Followingisthesyntaxtorenameacolumnnameofanexistingtable−
ALTERTABLEtable_name
RENAMECOLUMNold_column_nametonew_column_name;
Example
FollowingqueryrenamesNAMEcolumnintableCUSTOMERS−
ALTERTABLECUSTOMERSRENAMECOLUMNnametofull_name;
ALTERTABLE− MODIFYDATATYPE
FollowingisthesyntaxtochangethedatatypeofanycolumninMySQL,MSServerandOracle.
ALTERTABLEtable_nameMODIFYCOLUMNcolumn_namedatatyp
e;
Example
FollowingquerymodifiesdatatypeofSALARYcolumninMySQLCUSTOMERStable−
ALTERTABLECUSTOMERSMODIFYCOLUMNEIDNumber(18,0);
c.RENAMETABLECommand:YoucanchangeaMySQLtablenameusingSQLRENAMETABLE
statement.
Syntax
RENAMETABLEtable_nameTOnew_table_name;
Syntax
FollowingisthesyntaxoftheSQLALTERTABLEcommandtorenameanexistingtable−
ALTERTABLEtable_nameRENAME[TO|AS]new_table_name
Example
FollowingSQLALTERTABLEstatementwillchangethetablenamefromBUYERStoCUSTOMERS.
ALTERTABLEBUYERSRENAMETOCUSTOMERS;
d.TRUNCATE:Itisusedto deleteallthe rows from the tableand freethespacecontaining thetable.
Syntax:
TRUNCATETABLEtable_name;
Example:
TRUNCATETABLECUSTOMERS;
2. DataManipulationLanguage
 DMLcommandsareusedtomodifythedatabase.It isresponsible

forallformofchangesinthedatabase.

9
MaharajaAgrasenInstituteofManagementStudies
AffiliatedtoGGSIPUniversity,Recognizedu/s2(f)ofUGCRecognizedbyBa
rCouncilof India,ISO9001:2015CertifiedInstitutionSector22,
Rohini,Delhi-110086, India;www.maims.ac.in

 ThecommandofDMLisnotauto-committed thatmeansitcan'tpermanentlysaveall

thechanges in the database. They can be rollback. Here are some commands that come
underDML:
 INSERT

 UPDATE

 DELETE

a. INSERT:TheINSERTstatement isaSQL query.Itisused toinsertdata intotherowofatable.


Syntax:
INSERTINTOTABLE_NAME(column1,column2...columnN)VAL
UES(value1,value2...valueN);
Here,column1,column2,column3,...columnNarethenamesofthecolumnsinthetableintowhichyouwanttoinsertthe
data.

ThereisanothersyntaxofINSERTINTOstatementwhereyoucanspecifyonlycolumnvalueswithoutcolumnn
ames.But,makesuretheorderofthevaluesisinthesameorderasthecolumnsinthetable.

Or

FollowingissecondsyntaxoftheSQLINSERTQuery−

INSERTINTOTABLE_NAMEVALUES(value1,value2...valueN);
Example

ThefollowingSQLINSERTINTOstatementswillcreatethreerecordsintheemptyCUSTOMERStable.

INSERTINTOCUSTOMERS(ID,NAME,AGE,ADDRESS,SALARY)
VALUES(1,'Ramesh',32,'Ahmedabad',2000.00);

INSERT INTO CUSTOMERS


(ID,NAME,AGE,ADDRESS,SALARY)VALUES(2,
'Khilan',25,'Delhi',1500.00);

INSERT INTO CUSTOMERS


(ID,NAME,AGE,ADDRESS,SALARY)VALUES(3, 'Kaushik',23,
Wecanalsoinsertmultiplerowsatonceusingthefollowingqueryasshownbelow−
'Kota',2000.00 );

10
MaharajaAgrasenInstituteofManagementStudies
AffiliatedtoGGSIPUniversity,Recognizedu/s2(f)ofUGCRecognizedbyBa
rCouncilof India,ISO9001:2015CertifiedInstitutionSector22,
Rohini,Delhi-110086, India;www.maims.ac.in

INSERTINTOCUSTOMERS(ID,NAME,AGE,ADDRESS,SALARY)VALUES
(4,'Chaitali',25,'Mumbai',6500.00),
(5,'Hardik',27,'Bhopal',8500.00),
(6,'Komal',22,'Hyderabad',4500.00);
b. UPDATE: This command is used to modify the existing records in a table. This command is a
partof Data Manipulation Language (DML), as it only modifies the data present in a table without
affecting thetable'sstructure.
Syntax:
UPDATE table_name SET column1 = value1, column2
=value2,..., columnN = valueN WHERE
[condition];Example:
IfyouwanttomodifyalltheAGEandtheSALARYcolumnvaluesintheCUSTOMERStable

UPDATE CUSTOMERS SET ADDRESS = 'Pune' WHERE ID =


6;UPDATECUSTOMERSSETAGE=AGE+5,SALARY=SALARY+3000;
c. DELETE:Itis usedto removeoneormorerowfroma table.
Syntax:
DELETEFROMtable_nameWHERE[condition];
YoucancombineNnumberofconditionsusingANDorORoperators.

Example:

DELETEFROMCUSTOMERSWHEREID=6;
Todeletemultiplerowsfromatable

DELETEFROMCUSTOMERSWHEREAGE>25;
3. DataControlLanguage
DCLcommandsareusedtograntandtakebackauthorityfromanydatabaseuser.Hereare
somecommands that comeunderDCL:
o Grant
o Revoke
a. Grant:
Itisusedtogiveuseraccessprivilegestoadatabase.Example
GRANTSELECT,UPDATEONMY_TABLETOSOME_USER,ANOTHER_USER;

11
MaharajaAgrasenInstituteofManagementStudies
AffiliatedtoGGSIPUniversity,Recognizedu/s2(f)ofUGCRecognizedbyBa
rCouncilof India,ISO9001:2015CertifiedInstitutionSector22,
Rohini,Delhi-110086, India;www.maims.ac.in

b. Revoke:Itisusedtotakebackpermissions
fromtheuser.Example
REVOKESELECT,UPDATEONMY_TABLEFROMUSER1,USER2;
4. TransactionControlLanguage
TCL commands can only use with DML commands like INSERT, DELETE and UPDATE
only.Theseoperationsareautomatically
committedinthedatabasethat'swhytheycannotbeusedwhilecreating tables ordropping
them.Herearesome commandsthat comeunderTCL:
 COMMIT
 ROLLBACK
 SAVEPOINT
a. Commit:Commitcommandisusedtosaveallthetransactions tothedatabase.
Syntax:

COMMIT;
Example:

DELETEFROMCUSTOMERSWHEREAGE=25;
COMMIT;
b. Rollback:Rollbackcommandisusedtoundotransactionsthathave notalreadybeensaved
to thedatabase.
Syntax:
ROLLBACK;
Example:

DELETEFROMCUSTOMERSWHEREAGE=25;
ROLLBACK;
c. SAVEPOINT:Itisusedtorollthetransactionbacktoacertainpointwithoutrollingbacktheentiretran
saction.
Syntax:

SAVEPOINTSAVEPOINT_NAME;
5. DataQueryLanguage:DQLisusedtofetchthedatafromthedatabase.
Syntax
ThebasicsyntaxoftheSELECTQueryisasfollows−

SELECTcolumn1,column2,columnNFROMtable_name;

12
MaharajaAgrasenInstituteofManagementStudies
AffiliatedtoGGSIPUniversity,Recognizedu/s2(f)ofUGCRecognizedbyBa
rCouncilof India,ISO9001:2015CertifiedInstitutionSector22,
Rohini,Delhi-110086, India;www.maims.ac.in

Here,column1,column2...arethefieldsofatablewhosevaluesyouwanttofetch.Ifyouwanttofetchallthecolumnsavailabl
einatable,thenyoucanusethefollowingsyntax−

SELECT*FROMtable_name;
RetrievingSelectedFields/Columns
ThefollowingstatementfetchestheID,NameandSalaryfieldsoftherecordsavailableinCUSTOMERStable.

SELECTID,NAME,SALARYFROMCUSTOMERS;
CopyingSpecificRecords
WecanalsousetheSQLSELECTINTOstatementwithaWHEREclausetocreateanewtableandcopyspecificro
wsfromanexisting tableintoit.
Syntax
FollowingisthesyntaxforusingSELECTINTOstatementwithaWHEREclause−

SELECT*INTOnew_table_nameFROMexisting_table_nameWHEREcondition;
Example
Using the following query we are creating a new table called NameStartsWith_K that includes all
columnsfromtheCUSTOMERStable,butitonlystorestherecordsofthecustomerswhosenamestartswith"k".

SELECT*INTONameStartsWith_KFROMCUSTOMERSWHERENAMELIKE'k%';
TheSQLORDERBYClause
The SQL ORDER BY clause is used to sort the data in either ascending or descending order, based on one
ormorecolumns.
Syntax
ThebasicsyntaxoftheORDERBYclauseisasfollows−

SELECTcolumn-listFROMtable_name[ORDERBYcolumn1,column2,..columnN]
[ASC|DESC];
Where,column-listislistofthecolumnswewanttoretrieve;andASCorDESCspecifiesthesortorder.Example

SELECT * FROM CUSTOMERS ORDER BY NAME


ASC;SELECT*FROMCUSTOMERSORDERBYNAMEDESC;
SELECT * FROM CUSTOMERS ORDER BY AGE ASC,SALARY
DESC;SELECT * FROM CUSTOMERS WHERE AGE=25 ORDER BY
NAMEDESC;

13
MaharajaAgrasenInstituteofManagementStudies
AffiliatedtoGGSIPUniversity,Recognizedu/s2(f)ofUGCRecognizedbyBa
rCouncilof India,ISO9001:2015CertifiedInstitutionSector22,
Rohini,Delhi-110086, India;www.maims.ac.in

TheSQLGROUP BYClause
TheSQLGROUPBYclauseisused
inconjunctionwiththeSELECTstatementtoarrangeidenticaldataintogroups.
Syntax

SELECT column_name(s)FROM table_name GROUP


BYcolumn_name(s);
Where,column_name(s)referstothenameof oneormorecolumnsinthetablethatwewanttogroup
the data by and the table_name refers to the name of the table that we want to
retrievedatafrom.
Example

SELECTAGE,COUNT(Name)FROMCUSTOMERSGROUPBYAGE;SELECT
ADDRESS,AGE, SUM(SALARY) AS
TOTAL_SALARYFROMCUSTOMERSGROUPBYADDRESS,AGE;
GROUPBYwithORDERBYClause
WecanusetheORDERBYclausewith GROUPBYinSQLtosortthegrouped databyoneormorecolumns.
Syntax

SELECT column1, column2,


...,aggregate_function(columnX)ASaliasFROMtable
GROUP BY column1, column2, ... ORDER BY column1 [ASC
|DESC],column2[ASC|DESC],...;
Example

SELECT AGE, MIN(SALARY) AS MIN_SALARY FROM


CUSTOMERSGROUPBYAGEORDERBYMIN_SALARYDESC;
GROUPBYwithHAVINGClause
WecanalsousetheGROUPBY
clausewiththeHAVINGclausefilterthegroupeddatainatablebasedonspecific criteria.
Syntax
FollowingisthesyntaxforusingORDERBY clausewith HAVINGclauseinSQL−

SELECT column1, column2,


aggregate_function(column)FROMtable_name
GROUPBYcolumn1,column2
HAVINGcondition;

14
MaharajaAgrasenInstituteofManagementStudies
AffiliatedtoGGSIPUniversity,Recognizedu/s2(f)ofUGCRecognizedbyBa
rCouncilof India,ISO9001:2015CertifiedInstitutionSector22,
Rohini,Delhi-110086, India;www.maims.ac.in

Example

SELECTADDRESS,AGE,MIN(SALARY)ASMIN_SUMFROMCUSTOMER
SGROUPBYADDRESS,AGEHAVINGAGE>24;

15
MaharajaAgrasenInstituteofManagementStudies
AffiliatedtoGGSIPUniversity,Recognizedu/s2(f)ofUGCRecognizedbyBa
rCouncilof India,ISO9001:2015CertifiedInstitutionSector22,
Rohini,Delhi-110086, India;www.maims.ac.in

Assignment1onCreateCommand
Q1.CREATETABLE–DEPT (dno,dname&Location).

Q2.Addaconstraintin existing columnoftabledept(dnameunique)–UNQ_DEP

16

You might also like