0% found this document useful (0 votes)
39 views23 pages

Adobe Scan Jan 24, 2023

This document provides an overview of database management systems (DBMS) and SQL. It discusses the components and features of a DBMS including data definition, data manipulation, data control, and transaction control. It also covers SQL commands like CREATE, SELECT, INSERT, UPDATE, DELETE. Key concepts explained include tables, rows, columns, primary keys, foreign keys, joins, and data types. Relational algebra operations and SQL clauses like WHERE, GROUP BY, HAVING, ORDER BY are also summarized.

Uploaded by

Niyati Singh
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)
39 views23 pages

Adobe Scan Jan 24, 2023

This document provides an overview of database management systems (DBMS) and SQL. It discusses the components and features of a DBMS including data definition, data manipulation, data control, and transaction control. It also covers SQL commands like CREATE, SELECT, INSERT, UPDATE, DELETE. Key concepts explained include tables, rows, columns, primary keys, foreign keys, joins, and data types. Relational algebra operations and SQL clauses like WHERE, GROUP BY, HAVING, ORDER BY are also summarized.

Uploaded by

Niyati Singh
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/ 23

Date ARFAT>

Page.
'
DEMS ouisstg

DSMS- fi datalsose mamagmmt 4ylaePs)


acAtnhzdoeLsRd dath.rkeapionq dycioe.
Luch akyte
dade amd mana40 tio dlataRrose tauituse

Camplo9 DBMS -M8 Acc2g2, YSQL , ale2


Mengeb fostgaSsL
AdusAoge3i=
1. paaed doto aisg
upaael_data Loel
ota gdata ita kets
Kesueo data Uadudany ond dasta
Wwseneietemuy
STaaaed decen naakng

asaseA 0cCAct
2hasnaqmas cenpkorit

KDMS Toininelegy-
Aelema s alalase Stema P le-
atoRa4e skolte

datolase o t Jehro2ede

udw (Tala namzes ama


Date
Page.

umm ccamsLL nt2aimdp On


datote
ALaseelatiomibeahah etto ztalloR.
Katenlaa keetsuctena_ lamilms
Jhueked

olaaRnQit datasase.
oat Bate Ltinnas A- datalsaue
calaleg oletinnas ar hag dete
akgud ( dlata

dolaXsaLe_ ettaming alna

Kelatsenaal nnAoleL: o 9lotenaQ nadel

be_CAkumun ad Lock AAua

Kolatiea._A Ketn
eqitall, 9elatrcl
ARPAT
C)
panako/EoRA: Each cum ta Lal

tabee/tatidy aconol

cekumm
Rlep-Nules o summz lotluruug
aztol
ooduinal
qatirikut2
aman Key- feamay kayAa Aah
wmauolu
C otIto_uwtul u q a

koy- AR2 atbulutog Cmluualima


Canolidat Con&L2Ae

waole a 2okatun tiaL

Mn-

Lteomankyi a h u
Htaanae Key-

Lare muliypa
Amaueey adlti
Cam
ARPAT
Pog9

Bu nly
PD
ckco a humiauy

Gnclids

ingA Nams o s lamo n a i l


tu Del9 No.

2
Nick
2.

13 9ama Ndom s@yh0

a nagatdu bolia u d dllaz


anRitiky actu e

ametl

Talo alie calloAKelasu


Name

Hasa Hetuie
3. App
ausistor
Date
Jrage ARFAT
ARFA

katuemo mana
It a rent
etoncazd anguag2geapenRDMS)_
tosalsg Lad, updato Poubrnad
golaeaal dotaXsao ea Qnd
nd ta:o_
lag Lalg
pleniec eemet_dAd ita aluos_0Le
29_soMe wmdaeyisg oL022
RDBMS ot_isez gQL
caniLe

Lutssductisw o HsRL:- MSQL_


H 2tuched talg_les
u buguog
teoe HSQL
a)o: Eaaiavalale
beaNesanasns
MYSQL osk
plig : MysQL_
A_c2ayta asidtall
CakaLesiy das pewes.R meehanusm
ARFA
Date
Pago

Laesale, Keta tyhor,


ha
SQ Elemel
Caeocetsitig SpL
dntnfe&n20a

2.SQLis suid to accesL


Ayima
MaRasapesa
tinal datalecue 202aLme_L
3.SQLcan ececuto Quoie
d a t a l r a 4 R _ e d do dlaLceule
ekiaeaedaLa n_eamupuloto ule
neddek_ti datalesz

olaralsasA_amd Taleey
6SL

SQt COMmasmol PDL, DRL DCL DOL

DDL Cmmamol- DDLtamol eo


bta
haguage-
_ e d i l y _Le_Llatghnal schei
Iat
ARuLduuse

DL cemmamol GZe_LLaAlle
DML Lommards DML Sands JsA MArL

Jycssols bLhiL u i i Lnmarde 2


ntuwrh, upolat d d i

DQL tands LL iata iuky iaejasL L

atntnas hi onnards 'aku ilie


dst lec
Numikue diata Tyhis- E nmL thAL_d
tuprs that coids nmmes cdaia ihLu
Ant small 2tug ntpeat lt
Stkung ata Tupus hudata ipA a
L
hal okL chak, Aalui
nakchauLonZnt tt
Aotaan Tim1 Daka Tyhis hLAL
thL data tyhis LrslLud
áhat LanAton_olans
Page
Date
CHAR VARCHAR

Titiuoumglh shakastz ualul umglh thakachk


stuimg
21AhLnA Loluma u tach malu hat su slokid
nMolada tip as m thi toluanm AloLus
shak lN): 94ä Aualu ia Lnastly
shontik than thiu lunglh Nc as syau ALy
Nthim Llamksau ulonks ki adlota-
h Alnqth sA shsrih
aoloidlut thuAL oLthan maumum lunglh
N

3fastuk to acoLss Jakis uA dlie spacr


T

NULL 4aluusn SQL qa LAluma AM Akus


hos mA MaluuL thin cdlumm is said lo e
mull NULLSCan abpLok An A LAluma LhL
columm s mst kiatustad lus_NOZNULL k1
Pumasy Ky: Youu shsuld utsu a mull uauu
uhin Ahl_atual Aalu s mat kmouin
Null and Auos mA1guiualmt ry
aithantie 4npkussLen_tartasminga hul
aluuays maluats tomull: s
maplu 1t mull= Mull

SQL Lonstkaunbs Thuy aka uuLd to Aioa


hulis LA thL d a t a n a aTabl
Thuy a nsd to lunit thi tyu o data tnat
Page
Date

am O taiaia tall hus m u s thi


atulacy and hutalutty fthi dlata sn h
Jalal 94 thuks any uslatuon uuliuun th
Lmsthant" andthL däta_astions alualid

Auml Lotumn m l consthamts apply_hoa


CAlun amal tabl liunl Lonsiuasnli apply-
to thiuuhel tablu
h pallaung censtuaints au commanly usil n
SQ

NOT NULL imsuus that a luma connst.


hass a mull A4aluu
UNLQUE=nsukuA that AMlhus J a_Alma

PRIMARY KEY-A Londunatun o a Wst ul_and


UNIQUELniguuly Ldluastujis lash keuw tn a
tall
fnREIGN KY kummts_acionA that ulod
olsstiay mks Autuun talulu
CHECK- msuhus that thi alus n a column
Aaistiis_a hiofi Lonalton
Page
Date

DEFAULT s t a olauld natur yot A LOumn4


e 4dlutis sleifiiols

SQL Cmmanals
CREATE DATA BASE This LommanoAialto.
ual a mu dlatalast
mal
may Sql CREATE DATABASE dalabast mamj

MysatCAEATEDATABASEschssz.
2USE Ths Lommandis uad ta gpm a datnluase
k Tstaut usOLking nalalaiast
Jumtan Mysqk USE datakasz namhl
Mysal ust school,
3 CREATE TABLE COMMAnIA= Ihus commanal is3Ad
tkcate-aMus lallissaku Lkuatuol uuung
CREATE TABLECmananol
Alalulhas_LILs and colummd. Thi columm
mamt must se Akucilico along th data tupi
lan
CREATE TABLE all maml
Columm-nansolata typu LSta) oMslkaintE,
csluma-mamL_olata tipuLsa) constkaint
celuma m0mi data tipi Lsai) Lonstkaint
Page
Date

Lt Cnsnpl-to ckratsAtall stuodind_wi


classs adsle prenagifuu
MySal 2 CREATE TABLE STUDENTI
RNOINI(3) RIMARY KEY i 2
NAME VARCHARU52 NOT NULL
LASSCLASSCHAR, Uo2,
DOB DATE
PERLENTAGE ELOAT (6,2,-
fLES INI (3)),-

4DESCc OR DiscKil = This

Lsumat
DGSCKZatl inasmi>
tnamapltodishlay thtáttuetihu t h
tuolmt talul
Mysa D6SCSTUDEAT 3
DeSCRIBE STUDENT
5)NseRT Cemma nd i his emmanol ts us
imsnting hadolumg.hu kuutakaA/Rous -

nta taltal
Symtan
bkmal-1 L.
INSERI INTOtatlu tMami lLatumasmam
VALUES.(Valuu-L,lakut-2 ).
Page
0ate
O
EauamysLu tsado a hucshd in Lalle stuount
My Sqk INSERI INTO STUDENT
vALuES(10,'Anut', '12 a', 200& ol 12', 812, 10b),
MyskE> INSERI INTO STUDENT(( RNO, NAM , ASS
Ode, PERCE NTAG
VALUES 12, 'Aunask", '2 8','200 o , 1 2)
luet AAmmamd- This_Lgmmand i
oluspla
abanalt usa
gimunfatd t
SELECTLsluma mamu6
EROM
WHER tal_MasmL
Lmolitiga
GRaue 6Y
HAVING Celumn mam
ORDER BY Lonoliti
Column n0ml
lauss MsLdl_uth
sluet comamand
EROM E ls
AsmpiulsMky_ and t s Jsllusud
2 WHERE t
is uAal tsAAhly cenouten Sn
s Amd susd lo Lt
to olushlay tht
dtauls 'd thidata k ampl-.
sudunt uhsi
koL ms Ls5
SELECTx
FROMSTUD
HERE RND = 5

Rilotional_Corkatsks n SQ1Thu Alatuonal


apikatoHS o Cuali A0molitkin akL_ , E
=/_,=
ASC Anolung(dsfaull) Pago
DESC snoluy Dale

h s u Aogtealapiwuata
egcal Shkatous n SALh
cendidon a u AND, dR, NOI
u a d ós ckuating
tnampl- rsllay
olutasls ras s t u n l s
10 a m a fus t s alioue
uhosAslt nd ts

1o,000

SELECTX
EROM STUD
aHERE RNO &10 amd fLES 10000

3:ORDER BY sMsLal to dlsplay thi ucøds

ussn aluuus a thu grurn kotumms thample


olshLay Hallhe amd mamis hLialuolid
m Amckihsimy_ holeh pudntayi
SELECI_RNO NAME
FROM stud
ORDER BY PERLENNTAGE ASC
aul olk aAumolun
Aiihmetee enp*tbotm
AMthmue huratas in SQLThuy can ue udta
mAluat paAl uom9 th asulhmilut obbalot
t ,
ndmbl-
amol MamL_alsng uulh
To dusplay toll ns

Auy 21 purctage"_Lnchuata
slualintsusbhau us ammaunt
le tadoo
Date
O
SELECZRAN@, NAma, PERCEANTAGE 12
EROM STuD
iudtRE f£ESKIO0OD
AS2 anol alistunet
kuuGkols
ALL usLad uuth a ssluma
aauio
JmeluslL ch ALsALay all thuMalus
Calumn neluoliig_4alblucat asaluaf thats
lus dulault atLakhrod uth
DI`TINC kyuretd s uaual uth umky Lolumn
mami to
d tslumn
_Mn
slut enly dstinct ualuis LL
duplesate aaluuteL thi 4utn Lolma
AlaME CLASS GLTRLI
n t a 12-A
lanolana12-8 CLASS
ankita -A 1 A
MoAsta 12-B 12-6
MaAsya- 12-A 1-A
12-B
wSELECT ALL CLASS 12 A
FRDM TI

SELECI DISIINCT CLASS CLASS


FROM TL, 12- A
12-6
IA
Page
Date

ghsup tzunelons Thtál


Aaqhugatu lunctuons_Bh ghsup s Arlus
wek o n _all
a
kettons Lalusman
T h a s e ak -
thi un
Rtct ms Smalus
iMIN lLotumu MameJ
14alutAM lhe Calumms

iMAX column name)- 4uukns lalyrst aalu


LSlumans
ii Sum lunmm mamu) 2 A t u t a s su1 lhu

ivAVGcelimam mama- kulusms aRkagL


4Ouluuts o 9unmmLOAm
v CoUNT (Llunin namk)/ ount l*)- CoUNT CX)
Jututns lotal me kucokols
COUNT COlumn nam) kitu4ns Aetal ne nst
NULL 4aluus Am h qunu cstumn it: stal
M Aaluuus Mm um CSlsnana ull
,
Maluts"
Enamhu. T1
NAME MARKS
Amkita So
Ankita S1
alita NULL
Manoaho S4
Nasuta 83
SELECT MIN (MARKS) FROm TL
MIN (mARKS)
S

SCLECT mAx CMARKS) PROM TI


mAx (MARKS)
Page
Date
SE LEL SumLmARKS) £RO T
SumtmARIKS)
338
SCLECT AYG LmARKS)
AVG MARKSS) fRomTl
82
SCLECT CoDALTLX EROM T CoUNT (K)
5
SELECI CouNTLMARKS) ERom TI CDuNT LMARNS).
4
ORDER BY CLAUSE
A is usLdl to olspday
uskals akkanqAdlim ascLaodung -

Asemolung erdL ath alus_p ths


naapll- olsplay kalU mO analMaML o
Auolunds Jmnchrasing Lolsk
plkehagi
SELELT RNO, NA ME
GRoUP BY CLAUSE sMsLd to Aueup thi
CBLolsBn ths Jasis ol_thu aallus _
Ah qun Aelum aups ak Amatual uuth
olatunat analhus hl qusin Caluma

HAVING_CLAUSL ALsLed afhh_queu luy lo.


placn conolihion_am 4koths. dggiugati functuane
Aan l usrd in hauade stau
Consial_a tabt
EMP

aLNaaut
dan MM maukag y
Nbunta 35
8
paukaut M Accsrtand
Suny M clesck
314 Mamla managA 40
Clk 39
bunalat 37
aya
4ahan M ohuatos 28

spay tatad me wmplaytts n cash

LALAAAAathm Cau
Sluct liscgnatusn, CasLant L*) Madagu 2

RQm émp Csak 3


GRDUe &y slesgmaiuen Accountbuad
ouatoK 2

Anplarytis ak mak haan 1


SELECTsLgmaloin CDUnLT (K) AALgmation
FRQM EMe maagsk 2
CRaUe BY_ asigmatiou Cusk
Hauung CouNT (xVL LoLuato
Paga
Date
tat ttuat utay
Jatule AluasA taluu
tan lu guusiot aat alas
aluknatust am.a.am kth
EKomAkdudL o
SeLeCL
ROMSTUDENL as S
l

HERS.LASS 12 A
IN OPERATOR
JtsusLo Ao uulth HERclauw t
ombak thA4alus acoluma
lust o4jalius
nab usslay c0ol maan all_clask
amal
spukatakdaom talulu tme
SELECT CODE NAME
EROM émP
huHtRE
Lsignalis1 INLCukk ukalak)
BETWEEN OPERATORE Luudti
WHERE claicat to Conmu the saduus H
tLnoluales ubbuk anol Leduk emuts
mamt anal olisignaluon a Ahd mplay
usblay t o 4 0 yrs
uhsgsagis 30
SLLECINAME, DESIGNATIO N
ERoM mP
wHERE AGE BLTLOEEN 20 anol1O;

s AMal uutl wiICRL


LINK OPERATOR
to cembasu oB malclu nalaus
laus pallsan
gsnAolusmm l h
lhe 9unn

JaL_makumg palltrs luvo ulal


cakols au

Lundsacos) Rrpietants naslly chanclt I


1 LPeremtagu) Rupuamts Ao aru ma of
_chahats

PallunSumg
Slumg ugunnin wh A A
Aidg_ukth es SLcsnod Cha
Chaabi stuiny uguaniag uuth P P
ti Juugnlng 2 haLng wuth Al
Page
Dste
isloy cool amd dsugnatuon
EmP Aalul uuth namis Lmplayn kom
ugunniap uith "N
-SeLLLI CCDDESIGAJATIOA!
ERDM Lm?
-wHERE NAM LKE_N:;
1UP DATE 2 18uácal
thi tallu itio to ahomQmy dala n

utshal thamgL Aniuslin


fokmal
uPDAIE kalialu Man
SeT COlumanam
LaluL, celuman namt Valuu
wHERé OnolukuD
ham4 u dhsrgnaiien o ihu
du AccAumtantRem ukk mplsyu me 3

UPDATE eMP
SET dusugmaten Acsumlaut
LUHERL CODE 213
8 DELEI L Ls uAo ko
uCskal Lugm lni tal JumaL 0mG mak
keamai
DELETE
CROM tololunau
WHEREComolluen
AKummon hi umplayu dtols uom
LMP tahlh
o al clrks
Page
Date

AELEIL -

HER NAnynaluon = CLERK

9ALTER TABLE his cmmanal LALaIo_Moau


t alhuctukst h i Lmslung dalul e_
Laliltuunl tyhi6 maaliliedKiLO aud thu
lstinals

ololing a muw columam


ALTER TABLE }allu mami
ADD Celumamasaa data tefu Stg)tonatraunt;
hamqm limckuasin) ih Alg oA Lolkuma
ALTER TABLE kalid asrni
mODIEYclumasndL sdalalyplLsugt) Lonstaml
chamqing MamLo a calumn.
ALTET4BLE aluly LMAML
CHANGE oialiolumamara
miueeiumnaan dalalyL
Rumgmmg_ a COluMn
_dalatg
ALTCR TA GLE dall mame_
DROP COLwm N Coluama
Mam -
Adlalumg a bkumaky ku
ALTER TAblt_all mhn
ADD PRIUM ARY LEY
LOlummMame
Page
Dato

Ramonumg Pkwmay Ru
ALTER TBLE taulaa 3
DROf kuma y Key-
Aolol a Lolumn phonL_mO:1 o thakaelihs
Am émP talaku CRh ao)
ALTER TABLE
ApD Phno cha LuDY
Shomg u(elusma MamLHmMOmL_ÄO
emPami
ALTLR TABLE_mP
CHANGE nami LmeAm Chas 15),

You might also like