MeetCode - Programming Platform | MeetCode - Programming Solutions Platform

Make a table 1NF compliant

Get Detail

Identify partial dependency (2NF)

Get Detail

Remove transitive dependency (3NF)

Get Detail

Candidate keys list (simple)

Get Detail

Find repeating groups (concept)

Get Detail

Convert an address table to 3NF

Get Detail

Handle many-to-many properly

Get Detail

BCNF check with decomposition

Get Detail

Avoid update anomaly

Get Detail

Normalization with composite attribute

Get Detail

Design for historical salary (slowly changing)

Get Detail

Functional dependency driven design

Get Detail

Prevent insert anomaly in raw table

Get Detail

Normalize for reporting and performance

Get Detail

Simple stored procedure with input

Get Detail

Procedure to update salary

Get Detail

Procedure with output parameter

Get Detail

Procedure to clean old logs

Get Detail

Call a procedure

Get Detail

Procedure with transaction inside

Get Detail

Procedure with cursor-like loop (simple)

Get Detail

Procedure returning result set

Get Detail

Procedure with input validation

Get Detail

Procedure to rebuild summary table

Get Detail

Idempotent procedure behavior

Get Detail

Procedure for batch price update with audit

Get Detail

Procedure to detect and return duplicates

Get Detail

Procedure with retry logic idea

Get Detail

Scalar subquery for comparison

Get Detail

IN subquery filter

Get Detail

EXISTS for faster membership

Get Detail

Subquery in FROM (derived table)

Get Detail

Correlated subquery for per-row condition

Get Detail

Find latest order per customer using subquery

Get Detail

Second highest salary using subquery

Get Detail

Find customers with more than N orders

Get Detail

NOT IN pitfall with nulls (safe version)

Get Detail

Update with correlated subquery

Get Detail

Find products priced above category average

Get Detail

Detect customers who always pay late

Get Detail

Correlated delete using subquery

Get Detail

Subquery for top category by revenue

Get Detail

Savepoint and rollback partially

Get Detail

Commit after successful update

Get Detail

Rollback on mistake

Get Detail

Create a savepoint before risky delete

Get Detail

Use transaction block for multiple steps

Get Detail

Release a savepoint (if supported)

Get Detail

Nested savepoints for batch job

Get Detail

Autocommit off workflow

Get Detail

Transaction with error handling idea

Get Detail

Mix DDL and TCL safely

Get Detail

Undo part of a long transaction

Get Detail

Consistency check before commit

Get Detail

Build a safe retry around deadlocks

Get Detail

Two-phase style steps (concept + SQL)

Get Detail

Basic transaction for money transfer

Get Detail

Read consistency example

Get Detail

Avoid dirty writes

Get Detail

Set isolation level

Get Detail

Handle lost update (pattern)

Get Detail

Detect and prevent phantom reads (concept + SQL)

Get Detail

Use savepoint in a business transaction

Get Detail

Explain deadlock with small example

Get Detail

Row-level locking for order processing

Get Detail

Atomic decrement with check

Get Detail

Serializable queue pop (advanced)

Get Detail

Double-spend prevention in wallet

Get Detail

Snapshot reporting without blocking writes

Get Detail

Detect and handle write skew (concept)

Get Detail

Before insert trigger to clean data

Get Detail

After insert audit trigger

Get Detail

Prevent negative price

Get Detail

Auto-update updated_at column

Get Detail

Maintain stock on order item insert

Get Detail

Prevent deleting paid orders

Get Detail

Audit updates with old and new values

Get Detail

Auto-create customer code

Get Detail

Keep summary table in sync

Get Detail

Stop duplicate active coupon

Get Detail

Complex trigger with transaction-safe stock check

Get Detail

Handle update of qty in order items

Get Detail

Prevent salary decrease beyond 20%

Get Detail

Soft delete via trigger

Get Detail

Create a simple view

Get Detail

Query a view

Get Detail

View for active products

Get Detail

Replace a view

Get Detail

Drop a view

Get Detail

View with join for reporting

Get Detail

View to hide sensitive columns

Get Detail

Updatable view idea

Get Detail

View with aggregation

Get Detail

Materialized view style (concept)

Get Detail

View with security filter by city

Get Detail

View for duplicate detection

Get Detail

View combining latest order per customer

Get Detail

View for category revenue

Get Detail

Grant column-level access (hard)

Get Detail

Create table from query with constraints afterward

Get Detail

Merge stage data into master table

Get Detail

Customers with 3 consecutive buying months

Get Detail

Calculate age in years from DOB

Get Detail

Functional index for case-insensitive search

Get Detail

Find pairs with same salary in same department

Get Detail

Design for a multi-valued dependency (4NF flavor)

Get Detail

Procedure to place an order with items table variable

Get Detail

Customers whose every order is fully paid

Get Detail

Chunked updates with savepoint per batch

Get Detail

Lock timeout and safe retry idea

Get Detail

Archive deleted rows using trigger

Get Detail

View for customer spend rank

Get Detail

Add NOT NULL and DEFAULT to a column

Get Detail

Create a UNIQUE constraint for email

Get Detail

Add a CHECK constraint for rating

Get Detail

Composite primary key for enrollment

Get Detail

Foreign key with basic reference

Get Detail

Prevent deleting parent rows when children exist

Get Detail

Auto-delete child rows on parent delete

Get Detail

Add a conditional CHECK using two columns

Get Detail

Enforce case-insensitive uniqueness (pattern approach)

Get Detail

Deferred constraint idea using transaction (concept + SQL)

Get Detail

Find rows violating a constraint rule

Get Detail

Simulate a conditional unique rule

Get Detail

Protect against orphan data during bulk load

Get Detail

Create a strong candidate key with multiple columns

Get Detail

Exactly one payment reference (XOR check)

Get Detail

Grant SELECT on a single table

Get Detail

Revoke a privilege

Get Detail

Create a role and assign it

Get Detail

Grant execute on a procedure

Get Detail

Show current grants (basic)

Get Detail

Read-only user for a whole schema

Get Detail

Grant with grant option (careful)

Get Detail

Revoke role from a user

Get Detail

Limit DML but allow SELECT

Get Detail

Privilege for view but not base tables

Get Detail

Audit-friendly approach for sensitive tables

Get Detail

Remove all privileges safely

Get Detail

Least privilege for stored procedures

Get Detail

Transfer ownership idea (concept + SQL)

Get Detail

Create a database and a table

Get Detail

Add a new column

Get Detail

Rename a column

Get Detail

Drop a table safely

Get Detail

Create table with timestamps

Get Detail

Add an index via DDL

Get Detail

Add a foreign key after table creation

Get Detail

Change column type with caution

Get Detail

Create a view as part of DDL

Get Detail

Add a CHECK constraint using ALTER

Get Detail

Rebuild a table to remove a column (portable approach)

Get Detail

Add a computed column for search

Get Detail

Partition idea (high level DDL)

Get Detail

Create an audit table for triggers later

Get Detail

Insert one row into Customers

Get Detail

Insert multiple rows at once

Get Detail

Update a single row

Get Detail

Delete using a condition

Get Detail

Insert using SELECT

Get Detail

Update using a join

Get Detail

Delete duplicates keeping the latest

Get Detail

Upsert order status

Get Detail

Insert into two tables with transaction

Get Detail

Update based on subquery aggregate

Get Detail

Soft delete pattern

Get Detail

Fix data using CASE

Get Detail

Delete with correlated EXISTS

Get Detail

Bulk insert from CSV-like staging

Get Detail

Basic SELECT with filter

Get Detail

Sort results

Get Detail

Count rows per group

Get Detail

Use HAVING for group filter

Get Detail

Distinct values

Get Detail

Top customer by total spend

Get Detail

Daily sales report

Get Detail

Customers with zero orders

Get Detail

Find gaps in order ids

Get Detail

Second highest salary per department

Get Detail

3-month rolling revenue

Get Detail

Detect customers with suspicious refunds

Get Detail

Find first purchase date and latest purchase date

Get Detail

Market basket: products bought together

Get Detail

Uppercase and trim names

Get Detail

Extract year from a date

Get Detail

Round price to 2 decimals

Get Detail

COALESCE for missing phone

Get Detail

String length check

Get Detail

Format a date column

Get Detail

Bucket customers by spend

Get Detail

Top 3 orders per customer

Get Detail

Lead/lag for day-to-day change

Get Detail

Generate a running total

Get Detail

Detect outliers using percentile

Get Detail

Normalize text for search

Get Detail

Sessionize events

Get Detail

Find median order value

Get Detail

Index a frequently filtered column

Get Detail

Composite index for search

Get Detail

Unique index example

Get Detail

Drop an index

Get Detail

Index for date range queries

Get Detail

Choose the right index for a query

Get Detail

Covering index idea

Get Detail

Index for joins

Get Detail

When not to index

Get Detail

Partial index workaround using helper column

Get Detail

Find unused indexes (query)

Get Detail

Design index for prefix search

Get Detail

Avoid duplicate indexes

Get Detail

Rebuild index after heavy deletes

Get Detail

Basic inner join report

Get Detail

Left join to find missing match

Get Detail

Join three tables

Get Detail

Self join for manager relationship

Get Detail

Cross join for combinations

Get Detail

Anti-join pattern

Get Detail

Join with date filter and aggregation

Get Detail

Full outer join style reconciliation

Get Detail

Many-to-many join with bridge table

Get Detail

Join to pick latest row per group

Get Detail

Revenue by category with multi-join

Get Detail

Find customers who bought from every category

Get Detail

Detect overlapping shifts using self join

Get Detail

Top 2 products per city

Get Detail