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

SQL_Handwritten

The document provides an overview of Database Management Systems (DBMS), including types such as Relational and Non-Relational DBMS. It covers various SQL commands for managing databases, including creating tables, inserting data, querying data, and applying constraints. Additionally, it discusses the importance of primary and foreign keys in database design.

Uploaded by

Kedar Burhanpure
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
0% found this document useful (0 votes)
4 views

SQL_Handwritten

The document provides an overview of Database Management Systems (DBMS), including types such as Relational and Non-Relational DBMS. It covers various SQL commands for managing databases, including creating tables, inserting data, querying data, and applying constraints. Additionally, it discusses the importance of primary and foreign keys in database design.

Uploaded by

Kedar Burhanpure
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
You are on page 1/ 30
(CLASSTIME]Pg.No._| | Database t- 7} fs an Organized collection ree data So -ther it _can be easily accessed. [io manage these da ases, DBms( Database __| Management Systera ) are useds Pafabase DEms a || a SS Pe4==@) [Tees ©€ DBMS 3- 4 | I | z i eS ee NP din [Titer ¢ Relational DBMS CORNGO A * | Non-Relattonal DRMS Relatfonal DEMS ¢-Th hig DRms data Stored in -noble formot. a3 Sat an Armax chal Anus | 5" Ram 3 For CyamPle'- My Sot, Oracle. | [Tia walue2... 5 A Ec a le is In_as Ler Example: Insert INTO use Gxstriame | Qassword ) Vaiues [ Jai Ros > abe @arnail.torn, abcat 123) 5 __[Ficstnlame [easkntame | Gradicid | Hoo to Tneort Mustipte a a tuple) Ee ie ne a ihe ee oe ab«) chp tat LASSTIME]Pa. No. [Date |_ S@L SELECT Command i> as | Tr 1s used +o vetrtewes data Yom the toble |) Suntaget= = é SELECT Column 4, Colurnn 2 | From tablename — e to & ect \ Us ‘St av : ) : t SS CLECT OE Se | Fyom +tablename » Eyarnple t= Eivstnlame Last Name | fosswora __ | vat Kumav 123 | | Soya | Stagh abc | I Arait | Sharma xyz | } Tale :- USER Coram and a | * TS cetetne iirctnigm ea we a Fa Erom USeR ; = ae NNETES CALLesy [toring Bugs (Teterxam Pivst Nam) “| Jai aa How Does Sar =e ae 1 Opting Ingt= Th Optimize. +the best oe algositn for he byte (ode. | FROM *- Tt ig ged +o ae the ables — From which dota fetched = th eal WERE & Tr is used +0 Filtes vecords based — on the aiven Condition - “| slows= Th fs used +o combine data From stables based on oa tommon Field. (Qgove BY i Tt ts used 4p gyoup records aa aS ased On _Oux_-feculvernenfe HAvINGt= TL te used jo Cilter gyoupe. LASSTIME]Pa. No. [pace ff a Cons beats ur komen (Linkedin {TiO NOTES GMLery | Loony ues (Tyran) i | [Emstraints J ia ia) ea ™~ CHECK UNIQUE DEFAULT UNDEX J L NoTNvLL PRIMARY PorReGn KEY Kev _Finese Conshyaints also Known as Tntegxity ___ | Constooints - nn tee ——| « | SOL Constraints i= Conghragnts ace the ules —|_and pospyi | o +oble. (CLASSI (Date —— = a ——— a o LNeT NULL te Malue Cannot be Nu in a column. 2 UNTOLE t= Vatue Cannot be sam? in a Column. o _Peonky KOE Used uniquely identify o vow. ORETGN FOREIGN GY i= 8 feoponee A _fOw) jn. notte PS eae + _Cgeme Wee Used fo speedup the ead (GLAssTiME] Pg. No. (Date ae Se Acrer— o “Upoate. erut. omen (Linkasia) ister) NOTES GALLERY [Camrass Bu4S (TLateter ) ate loiHolized fe |_ hall Tf the ALT! —COMMOAnd Is __USed. LASSTIME]P9. NO. [Dewee a —$_$___— a | | eG. _SEUECT_Drstwvet_t- 4) SS a | Tt Is_used +o velum only unigre votues from |_a _SPectFied Column tno -hable. SELECT DISTINCT _C olumn_name_ ts Sevecr Dishinct assword - PRom_usee ; Z QsSh10 64 123 x92 | SOL WHERE CAUSE i ile [pe is used to Filter yous na table based — ona Spedfied Cenditon o | Syntax = where ae a eee : _Sevect Columnuname sails Cs ERomM +oable name. = WHERE Conditon 3 Example. = J Restntame] Lastalame| Age 4 Jai kumay 19 aya | Sinan ao | mit harma Ql “Table :- USER | Command *- SELECT Fiystniame , Lastrlame From user WHERE Age >20; | Oukouier= a test Name | Last nlame sit it Shawn (3 | ELasstinae]Pa.No._ | Dare I _|_ = . SQLAND t= f ee a Ire AND Operates vetuns dyue if both bee condthon are +rue, and folse Otherwise. = —jameee Condition AvD Conditiona, ae OguL Ko met pokedial” fin} es | Sat OR INETES GUERY [Cort 04S Tol ene Amn SQL NOT Tt xetumne the Opposite of a Condition te _ ERE OT Condition + | Ann : _Condiions {n @ where clause qo Cyeate Lefoce tompley {iteving Conditions. i @ LASS TIME] Pa. No. [Date SG ORDER BY i= ae | tr_ts used +o sort the yesult of a Query oe i _ascending er descending oder - ___ te Cnt . nest : SELECT Column 1, column 2, +. ___ oy See FROM table name. 7 ORDER By Column £ Cascl (pescl, colurnn 2 _ LASC tc Th is used 40 Sort the yesult In ascending Order. Desci= Tt is used to soft the yesult tn Gastwame] Kastntame | Ape. _|l [aot Kumar 4a { [soya | Singh 20 mit Shatma al | ipa “Table :- User. Serect > FRoM User ORoeR By AQes (& LASSTIME| [Dove ff Outpt: LastName fae | Singh | 0 Sharma Ql Kurnar ug a oll [Dr is Used 4o Incest data {nto a toble. \ \ lum: Colum ladue 1 1d . EL NUL values: : Tr is used vepresent miscing or praknoOn dato. = Nuu_te ieferent rom zero ov empty String - peur komod (Linkedin [Twines] NeTes CMELEFY [Coping Buas(, Telemra ma) | Thsext NULL Value t< lott ia Tousees ae. intienaene Calan alien 2) VAWES (logue 4 i eee “To hen 2s ‘Alu _Votues [ts _NULL_*2 i t [ __sev]ect column 1, Column 2, 2... me = From +ohlename. were Column 2 Is NULLS \6 Setect Column1, Column 2,... ce FRom +toble- name a WHERE Colurnn 1 IS Not NULL oe SQL_UPDATE t- Th [s used 4p Specify the Celumn and a SOULS Yaraple Ze el IPg. No. | Command eT Sa WPDATE USERS ae 1 SSeT. age = age + 1 5 rs | Ougaut ee ale gs __[Bsstname [Lastname | foe + Jar Kumar in je NOya tagh 16 | Amit | sharma Qi - Derur ewrnene ( Linlcedin { Tositter ) SQL _ DELETE i NPTEE GALLERY [eapnG GUGS ( Telenpsarn) It_is_used 4o remove eyisting xecord from. a table In o Sot Database . [ Synogts= |__“Juis Operation is not reversible, co be corfu) when using Devete ctatements | _ a =r "es <(0L. Wildcards +- rrr Wildcards are Special characters used tn SOL _ LIKE” ©peratny to search for_a_spedfic ni Pattern _tn_a__calumn oF _ G@ table. + |The persent_sign Ci) fepsesents zero, one ___ __| oy multiple chowachers- a + he. _undexsenre sign (— ) represents _one, Single : ___cheyader. i SOL LIKE 9 Tr ts uced to search fry o specific tina column of a table. Suntogt to =" Sever Columa 4 Column 2, -.. Rpm +tpoble— name _______— | __tamege Column name Like Patteynt | 7 ee ee [sau ne | sa Te used to getty __muutiple values fa _Q ___. E clouse _ ta eee | path contogte ; SELECT Column 1, Column 2--: a ERom toble. name e WHERE Columnname fn) ( volue 1, volue 2): 5G Between = heer, ie ts_used +o Giter data “based _on a 4_xOnge _of values Ino were close, _._____— Cuntoy = SELE FRorv able name oy Were Column name Retween On A Qs | <@t_UNTON Operatos !- as Se, Tr {s used 40 comblne +the result cets oF f }wo Ox more - — ~ te te weturns only_disHinct 10Ws. i SELECT Column name UNTON Stvect Column_name FRom t+oble name 25 Sevect A SELECT B OD Iau Gove By be ue 2 Tris used +p group tows thot hove -the same. values fate Summary tows, ike “ Find the number of Customers tn each city.”? _ SOL HAWNG t= Tr ts used to Gitex the posuite of __GRovP BY? query Based on_the value. of An aggregate function - —_————_—_ : 3 aque xomoa, (hinkedin [Trsitter) SOU EXISTS 8S UTES CAMULERY [eooiny Cues (Telayyam) Te ig used 4p checie 1€ 0 suhquery yeturns On, _YOWs = _T+ ‘yebuyins uo Siooolean ou 7; | sQtu Any oa |_ - _Tt_ts_also_a Comparison Operator - — th vetums hue If the value is tue For mi ot_ least one element. een Types-oe-Exvor In SOL © Syntax Exroxsi- (us_yohi nts e Semantic Gevor t- These eccux then the Primary Key - _ Name and address —axe_net_unigue mae Rotl_ nto fs uni $0 S ‘ ——— unique and not fut] —dBIee .———_—— 4Resutt toble. Scitence English | c Ret SS Aad cca bor 207: - a8 SO: Qi7l: we howe tp add Pivary Key In Qesull table hich act “as foreign _ Koy: _ peur eomne (Linkedin! Totter) Ries CHHLEES Fzgp a os Lorelan Key Science “ee toy: bo 307 English aq = AND Rou == coment and Rollback are stanton = ial a i = a

You might also like