\documentclass[10pt,a4paper]{article} % Packages \usepackage{fancyhdr} % For header and footer \usepackage{multicol} % Allows multicols in tables \usepackage{tabularx} % Intelligent column widths \usepackage{tabulary} % Used in header and footer \usepackage{hhline} % Border under tables \usepackage{graphicx} % For images \usepackage{xcolor} % For hex colours %\usepackage[utf8x]{inputenc} % For unicode character support \usepackage[T1]{fontenc} % Without this we get weird character replacements \usepackage{colortbl} % For coloured tables \usepackage{setspace} % For line height \usepackage{lastpage} % Needed for total page number \usepackage{seqsplit} % Splits long words. %\usepackage{opensans} % Can't make this work so far. Shame. Would be lovely. \usepackage[normalem]{ulem} % For underlining links % Most of the following are not required for the majority % of cheat sheets but are needed for some symbol support. \usepackage{amsmath} % Symbols \usepackage{MnSymbol} % Symbols \usepackage{wasysym} % Symbols %\usepackage[english,german,french,spanish,italian]{babel} % Languages % Document Info \author{abirjepatil} \pdfinfo{ /Title (dbfinals.pdf) /Creator (Cheatography) /Author (abirjepatil) /Subject (dbfinals Cheat Sheet) } % Lengths and widths \addtolength{\textwidth}{6cm} \addtolength{\textheight}{-1cm} \addtolength{\hoffset}{-3cm} \addtolength{\voffset}{-2cm} \setlength{\tabcolsep}{0.2cm} % Space between columns \setlength{\headsep}{-12pt} % Reduce space between header and content \setlength{\headheight}{85pt} % If less, LaTeX automatically increases it \renewcommand{\footrulewidth}{0pt} % Remove footer line \renewcommand{\headrulewidth}{0pt} % Remove header line \renewcommand{\seqinsert}{\ifmmode\allowbreak\else\-\fi} % Hyphens in seqsplit % This two commands together give roughly % the right line height in the tables \renewcommand{\arraystretch}{1.3} \onehalfspacing % Commands \newcommand{\SetRowColor}[1]{\noalign{\gdef\RowColorName{#1}}\rowcolor{\RowColorName}} % Shortcut for row colour \newcommand{\mymulticolumn}[3]{\multicolumn{#1}{>{\columncolor{\RowColorName}}#2}{#3}} % For coloured multi-cols \newcolumntype{x}[1]{>{\raggedright}p{#1}} % New column types for ragged-right paragraph columns \newcommand{\tn}{\tabularnewline} % Required as custom column type in use % Font and Colours \definecolor{HeadBackground}{HTML}{333333} \definecolor{FootBackground}{HTML}{666666} \definecolor{TextColor}{HTML}{333333} \definecolor{DarkBackground}{HTML}{25A379} \definecolor{LightBackground}{HTML}{F1F9F6} \renewcommand{\familydefault}{\sfdefault} \color{TextColor} % Header and Footer \pagestyle{fancy} \fancyhead{} % Set header to blank \fancyfoot{} % Set footer to blank \fancyhead[L]{ \noindent \begin{multicols}{3} \begin{tabulary}{5.8cm}{C} \SetRowColor{DarkBackground} \vspace{-7pt} {\parbox{\dimexpr\textwidth-2\fboxsep\relax}{\noindent \hspace*{-6pt}\includegraphics[width=5.8cm]{/web/www.cheatography.com/public/images/cheatography_logo.pdf}} } \end{tabulary} \columnbreak \begin{tabulary}{11cm}{L} \vspace{-2pt}\large{\bf{\textcolor{DarkBackground}{\textrm{dbfinals Cheat Sheet}}}} \\ \normalsize{by \textcolor{DarkBackground}{abirjepatil} via \textcolor{DarkBackground}{\uline{cheatography.com/20522/cs/3712/}}} \end{tabulary} \end{multicols}} \fancyfoot[L]{ \footnotesize \noindent \begin{multicols}{3} \begin{tabulary}{5.8cm}{LL} \SetRowColor{FootBackground} \mymulticolumn{2}{p{5.377cm}}{\bf\textcolor{white}{Cheatographer}} \\ \vspace{-2pt}abirjepatil \\ \uline{cheatography.com/abirjepatil} \\ \end{tabulary} \vfill \columnbreak \begin{tabulary}{5.8cm}{L} \SetRowColor{FootBackground} \mymulticolumn{1}{p{5.377cm}}{\bf\textcolor{white}{Cheat Sheet}} \\ \vspace{-2pt}Published 17th March, 2015.\\ Updated 11th May, 2016.\\ Page {\thepage} of \pageref{LastPage}. \end{tabulary} \vfill \columnbreak \begin{tabulary}{5.8cm}{L} \SetRowColor{FootBackground} \mymulticolumn{1}{p{5.377cm}}{\bf\textcolor{white}{Sponsor}} \\ \SetRowColor{white} \vspace{-5pt} %\includegraphics[width=48px,height=48px]{dave.jpeg} Measure your website readability!\\ www.readability-score.com \end{tabulary} \end{multicols}} \begin{document} \raggedright \raggedcolumns % Set font size to small. Switch to any value % from this page to resize cheat sheet text: % www.emerson.emory.edu/services/latex/latex_169.html \footnotesize % Small font. \begin{multicols*}{4} \begin{tabularx}{3.833cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{3.833cm}}{\bf\textcolor{white}{Spatial Database}} \tn \SetRowColor{white} \mymulticolumn{1}{x{3.833cm}}{1.offers spatial data types:- points lines,regions. \newline % Row Count 2 (+ 2) 2.Collection of objects: partition. \newline % Row Count 3 (+ 1) {\bf{operators that evaluate to boolean}} 1. inside 2.intersect 3. adjacent \newline % Row Count 5 (+ 2) {\bf{operators-\textgreater{}spatial data types}} 1.intersection, plus,minus,contour. \newline % Row Count 7 (+ 2) {\bf{operators returning numbers}} 1.dist,perimeter. \newline % Row Count 8 (+ 1) {\bf{operators on set of objects}}1.sum,closest. \newline % Row Count 9 (+ 1) {\bf{Relationships}} disjoint 1, in46,touch9 equal10, cover1214, overlap16. \newline % Row Count 11 (+ 2) Requirements for Graphical \seqsplit{Representation.1.graphical} display of query results.{\emph{graphical combination}}.{\bf{display of context on an image}}.query to select a part of an image.Legend.Label Placement.Scale Selection. \newline % Row Count 16 (+ 5) {\bf{NEW THINGS REQUIRED IN DBMS}}spatial data types.Procs for data types.Spatial index structure.filter and refine techniques.spatial join operations.% Row Count 19 (+ 3) } \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{3.833cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{3.833cm}}{\bf\textcolor{white}{XML And Web}} \tn \SetRowColor{white} \mymulticolumn{1}{x{3.833cm}}{Sql is set oriented.prepared statements. SQL Injections.{\bf{JSON Values. true,false,null,object,array}}{\emph{eval and parse}} {\bf{XML:- attribute name value pair. root,element,attribute,instructions,text,namespace,content.}} \newline % Row Count 5 (+ 5) DTD:- IDREFS : reference to IDS. \textless{}!ATTLIST\textgreater{}\textless{}!ELEMENT\textgreater{} {\bf{?optional star optional repeatable + required repeatable.}} \newline % Row Count 8 (+ 3) Drawbacks of DTD: 1.inconvinient to build tools using them. don't capture main domains.ids not a good implementation. no way of OO inheritance. \newline % Row Count 11 (+ 3) XSD: using Xpath to for keys. \newline % Row Count 12 (+ 1) Simple element : no attributes,elements and not empty.% Row Count 14 (+ 2) } \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{3.833cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{3.833cm}}{\bf\textcolor{white}{Encryption and decryption.}} \tn \SetRowColor{white} \mymulticolumn{1}{x{3.833cm}}{Symmetric Encryption: all users know the key. \newline % Row Count 1 (+ 1) RSA: public and private key.L=P*Q; \newline % Row Count 2 (+ 1) e random number. s=d \textasciicircum{}emod L; \newline % Row Count 3 (+ 1) decryption: d{\emph{e=lmod((p-l)}}(q-l)) \newline % Row Count 4 (+ 1) Certifying Servers : SSL.certification authority. public key stored in browser. temp session key browser -\textgreater{} encodes it from amazon pub key.and sends to amazon. \newline % Row Count 8 (+ 4) Statistical DB Security:- information about individuals:each query must involve n number of rows.% Row Count 10 (+ 2) } \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{3.833cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{3.833cm}}{\bf\textcolor{white}{Spatial Indexing}} \tn \SetRowColor{white} \mymulticolumn{1}{x{3.833cm}}{approximation of geometries.Minimum bounding rectangles. \newline % Row Count 2 (+ 2) Two step operation:1.Selects all objects whose MBR satisfy the query. A superset of objects is returned. In the next step this superset is refined to return the object that is required.% Row Count 6 (+ 4) } \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{3.833cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{3.833cm}}{\bf\textcolor{white}{R Tree}} \tn \SetRowColor{white} \mymulticolumn{1}{x{3.833cm}}{Based on MBR. Used for 2d Objects.MBR of objects form the leaves of the tree. \newline % Row Count 2 (+ 2) R tree is a depth balanced.The root has atleast 2 entries. \newline % Row Count 4 (+ 2) Two types of queries:1.point query.2.window query.% Row Count 5 (+ 1) } \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{3.833cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{3.833cm}}{\bf\textcolor{white}{Quad tree based Indexing}} \tn \SetRowColor{white} \mymulticolumn{1}{x{3.833cm}}{Space based structures. Division of each space into 4 quadrants. the subdivision can be equal or unequal. \newline % Row Count 3 (+ 3) {\bf{SPACE DRIVEN}} \newline % Row Count 4 (+ 1) Based on partitioning of the embedding 2D space into rectangular cells, independently of the object distribution. Objects are mapped to cells according to some pre-defined criterion. \newline % Row Count 8 (+ 4) Example: Quadtrees \newline % Row Count 9 (+ 1) {\bf{DATA DRIVEN}} \newline % Row Count 10 (+ 1) Based on subdivision of the set of objects and not the embedding space. The subdivision adapts to the object distribution in the space. \newline % Row Count 13 (+ 3) Example: R-trees% Row Count 14 (+ 1) } \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{3.833cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{3.833cm}}{\bf\textcolor{white}{Sorting.}} \tn \SetRowColor{white} \mymulticolumn{1}{x{3.833cm}}{Data required in sorted order. grouping operations.sort merger join. duplicate removal. Bulk loading B+. {\bf{External Merge Sort:- 2N ({[}log n {]}+1)}} \newline % Row Count 3 (+ 3) Cost of merge sort:- \seqsplit{\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_}. \newline % Row Count 4 (+ 1) cost : \seqsplit{\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_}.% Row Count 5 (+ 1) } \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{3.833cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{3.833cm}}{\bf\textcolor{white}{Storage}} \tn \SetRowColor{white} \mymulticolumn{1}{x{3.833cm}}{communication via page requests.query-\textgreater{} page requests.{\bf{RAID}} 1.Level 0:- break a file into blocks,distribute amongst disks.simple to implement, no redundancy or error correction. Low MTTF. 2.Level 1 : Exact replica. Read performance can be improved. Write perf suffers. Expensive.twice space.3. Level 2:- Stripes data. bit interleaved.ECC. Multi disk record ECC, Parity disk.more disks required.{[}erfpr,ace/ECC code .one read at one time. \newline % Row Count 9 (+ 9) Raid Level 3:-Parity Disk is added. ECC codes with each sector. \newline % Row Count 11 (+ 2) Raid Level 4:- interleaves file blocks.allows small IO operations to be done at once.reads are simple to understand. write requires two reads and two writes. \newline % Row Count 15 (+ 4) Raid level 5:- stripes file data and check data over all the disks. write performance improves.high performance. most expensive.mirror each strip.% Row Count 18 (+ 3) } \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{3.833cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{3.833cm}}{\bf\textcolor{white}{Two phase locking}} \tn \SetRowColor{white} \mymulticolumn{1}{x{3.833cm}}{restrict access in some way. Balance between safety and efficiency. release the lock only after the entire transaction has completed. \newline % Row Count 3 (+ 3) Transaction must hold a lock. if another transaction conflicts then it will wait for the previous transaction to release the lock. @ phase locking blocking.leads to deadlock. \newline % Row Count 7 (+ 4) Deadlocks:- ostrich : ctrl+alt+del, timeout,detection and recovery, avoidance,prevention. \newline % Row Count 9 (+ 2) When deadlock is detected some transaction is rolled back.starvation:- same transaction may be aborted.solution: count no of times roll back. \newline % Row Count 12 (+ 3) Avoidance:- timestamping. \newline % Row Count 13 (+ 1) Lock manager:- process to send lock and unlock.responds-\textgreater{} lock grant.lock table-\textgreater{} hash table.new req end of table.unlock results in the entry being deleted and other entries taken care of.% Row Count 17 (+ 4) } \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{3.833cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{3.833cm}}{\bf\textcolor{white}{Transactions.}} \tn \SetRowColor{white} \mymulticolumn{1}{x{3.833cm}}{Concurrent access.Isolation: interleaved \seqsplit{transactions.serializable} transactions.Conflicts:- RW,WR,WW. {\bf{READ Write transactions.:-SET TRANSACTION READ ONLY;}}.{\emph{WR Conflicts: Dirty Reads: uncommitted transactions.}}.{\emph{RW Conflict :-unrepeatable read.transaction reads the same data and gets different ans}}.{\bf{Overwriting uncommitted data.}}.Phantom Problem. \newline % Row Count 8 (+ 8) Specifying Isolation levels:- default:- serializable. \newline % Row Count 10 (+ 2) Eg: Set transaction Read Write; Isolation level read uncommitted. \newline % Row Count 12 (+ 2) ST; Isolation level read committed;ST-\textgreater{} Isolation level repeatable read. \newline % Row Count 14 (+ 2) Read committed:- does not allow reading uncommitted data. \newline % Row Count 16 (+ 2) Repeatable Read:-if a tuple is retrieved once then once then it will be repeatable again. \newline % Row Count 18 (+ 2) Implementing Isolation Levels:- Using locks.shared lock and exclusive lock. \newline % Row Count 20 (+ 2) Read Uncommitted. allows to read without acquiring any lock. Read committed requires a lock.% Row Count 22 (+ 2) } \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{3.833cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{3.833cm}}{\bf\textcolor{white}{Theory of Serializability.}} \tn \SetRowColor{white} \mymulticolumn{1}{x{3.833cm}}{serial schedule. all steps occur consecutively. Well Formed Two phased transaction. acquires shared lock before reading and exclusive lock before writing.% Row Count 4 (+ 4) } \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{3.833cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{3.833cm}}{\bf\textcolor{white}{Security and authorization}} \tn \SetRowColor{white} \mymulticolumn{1}{x{3.833cm}}{Secrecy:- not see things, Integrity:- modify that supposed to. Availability. \newline % Row Count 2 (+ 2) Access control:- security policy and security mechanism.:- Discretionary and Mandatory Access control. \newline % Row Count 5 (+ 3) GRANT privilege ON object TO users {[}WITH GRANT OPTION{]}. \newline % Row Count 7 (+ 2) If the creator of the view loses the SELECT then the view is dropped. \newline % Row Count 9 (+ 2) RBAC:-Mandatory Access Control. db object is given a class. The subject is also given a class. Rules based on object and subject. \newline % Row Count 12 (+ 3) Bell -La Padula Model. \newline % Row Count 13 (+ 1) TS\textgreater{}S\textgreater{}C\textgreater{}U top secret,secret,confidential,unclassified.% Row Count 15 (+ 2) } \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} % That's all folks \end{multicols*} \end{document}