Index: .idea/sqldialects.xml
===================================================================
--- .idea/sqldialects.xml	(revision c84fb4079dc65dbc74938c917ab8fd5653de020f)
+++ .idea/sqldialects.xml	(revision 4601414ae521dc9a8e83440aeed21680b149e9fd)
@@ -2,4 +2,5 @@
 <project version="4">
   <component name="SqlDialectMappings">
+    <file url="file://$PROJECT_DIR$/SQL/constrains/filter_deleted_rows.sql" dialect="PostgreSQL" />
     <file url="file://$PROJECT_DIR$/SQL/constrains/general_constrains.sql" dialect="PostgreSQL" />
     <file url="file://$PROJECT_DIR$/SQL/constrains/soft_delete.sql" dialect="PostgreSQL" />
Index: SQL/constrains/filter_deleted_rows.sql
===================================================================
--- SQL/constrains/filter_deleted_rows.sql	(revision 4601414ae521dc9a8e83440aeed21680b149e9fd)
+++ SQL/constrains/filter_deleted_rows.sql	(revision 4601414ae521dc9a8e83440aeed21680b149e9fd)
@@ -0,0 +1,16 @@
+DO $$
+DECLARE
+    r RECORD;
+BEGIN
+    FOR r IN
+        SELECT table_name
+        FROM information_schema.columns
+        WHERE column_name = 'deleted_at' AND table_schema = 'public'
+    LOOP
+        EXECUTE format('ALTER TABLE public.%I ENABLE ROW LEVEL SECURITY;', r.table_name);
+        EXECUTE format(
+            'CREATE POLICY active_only ON public.%I FOR SELECT USING (deleted_at IS NULL);',
+            r.table_name
+        );
+    END LOOP;
+END $$;
Index: SQL/constrains/general_constrains.sql
===================================================================
--- SQL/constrains/general_constrains.sql	(revision c84fb4079dc65dbc74938c917ab8fd5653de020f)
+++ SQL/constrains/general_constrains.sql	(revision 4601414ae521dc9a8e83440aeed21680b149e9fd)
@@ -11,4 +11,39 @@
 ON DELETE SET DEFAULT;
 
+ALTER TABLE customer
+    ALTER COLUMN customer_id ADD GENERATED BY DEFAULT AS IDENTITY;
+
+ALTER TABLE address_info
+    ALTER COLUMN address_info_id ADD GENERATED BY DEFAULT AS IDENTITY;
+
+ALTER TABLE album
+    ALTER COLUMN album_id ADD GENERATED BY DEFAULT AS IDENTITY;
+
+ALTER TABLE artist
+    ALTER COLUMN artist_id ADD GENERATED BY DEFAULT AS IDENTITY;
+
+ALTER TABLE contact
+    ALTER COLUMN contact_id ADD GENERATED BY DEFAULT AS IDENTITY;
+
+ALTER TABLE employee
+    ALTER COLUMN employee_id ADD GENERATED BY DEFAULT AS IDENTITY;
+
+ALTER TABLE genre
+    ALTER COLUMN genre_id ADD GENERATED BY DEFAULT AS IDENTITY;
+
+ALTER TABLE invoice
+    ALTER COLUMN invoice_id ADD GENERATED BY DEFAULT AS IDENTITY;
+
+ALTER TABLE invoice_line
+    ALTER COLUMN invoice_line_id ADD GENERATED BY DEFAULT AS IDENTITY;
+
+ALTER TABLE media_type
+    ALTER COLUMN media_type_id ADD GENERATED BY DEFAULT AS IDENTITY;
+
+ALTER TABLE track
+    ALTER COLUMN track_id ADD GENERATED BY DEFAULT AS IDENTITY;
+
+ALTER TABLE playlist
+    ALTER COLUMN playlist_id ADD GENERATED BY DEFAULT AS IDENTITY;
 
 SELECT setval(pg_get_serial_sequence('invoice_line', 'invoice_line_id'), (SELECT MAX(invoice_line_id) FROM invoice_line));
@@ -40,8 +75,5 @@
 SELECT setval(pg_get_serial_sequence('playlist', 'playlist_id'), (SELECT MAX(playlist_id) FROM playlist));
 
-ALTER TABLE customer
-    ALTER COLUMN customer_id ADD GENERATED BY DEFAULT AS IDENTITY;
 
-ALTER TABLE playlist
-    ALTER COLUMN playlist_id ADD GENERATED BY DEFAULT AS IDENTITY;
 
+
Index: SQL/constrains/soft_delete.sql
===================================================================
--- SQL/constrains/soft_delete.sql	(revision c84fb4079dc65dbc74938c917ab8fd5653de020f)
+++ SQL/constrains/soft_delete.sql	(revision 4601414ae521dc9a8e83440aeed21680b149e9fd)
@@ -1,17 +1,2 @@
---ADDING DELETED_AT COLUMN
-DO $$
-DECLARE
-    r RECORD;
-BEGIN
-    FOR r IN
-        SELECT table_name
-        FROM information_schema.tables
-        WHERE table_schema = 'public'
-          AND table_type = 'BASE TABLE'
-    LOOP
-        EXECUTE format('ALTER TABLE public.%I ADD COLUMN IF NOT EXISTS deleted_at TIMESTAMP;', r.table_name);
-    END LOOP;
-END $$;
-
 --SOFT DELETE TRIGGER
 DO $$
@@ -51,5 +36,5 @@
              END;
              $func$ LANGUAGE plpgsql;',
-            r.table_name, r.table_name, r.table_name, pk_col
+            r.table_name, r.table_name, pk_col, pk_col
         );
 
@@ -64,3 +49,2 @@
     END LOOP;
 END $$;
-
Index: music/urls.py
===================================================================
--- music/urls.py	(revision c84fb4079dc65dbc74938c917ab8fd5653de020f)
+++ music/urls.py	(revision 4601414ae521dc9a8e83440aeed21680b149e9fd)
@@ -28,4 +28,4 @@
     path('invoices/create/', views.create_invoice, name='create_invoice'),
     path('customer/create/', views.create_customer, name='create_customer'),
-
+    path("delete-records/", views.delete_records, name="delete_records"),
 ]
Index: music/views.py
===================================================================
--- music/views.py	(revision c84fb4079dc65dbc74938c917ab8fd5653de020f)
+++ music/views.py	(revision 4601414ae521dc9a8e83440aeed21680b149e9fd)
@@ -28,7 +28,12 @@
 
     if search_track:
-        data = Album.objects.filter(title__icontains=search_track).values_list('title', flat=True)
+        data = Album.objects.filter(
+            title__icontains=search_track,
+            deleted_at__isnull=True
+        ).values_list('title', flat=True)
     else:
-        data = Album.objects.all().values_list('title', flat=True)
+        data = Album.objects.filter(
+            deleted_at__isnull=True
+        ).values_list('title', flat=True)
 
     heading = request.GET.get('model', 'All Albums')
@@ -44,7 +49,12 @@
 
     if search_track:
-        data = Track.objects.filter(name__icontains=search_track).values_list('name', flat=True)
+        data = Track.objects.filter(
+            name__icontains=search_track,
+            deleted_at__isnull=True
+        ).values_list('name', flat=True)
     else:
-        data = Track.objects.all().values_list('name', flat=True)
+        data = Track.objects.filter(
+            deleted_at__isnull=True
+        ).values_list('name', flat=True)
 
     heading = request.GET.get('model', 'All Tracks')
@@ -56,7 +66,13 @@
 
     if search_track:
-        data = Artist.objects.filter(name__icontains=search_track).values_list('name', flat=True)
+        data = Artist.objects.filter(
+            name__icontains=search_track,
+            deleted_at__isnull=True
+        ).values_list('name', flat=True)
     else:
-        data = Artist.objects.all().values_list('name', flat=True)
+        data = Artist.objects.filter(
+            deleted_at__isnull=True
+        ).values_list('name', flat=True)
+
     heading = request.GET.get('model', 'All Artists')
 
@@ -470,2 +486,54 @@
             return redirect("create_playlist")
     return render(request, "create_playlist.html")
+
+def list_tables():
+    with connection.cursor() as cursor:
+        cursor.execute("""
+            SELECT table_name
+            FROM information_schema.tables
+            WHERE table_schema='public'
+              AND table_type='BASE TABLE';
+        """)
+        return [row[0] for row in cursor.fetchall()]
+
+def delete_records(request):
+    tables = list_tables()
+    selected_table = request.GET.get("table") or request.POST.get("table")
+    search_query = request.GET.get("search", "").strip()
+    rows, cols = [], []
+
+    if selected_table:
+        with connection.cursor() as cursor:
+            # Get column names
+            cursor.execute(f"SELECT * FROM {selected_table} WHERE deleted_at IS NULL;")
+            cols = [desc[0] for desc in cursor.description]
+
+            if search_query:
+                conditions = " OR ".join([f"CAST({col} AS TEXT) ILIKE %s" for col in cols])
+                params = [f"%{search_query}%"] * len(cols)
+                cursor.execute(f"SELECT * FROM {selected_table} WHERE {conditions} AND deleted_at IS NULL;", params)
+            else:
+                cursor.execute(f"SELECT * FROM {selected_table} WHERE deleted_at IS NULL;")
+
+            rows = [dict(zip(cols, r)) for r in cursor.fetchall()]
+
+        for row in rows:
+            row["pk"] = row[cols[0]]
+
+    if request.method == "POST" and selected_table:
+        ids = request.POST.getlist("record_ids")
+        if ids:
+            with connection.cursor() as cursor:
+                cursor.execute(
+                    f"DELETE FROM {selected_table} WHERE {cols[0]} IN %s;",
+                    (tuple(ids),)
+                )
+        return redirect("delete_records")
+
+    return render(request, "delete_records.html", {
+        "tables": tables,
+        "selected_table": selected_table,
+        "rows": rows,
+        "cols": cols if selected_table else [],
+        "search_query": search_query,
+    })
Index: templates/delete_records.html
===================================================================
--- templates/delete_records.html	(revision 4601414ae521dc9a8e83440aeed21680b149e9fd)
+++ templates/delete_records.html	(revision 4601414ae521dc9a8e83440aeed21680b149e9fd)
@@ -0,0 +1,64 @@
+<!DOCTYPE html>
+<html>
+<head>
+    <title>Delete Records</title>
+    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.5/dist/css/bootstrap.min.css" rel="stylesheet">
+</head>
+<body class="d-flex bg-light">
+{% include 'sidebar.html' %}
+
+<div class="container mt-5">
+    <h1 class="text-center mb-4">Delete Records</h1>
+
+    <!-- Select Table -->
+    <form method="get" class="mb-3">
+        <label for="table" class="form-label"><strong>Select Table</strong></label>
+        <select name="table" id="table" class="form-select" onchange="this.form.submit()">
+            <option value="">-- Choose Table --</option>
+            {% for table in tables %}
+                <option value="{{ table }}" {% if table == selected_table %}selected{% endif %}>
+                    {{ table }}
+                </option>
+            {% endfor %}
+        </select>
+    </form>
+
+   {% if selected_table %}
+    <!-- Search bar -->
+    <form method="get" class="mb-3">
+        <input type="hidden" name="table" value="{{ selected_table }}">
+        <div class="input-group">
+            <input type="text" name="search" class="form-control" placeholder="Search"
+                   value="{{ search_query }}">
+            <button class="btn btn-outline-secondary" type="submit">Search</button>
+        </div>
+    </form>
+
+    <form method="post" class="card p-4 shadow-sm bg-white">
+        {% csrf_token %}
+        <input type="hidden" name="table" value="{{ selected_table }}">
+
+        <h5 class="mb-3">Records from {{ selected_table }}</h5>
+
+        {% if rows %}
+            {% for row in rows %}
+                <div class="form-check mb-2">
+                    <input class="form-check-input" type="checkbox" name="record_ids" value="{{ row.pk }}">
+                    <label class="form-check-label">
+                        {{ row }}
+                    </label>
+                </div>
+            {% endfor %}
+        {% else %}
+            <div class="alert alert-info">No records found.</div>
+        {% endif %}
+
+        <div class="d-grid mt-3">
+            <button type="submit" class="btn btn-danger">Delete Selected</button>
+        </div>
+    </form>
+{% endif %}
+
+</div>
+</body>
+</html>
Index: templates/sidebar.html
===================================================================
--- templates/sidebar.html	(revision c84fb4079dc65dbc74938c917ab8fd5653de020f)
+++ templates/sidebar.html	(revision 4601414ae521dc9a8e83440aeed21680b149e9fd)
@@ -45,5 +45,5 @@
         <li class="nav-item">
             <a href="{% url 'create_customer' %}"
-                class="nav-link {% if request.path == '/customer/create' %}active{% endif %}">
+               class="nav-link {% if request.path == '/customer/create' %}active{% endif %}">
                 Create Customer
             </a>
@@ -93,13 +93,13 @@
         </li>
         <li class="nav-item">
+            <a href="{% url 'create_playlist' %}"
+               class="nav-link {% if request.path == '/playlists/create/' %}active{% endif %}">
+                Create playlist
+            </a>
+        </li>
+        <li class="nav-item">
             <a href="{% url 'add_tracks_to_playlist' %}"
                class="nav-link {% if request.path == '/playlists/add-tracks/' %}active{% endif %}">
                 Add tracks to playlist
-            </a>
-        </li>
-        <li class="nav-item">
-            <a href="{% url 'create_playlist' %}"
-               class="nav-link {% if request.path == '/playlists/create/' %}active{% endif %}">
-                Create playlist
             </a>
         </li>
@@ -116,4 +116,10 @@
             </a>
         </li>
+        <li class="nav-item">
+            <a href="{% url 'delete_records' %}"
+               class="nav-link {% if request.path == '/delete-record//' %}active{% endif %}">
+                Delete records
+            </a>
+        </li>
     </ul>
 
