| 1 | -- =========================================
|
|---|
| 2 | -- USERS
|
|---|
| 3 | -- =========================================
|
|---|
| 4 | INSERT INTO "user" (email,password,is_active,created_at)
|
|---|
| 5 | SELECT
|
|---|
| 6 | 'user' || gs || '@mail.com',
|
|---|
| 7 | 'Aa123456!',
|
|---|
| 8 | TRUE,
|
|---|
| 9 | CURRENT_TIMESTAMP
|
|---|
| 10 | FROM generate_series(2,1001101) gs;
|
|---|
| 11 |
|
|---|
| 12 | -- =========================================
|
|---|
| 13 | -- ROLES
|
|---|
| 14 | -- =========================================
|
|---|
| 15 | INSERT INTO role (role_id,name)
|
|---|
| 16 | VALUES (2,'customer'),(3,'employee'),(4,'manager')
|
|---|
| 17 | ON CONFLICT DO NOTHING;
|
|---|
| 18 |
|
|---|
| 19 | -- =========================================
|
|---|
| 20 | -- USER ROLE
|
|---|
| 21 | -- =========================================
|
|---|
| 22 | INSERT INTO user_role (user_id,role_id)
|
|---|
| 23 | SELECT gs,2 FROM generate_series(2,1000001) gs;
|
|---|
| 24 |
|
|---|
| 25 | INSERT INTO user_role (user_id,role_id)
|
|---|
| 26 | SELECT gs,3 FROM generate_series(1000002,1001001) gs;
|
|---|
| 27 |
|
|---|
| 28 | INSERT INTO user_role (user_id,role_id)
|
|---|
| 29 | SELECT gs,4 FROM generate_series(1001002,1001101) gs;
|
|---|
| 30 |
|
|---|
| 31 | -- =========================================
|
|---|
| 32 | -- CUSTOMER (1M)
|
|---|
| 33 | -- =========================================
|
|---|
| 34 | INSERT INTO customer (user_id,first_name,last_name,phone,created_at)
|
|---|
| 35 | SELECT
|
|---|
| 36 | gs,
|
|---|
| 37 | 'John','Smith',
|
|---|
| 38 | '+3897'||lpad(gs::text,7,'0'),
|
|---|
| 39 | CURRENT_TIMESTAMP
|
|---|
| 40 | FROM generate_series(2,1000001) gs;
|
|---|
| 41 |
|
|---|
| 42 | -- =========================================
|
|---|
| 43 | -- EMPLOYEE (1000)
|
|---|
| 44 | -- =========================================
|
|---|
| 45 | INSERT INTO employee (user_id,first_name,last_name,hire_date,bio,is_active,created_at)
|
|---|
| 46 | SELECT
|
|---|
| 47 | gs,
|
|---|
| 48 | 'Emp','Worker',
|
|---|
| 49 | CURRENT_DATE,
|
|---|
| 50 | 'bio',
|
|---|
| 51 | TRUE,
|
|---|
| 52 | CURRENT_TIMESTAMP
|
|---|
| 53 | FROM generate_series(1000002,1001001) gs;
|
|---|
| 54 |
|
|---|
| 55 | -- =========================================
|
|---|
| 56 | -- MANAGER (100)
|
|---|
| 57 | -- =========================================
|
|---|
| 58 | INSERT INTO manager (user_id,created_at)
|
|---|
| 59 | SELECT
|
|---|
| 60 | gs,
|
|---|
| 61 | CURRENT_TIMESTAMP
|
|---|
| 62 | FROM generate_series(1001002,1001101) gs;
|
|---|
| 63 |
|
|---|
| 64 | -- =========================================
|
|---|
| 65 | -- BUSINESS (100)
|
|---|
| 66 | -- =========================================
|
|---|
| 67 | INSERT INTO business (name,description,phone,email,created_at)
|
|---|
| 68 | SELECT
|
|---|
| 69 | 'Business '||gs,
|
|---|
| 70 | 'Desc',
|
|---|
| 71 | '+38970'||lpad(gs::text,6,'0'),
|
|---|
| 72 | 'biz'||gs||'@mail.com',
|
|---|
| 73 | CURRENT_TIMESTAMP
|
|---|
| 74 | FROM generate_series(1,100) gs;
|
|---|
| 75 |
|
|---|
| 76 | -- =========================================
|
|---|
| 77 | -- SPECIALTY (100)
|
|---|
| 78 | -- =========================================
|
|---|
| 79 | INSERT INTO specialty (name)
|
|---|
| 80 | SELECT 'Specialty '||gs
|
|---|
| 81 | FROM generate_series(1,100) gs;
|
|---|
| 82 |
|
|---|
| 83 | -- =========================================
|
|---|
| 84 | -- BUSINESS SPECIALTY (UNIQUE SAFE)
|
|---|
| 85 | -- =========================================
|
|---|
| 86 | INSERT INTO business_specialty (business_id,specialty_id)
|
|---|
| 87 | SELECT b,s
|
|---|
| 88 | FROM generate_series(1,100) b
|
|---|
| 89 | JOIN generate_series(1,100) s ON TRUE
|
|---|
| 90 | WHERE NOT (b=1 AND s=1);
|
|---|
| 91 |
|
|---|
| 92 | -- =========================================
|
|---|
| 93 | -- EMPLOYEE BUSINESS SPECIALTY
|
|---|
| 94 | -- =========================================
|
|---|
| 95 | INSERT INTO employee_business_specialty (employee_id,business_id,specialty_id)
|
|---|
| 96 | SELECT e, ((e-1)%100)+1, ((e-1)%100)+1
|
|---|
| 97 | FROM generate_series(2,1000) e;
|
|---|
| 98 |
|
|---|
| 99 | -- =========================================
|
|---|
| 100 | -- BUSINESS MANAGER
|
|---|
| 101 | -- =========================================
|
|---|
| 102 | INSERT INTO business_manager (business_id,manager_id,assigned_at)
|
|---|
| 103 | SELECT b,b,CURRENT_TIMESTAMP
|
|---|
| 104 | FROM generate_series(2,100) b;
|
|---|
| 105 |
|
|---|
| 106 | -- =========================================
|
|---|
| 107 | -- BUSINESS EMPLOYEE
|
|---|
| 108 | -- =========================================
|
|---|
| 109 | INSERT INTO business_employee (business_id,employee_id,date_start)
|
|---|
| 110 | SELECT ((e-1)%100)+1, e, CURRENT_DATE
|
|---|
| 111 | FROM generate_series(2,1000) e;
|
|---|
| 112 |
|
|---|
| 113 | -- =========================================
|
|---|
| 114 | -- MANAGER EMPLOYEE BUSINESS (NO DUPLICATES)
|
|---|
| 115 | -- =========================================
|
|---|
| 116 | INSERT INTO manager_employee_business (manager_id,employee_id,business_id,date_start)
|
|---|
| 117 | SELECT m,e,m,CURRENT_TIMESTAMP
|
|---|
| 118 | FROM generate_series(1,100) m
|
|---|
| 119 | JOIN generate_series(1,1000) e ON TRUE
|
|---|
| 120 | WHERE NOT (m=1 AND e=1);
|
|---|
| 121 |
|
|---|
| 122 | -- =========================================
|
|---|
| 123 | -- SERVICE CATEGORY (1000)
|
|---|
| 124 | -- =========================================
|
|---|
| 125 | INSERT INTO service_category (name)
|
|---|
| 126 | SELECT 'Category '||gs
|
|---|
| 127 | FROM generate_series(1,1000) gs;
|
|---|
| 128 |
|
|---|
| 129 | -- =========================================
|
|---|
| 130 | -- SERVICE (1000)
|
|---|
| 131 | -- =========================================
|
|---|
| 132 | INSERT INTO service (category_id,name,description)
|
|---|
| 133 | SELECT gs,'Service '||gs,'Desc'
|
|---|
| 134 | FROM generate_series(1,1000) gs;
|
|---|
| 135 |
|
|---|
| 136 | -- =========================================
|
|---|
| 137 | -- BUSINESS SERVICE (UNIQUE SAFE)
|
|---|
| 138 | -- =========================================
|
|---|
| 139 | INSERT INTO business_service (business_id,service_id,price,duration_minutes,is_active)
|
|---|
| 140 | SELECT b,s,20,30,TRUE
|
|---|
| 141 | FROM generate_series(1,100) b
|
|---|
| 142 | JOIN generate_series(1,1000) s ON TRUE
|
|---|
| 143 | WHERE NOT (b=1 AND s=1);
|
|---|
| 144 |
|
|---|
| 145 | -- =========================================
|
|---|
| 146 | -- EMPLOYEE SERVICE
|
|---|
| 147 | -- =========================================
|
|---|
| 148 | INSERT INTO employee_service (employee_id,service_id)
|
|---|
| 149 | SELECT e, ((e-1)%1000)+1
|
|---|
| 150 | FROM generate_series(2,1000) e;
|
|---|
| 151 |
|
|---|
| 152 | -- =========================================
|
|---|
| 153 | -- BUSINESS LOCATION
|
|---|
| 154 | -- =========================================
|
|---|
| 155 | INSERT INTO business_location (business_id,address,city,phone)
|
|---|
| 156 | SELECT b,'Address '||b,'Skopje','+38970'||lpad(b::text,6,'0')
|
|---|
| 157 | FROM generate_series(2,100) b;
|
|---|
| 158 |
|
|---|
| 159 | -- =========================================
|
|---|
| 160 | -- BUSINESS HOUR
|
|---|
| 161 | -- =========================================
|
|---|
| 162 | INSERT INTO business_hour (business_id,day_of_week,open_time,close_time,is_open)
|
|---|
| 163 | SELECT b,'Mon','08:00','17:00',TRUE
|
|---|
| 164 | FROM generate_series(2,100) b;
|
|---|
| 165 |
|
|---|
| 166 | -- =========================================
|
|---|
| 167 | -- WORKING SCHEDULE
|
|---|
| 168 | -- =========================================
|
|---|
| 169 | INSERT INTO working_schedule (employee_id,business_id,business_hours_id,day_of_week,start_time,end_time,is_working)
|
|---|
| 170 | SELECT e, ((e-1)%100)+1,1,'Mon','08:00','17:00',TRUE
|
|---|
| 171 | FROM generate_series(2,1000) e;
|
|---|
| 172 |
|
|---|
| 173 | -- =========================================
|
|---|
| 174 | -- TIME SLOT (SAFE)
|
|---|
| 175 | -- =========================================
|
|---|
| 176 | INSERT INTO time_slot (employee_id,business_id,date,start_time,end_time,is_available)
|
|---|
| 177 | SELECT
|
|---|
| 178 | ((gs-2)%1000)+1,
|
|---|
| 179 | ((gs-2)%100)+1,
|
|---|
| 180 | CURRENT_DATE,
|
|---|
| 181 | '08:00','08:30',TRUE
|
|---|
| 182 | FROM generate_series(2,1000001) gs;
|
|---|
| 183 |
|
|---|
| 184 | -- =========================================
|
|---|
| 185 | -- APPOINTMENT
|
|---|
| 186 | -- =========================================
|
|---|
| 187 | INSERT INTO appointment (customer_id,employee_id,business_id,service_id,slot_id,status,created_at)
|
|---|
| 188 | SELECT
|
|---|
| 189 | ((gs-2)%1000000)+1,
|
|---|
| 190 | ((gs-2)%1000)+1,
|
|---|
| 191 | ((gs-2)%100)+1,
|
|---|
| 192 | ((gs-2)%1000)+1,
|
|---|
| 193 | gs,
|
|---|
| 194 | 'confirmed',
|
|---|
| 195 | CURRENT_TIMESTAMP
|
|---|
| 196 | FROM generate_series(2,1000001) gs;
|
|---|
| 197 |
|
|---|
| 198 | -- =========================================
|
|---|
| 199 | -- RESCHEDULE REQUEST
|
|---|
| 200 | -- =========================================
|
|---|
| 201 | INSERT INTO reschedule_request (appointment_id,old_slot_id,new_slot_id,manager_id,employee_id,status,reason,created_at)
|
|---|
| 202 | SELECT
|
|---|
| 203 | gs,
|
|---|
| 204 | gs,
|
|---|
| 205 | gs+1,
|
|---|
| 206 | ((gs-2)%100)+1,
|
|---|
| 207 | ((gs-2)%1000)+1,
|
|---|
| 208 | 'pending',
|
|---|
| 209 | 'Change',
|
|---|
| 210 | CURRENT_TIMESTAMP
|
|---|
| 211 | FROM generate_series(2,100001) gs;
|
|---|
| 212 |
|
|---|
| 213 | -- =========================================
|
|---|
| 214 | -- REVIEW
|
|---|
| 215 | -- =========================================
|
|---|
| 216 | INSERT INTO review (appointment_id,customer_id,employee_id,manager_id,business_id,rating,comment,created_at)
|
|---|
| 217 | SELECT
|
|---|
| 218 | gs,
|
|---|
| 219 | ((gs-2)%1000000)+1,
|
|---|
| 220 | ((gs-2)%1000)+1,
|
|---|
| 221 | ((gs-2)%100)+1,
|
|---|
| 222 | ((gs-2)%100)+1,
|
|---|
| 223 | (gs%5)+1,
|
|---|
| 224 | 'Review',
|
|---|
| 225 | CURRENT_TIMESTAMP
|
|---|
| 226 | FROM generate_series(2,500001) gs;
|
|---|
| 227 |
|
|---|
| 228 | -- =========================================
|
|---|
| 229 | -- CANCELLATION
|
|---|
| 230 | -- =========================================
|
|---|
| 231 | INSERT INTO cancellation (appointment_id,cancelled_by,reason,refund_amount,created_at,employee_id)
|
|---|
| 232 | SELECT
|
|---|
| 233 | gs,
|
|---|
| 234 | 'employee',
|
|---|
| 235 | 'Reason',
|
|---|
| 236 | 0,
|
|---|
| 237 | CURRENT_TIMESTAMP,
|
|---|
| 238 | ((gs-2)%1000)+1
|
|---|
| 239 | FROM generate_series(2,100001) gs;
|
|---|
| 240 |
|
|---|
| 241 | -- =========================================
|
|---|
| 242 | -- GALLERY
|
|---|
| 243 | -- =========================================
|
|---|
| 244 | INSERT INTO gallery_item (business_id,employee_id,image_url,description,uploaded_at)
|
|---|
| 245 | SELECT
|
|---|
| 246 | ((gs-2)%100)+1,
|
|---|
| 247 | ((gs-2)%1000)+1,
|
|---|
| 248 | 'https://example.com/img'||gs||'.jpg',
|
|---|
| 249 | 'Image',
|
|---|
| 250 | CURRENT_TIMESTAMP
|
|---|
| 251 | FROM generate_series(2,100001) gs;
|
|---|
| 252 |
|
|---|
| 253 |
|
|---|
| 254 |
|
|---|
| 255 | -------------------------
|
|---|
| 256 |
|
|---|
| 257 | BEGIN;
|
|---|
| 258 |
|
|---|
| 259 | SET LOCAL synchronous_commit = OFF;
|
|---|
| 260 |
|
|---|
| 261 | -- =====================================================
|
|---|
| 262 | -- ADD TIME SLOTS
|
|---|
| 263 | -- Adds: 19,899,998
|
|---|
| 264 | -- Uses real employee IDs and business IDs from your DB
|
|---|
| 265 | -- =====================================================
|
|---|
| 266 |
|
|---|
| 267 | WITH
|
|---|
| 268 | employees AS (
|
|---|
| 269 | SELECT employee_id, ROW_NUMBER() OVER (ORDER BY employee_id) AS rn
|
|---|
| 270 | FROM employee
|
|---|
| 271 | ),
|
|---|
| 272 | businesses AS (
|
|---|
| 273 | SELECT business_id, ROW_NUMBER() OVER (ORDER BY business_id) AS rn
|
|---|
| 274 | FROM business
|
|---|
| 275 | ),
|
|---|
| 276 | counts AS (
|
|---|
| 277 | SELECT
|
|---|
| 278 | (SELECT COUNT(*) FROM employees) AS employee_count,
|
|---|
| 279 | (SELECT COUNT(*) FROM businesses) AS business_count
|
|---|
| 280 | )
|
|---|
| 281 | INSERT INTO time_slot (
|
|---|
| 282 | employee_id,
|
|---|
| 283 | business_id,
|
|---|
| 284 | date,
|
|---|
| 285 | start_time,
|
|---|
| 286 | end_time,
|
|---|
| 287 | is_available
|
|---|
| 288 | )
|
|---|
| 289 | SELECT
|
|---|
| 290 | e.employee_id,
|
|---|
| 291 | b.business_id,
|
|---|
| 292 | CURRENT_DATE + (((gs - 1) / 48000)::int),
|
|---|
| 293 | (TIME '08:00' + (((gs - 1) % 18) * INTERVAL '30 minutes'))::time,
|
|---|
| 294 | (TIME '08:30' + (((gs - 1) % 18) * INTERVAL '30 minutes'))::time,
|
|---|
| 295 | TRUE
|
|---|
| 296 | FROM generate_series(1, 19899998) gs
|
|---|
| 297 | CROSS JOIN counts c
|
|---|
| 298 | JOIN employees e
|
|---|
| 299 | ON e.rn = ((gs - 1) % c.employee_count) + 1
|
|---|
| 300 | JOIN businesses b
|
|---|
| 301 | ON b.rn = ((gs - 1) % c.business_count) + 1;
|
|---|
| 302 |
|
|---|
| 303 |
|
|---|
| 304 | -- =====================================================
|
|---|
| 305 | -- ADD APPOINTMENTS
|
|---|
| 306 | -- Adds: 4,989,999
|
|---|
| 307 | -- Uses real customer, employee, business, service, slot IDs
|
|---|
| 308 | -- =====================================================
|
|---|
| 309 |
|
|---|
| 310 | WITH
|
|---|
| 311 | customers AS (
|
|---|
| 312 | SELECT customer_id, ROW_NUMBER() OVER (ORDER BY customer_id) AS rn
|
|---|
| 313 | FROM customer
|
|---|
| 314 | ),
|
|---|
| 315 | employees AS (
|
|---|
| 316 | SELECT employee_id, ROW_NUMBER() OVER (ORDER BY employee_id) AS rn
|
|---|
| 317 | FROM employee
|
|---|
| 318 | ),
|
|---|
| 319 | businesses AS (
|
|---|
| 320 | SELECT business_id, ROW_NUMBER() OVER (ORDER BY business_id) AS rn
|
|---|
| 321 | FROM business
|
|---|
| 322 | ),
|
|---|
| 323 | services AS (
|
|---|
| 324 | SELECT service_id, ROW_NUMBER() OVER (ORDER BY service_id) AS rn
|
|---|
| 325 | FROM service
|
|---|
| 326 | ),
|
|---|
| 327 | slots AS (
|
|---|
| 328 | SELECT slot_id, ROW_NUMBER() OVER (ORDER BY slot_id) AS rn
|
|---|
| 329 | FROM time_slot
|
|---|
| 330 | ),
|
|---|
| 331 | counts AS (
|
|---|
| 332 | SELECT
|
|---|
| 333 | (SELECT COUNT(*) FROM customers) AS customer_count,
|
|---|
| 334 | (SELECT COUNT(*) FROM employees) AS employee_count,
|
|---|
| 335 | (SELECT COUNT(*) FROM businesses) AS business_count,
|
|---|
| 336 | (SELECT COUNT(*) FROM services) AS service_count,
|
|---|
| 337 | (SELECT COUNT(*) FROM slots) AS slot_count
|
|---|
| 338 | )
|
|---|
| 339 | INSERT INTO appointment (
|
|---|
| 340 | customer_id,
|
|---|
| 341 | employee_id,
|
|---|
| 342 | business_id,
|
|---|
| 343 | service_id,
|
|---|
| 344 | slot_id,
|
|---|
| 345 | status,
|
|---|
| 346 | created_at
|
|---|
| 347 | )
|
|---|
| 348 | SELECT
|
|---|
| 349 | cst.customer_id,
|
|---|
| 350 | e.employee_id,
|
|---|
| 351 | b.business_id,
|
|---|
| 352 | s.service_id,
|
|---|
| 353 | ts.slot_id,
|
|---|
| 354 | 'confirmed',
|
|---|
| 355 | CURRENT_TIMESTAMP
|
|---|
| 356 | FROM generate_series(1, 4989999) gs
|
|---|
| 357 | CROSS JOIN counts c
|
|---|
| 358 | JOIN customers cst
|
|---|
| 359 | ON cst.rn = ((gs - 1) % c.customer_count) + 1
|
|---|
| 360 | JOIN employees e
|
|---|
| 361 | ON e.rn = ((gs - 1) % c.employee_count) + 1
|
|---|
| 362 | JOIN businesses b
|
|---|
| 363 | ON b.rn = ((gs - 1) % c.business_count) + 1
|
|---|
| 364 | JOIN services s
|
|---|
| 365 | ON s.rn = ((gs - 1) % c.service_count) + 1
|
|---|
| 366 | JOIN slots ts
|
|---|
| 367 | ON ts.rn = ((gs - 1) % c.slot_count) + 1;
|
|---|
| 368 |
|
|---|
| 369 |
|
|---|
| 370 | -- =====================================================
|
|---|
| 371 | -- ADD REVIEWS
|
|---|
| 372 | -- Adds: 4,997,499
|
|---|
| 373 | -- Uses real appointment, customer, employee, manager, business IDs
|
|---|
| 374 | -- =====================================================
|
|---|
| 375 |
|
|---|
| 376 | WITH
|
|---|
| 377 | appointments AS (
|
|---|
| 378 | SELECT appointment_id, ROW_NUMBER() OVER (ORDER BY appointment_id) AS rn
|
|---|
| 379 | FROM appointment
|
|---|
| 380 | ),
|
|---|
| 381 | customers AS (
|
|---|
| 382 | SELECT customer_id, ROW_NUMBER() OVER (ORDER BY customer_id) AS rn
|
|---|
| 383 | FROM customer
|
|---|
| 384 | ),
|
|---|
| 385 | employees AS (
|
|---|
| 386 | SELECT employee_id, ROW_NUMBER() OVER (ORDER BY employee_id) AS rn
|
|---|
| 387 | FROM employee
|
|---|
| 388 | ),
|
|---|
| 389 | managers AS (
|
|---|
| 390 | SELECT manager_id, ROW_NUMBER() OVER (ORDER BY manager_id) AS rn
|
|---|
| 391 | FROM manager
|
|---|
| 392 | ),
|
|---|
| 393 | businesses AS (
|
|---|
| 394 | SELECT business_id, ROW_NUMBER() OVER (ORDER BY business_id) AS rn
|
|---|
| 395 | FROM business
|
|---|
| 396 | ),
|
|---|
| 397 | counts AS (
|
|---|
| 398 | SELECT
|
|---|
| 399 | (SELECT COUNT(*) FROM appointments) AS appointment_count,
|
|---|
| 400 | (SELECT COUNT(*) FROM customers) AS customer_count,
|
|---|
| 401 | (SELECT COUNT(*) FROM employees) AS employee_count,
|
|---|
| 402 | (SELECT COUNT(*) FROM managers) AS manager_count,
|
|---|
| 403 | (SELECT COUNT(*) FROM businesses) AS business_count
|
|---|
| 404 | )
|
|---|
| 405 | INSERT INTO review (
|
|---|
| 406 | appointment_id,
|
|---|
| 407 | customer_id,
|
|---|
| 408 | employee_id,
|
|---|
| 409 | manager_id,
|
|---|
| 410 | business_id,
|
|---|
| 411 | rating,
|
|---|
| 412 | comment,
|
|---|
| 413 | created_at
|
|---|
| 414 | )
|
|---|
| 415 | SELECT
|
|---|
| 416 | a.appointment_id,
|
|---|
| 417 | cst.customer_id,
|
|---|
| 418 | e.employee_id,
|
|---|
| 419 | m.manager_id,
|
|---|
| 420 | b.business_id,
|
|---|
| 421 | ((gs - 1) % 5) + 1,
|
|---|
| 422 | 'Review',
|
|---|
| 423 | CURRENT_TIMESTAMP
|
|---|
| 424 | FROM generate_series(1, 4997499) gs
|
|---|
| 425 | CROSS JOIN counts c
|
|---|
| 426 | JOIN appointments a
|
|---|
| 427 | ON a.rn = ((gs - 1) % c.appointment_count) + 1
|
|---|
| 428 | JOIN customers cst
|
|---|
| 429 | ON cst.rn = ((gs - 1) % c.customer_count) + 1
|
|---|
| 430 | JOIN employees e
|
|---|
| 431 | ON e.rn = ((gs - 1) % c.employee_count) + 1
|
|---|
| 432 | JOIN managers m
|
|---|
| 433 | ON m.rn = ((gs - 1) % c.manager_count) + 1
|
|---|
| 434 | JOIN businesses b
|
|---|
| 435 | ON b.rn = ((gs - 1) % c.business_count) + 1;
|
|---|
| 436 |
|
|---|
| 437 | COMMIT;
|
|---|
| 438 |
|
|---|
| 439 |
|
|---|
| 440 | -- ===============================================z======
|
|---|
| 441 | -- CHECK COUNTS
|
|---|
| 442 | -- =====================================================
|
|---|
| 443 |
|
|---|
| 444 | SELECT 'time_slot' AS table_name, COUNT(*) AS total_rows FROM time_slot
|
|---|
| 445 | UNION ALL
|
|---|
| 446 | SELECT 'appointment', COUNT(*) FROM appointment
|
|---|
| 447 | UNION ALL
|
|---|
| 448 | SELECT 'review', COUNT(*) FROM review; |
|---|