SQL CYBER VAULT

50 Elite Questions • 5 Power Differences • Pure CSS

#Primary KeyUnique Key
1Only one per tableMultiple allowed
2No NULLOne NULL
3Clustered IndexNon-Clustered
4Auto-incrementNo auto-increment
5Used in FKNot in FK
CREATE TABLE Users (
  ID INT PRIMARY KEY,
  Email VARCHAR(100) UNIQUE
);
#DELETETRUNCATE
1DMLDDL
2WHERE allowedNo WHERE
3Triggers fireNo triggers
4RollbackNo rollback
5SlowerFaster
#INNER JOINLEFT JOIN
1Matching rows onlyAll from left
2No NULLsNULLs for unmatched
3Smaller resultLarger result
4FasterSlower
5IntersectionInclusion
#WHEREHAVING
1Before GROUP BYAfter GROUP BY
2No aggregatesUses aggregates
3Row filterGroup filter
4FasterSlower
5Can use indexCannot use index
#ClusteredNon-Clustered
1Sorts data physicallySeparate structure
2Only one per tableMultiple allowed
3Fast range queriesFast exact match
4Data + IndexOnly pointers
5PK by defaultExplicitly created
#UNIONUNION ALL
1Removes duplicatesIncludes duplicates
2SlowerFaster
3Sorts dataNo sorting
4Less memoryMore memory
5Distinct resultAll rows
#SubqueryJOIN
1Nested queryHorizontal merge
2SlowerFaster
3Less readableMore readable
4One-time useReusable
5IN, EXISTSON clause
#ViewTable
1VirtualPhysical
2No dataStores data
3DynamicStatic
4SecurityStorage
5Can be indexedAlways indexed
#RANKDENSE_RANK
11,2,2,41,2,2,3
2GapsNo gaps
3Skips numbersSequential
4For podiumFor ranking
5Less denseDense
#SchemaDatabase
1Logical containerPhysical storage
2Multiple per DBOne per instance
3NamespaceFile system
4Contains objectsContains schemas
5Can be droppedContains data files
#GRANTREVOKE
1Gives permissionRemoves permission
2SELECT, INSERTTAKE BACK
3Adds rightsReduces rights
4DCLDCL
5SecuritySecurity
#DDLDML
1StructureData
2CREATE, ALTERINSERT, UPDATE
3Auto-commitRollback
4No WHEREWHERE allowed
5Schema changeData change
#Foreign KeyPrimary Key
1References PKUnique identifier
2Can be NULLNo NULL
3Multiple per tableOne per table
4Child tableParent table
5Enforces RIEnforces uniqueness
#NormalizationDenormalization
1Reduces redundancyIncreases redundancy
2More tablesFewer tables
3Slower readsFaster reads
4OLTPOLAP
5Data integrityPerformance
#Stored ProcedureFunction
1Can return multipleReturns one value
2CALLSELECT
3Can modify dataRead-only
4Can use TRY-CATCHCannot
5Business logicCalculations
#TriggerConstraint
1Custom logicBuilt-in rules
2Complex actionsSimple rules
3SlowerFaster
4Can rollbackAuto-enforced
5AFTER, BEFORECHECK, FK
#ACIDBASE
1ConsistencyAvailability
2RDBMSNoSQL
3StrongEventual
4TransactionsScalability
5BankingSocial media
#COMMITROLLBACK
1Saves changesUndoes changes
2PermanentTemporary
3Ends transactionEnds transaction
4Cannot undoCan redo
5SuccessFailure
#ROW_NUMBERNTILE
1Unique numberBucket number
21,2,3,41,1,2,2
3SequentialGroups
4PaginationQuartiles
5Single partitionMultiple buckets
#Temporary TableCTE
1Physical storageVirtual
2Persists sessionSingle query
3IndexableNot indexable
4ReusableNot reusable
5PerformanceReadability
#OLTPOLAP
1TransactionsAnalytics
2NormalizedDenormalized
3Real-timeHistorical
4Small queriesLarge queries
5ACIDRead-heavy