[{"data":1,"prerenderedAt":15137},["ShallowReactive",2],{"/post/sql-made-dead-simple-rdbms-guide":3,"related-/backend/sql-made-dead-simple-rdbms-guide":7266},{"id":4,"title":5,"author":6,"body":7,"date":7252,"description":7253,"draft":7254,"extension":7255,"guide":7256,"image":7257,"meta":7258,"navigation":1156,"path":7259,"seo":7260,"stem":7261,"tags":7262,"__hash__":7265},"blog/Backend/2.sql-made-dead-simple-rdbms-guide.md","SQL Made Dead Simple (The Only RDBMS Guide You Need)","Kashyap Kumar",{"type":8,"value":9,"toc":7203},"minimark",[10,15,36,51,56,63,66,94,105,118,121,125,129,134,201,205,212,226,231,294,305,309,314,325,363,367,374,379,389,392,475,479,492,562,582,586,671,675,686,692,696,699,712,718,722,729,740,746,750,757,776,829,833,844,1006,1025,1029,1046,1049,1098,1115,1184,1186,1190,1195,1327,1331,1335,1459,1463,1583,1587,1623,1637,1641,1644,1788,1791,1883,1886,1943,1966,1970,1979,2111,2115,2250,2252,2256,2260,2266,2651,2655,2810,2814,2824,2930,3065,3070,3076,3080,3100,3213,3226,3230,3241,3247,3260,3264,3278,3281,3301,3307,3311,3317,3413,3422,3426,3433,3511,3519,3523,3526,3530,3537,3597,3601,3608,3653,3657,3813,3817,3823,3991,3993,3997,4007,4080,4212,4217,4297,4304,4306,4310,4326,4330,4333,4339,4344,4359,4363,4367,4379,4465,4469,4484,4488,4504,4547,4563,4565,4569,4583,4586,4676,4681,4701,4706,4725,4743,4745,4749,4759,4763,4865,4871,4875,4881,4954,5035,5037,5041,5051,5279,5284,5310,5312,5316,5326,5330,5336,5747,5751,6139,6143,6799,6801,6805,6812,6968,6970,6974,6978,7087,7091,7154,7158,7183,7185,7193,7196,7199],[11,12,14],"h2",{"id":13},"_1-overview","1. Overview",[16,17,18,19,23,24,26,27,31,32,35],"p",{},"Every app you use daily — Instagram, Zomato, Google Pay, your college's exam\nportal — stores its data ",[20,21,22],"em",{},"somewhere",". That ",[20,25,22],{}," is almost always a\n",[28,29,30],"strong",{},"database",", and the most widely used kind of database in the world is the\n",[28,33,34],{},"Relational Database",".",[16,37,38,39,42,43,46,47,50],{},"A ",[28,40,41],{},"Relational Database Management System (RDBMS)"," is software that lets you\nstore, organize, and retrieve structured data using a language called ",[28,44,45],{},"SQL\n(Structured Query Language)",". SQL has been the industry standard since the\n1970s, and despite decades of new technology, it remains one of the most\nin-demand skills for any software engineer, data analyst, or backend developer.\nWhether you want to ",[28,48,49],{},"learn SQL from scratch"," or sharpen your existing skills,\nunderstanding RDBMS concepts deeply is a must.",[52,53,55],"h3",{"id":54},"real-world-example-an-e-commerce-platform","Real-World Example: An E-Commerce Platform",[16,57,58],{},[59,60],"img",{"alt":61,"src":62},"E-Commerce ER Diagram","/post-images/sql-made-dead-simple-rdbms-guide/ecommerce-er-diagram.png",[16,64,65],{},"Imagine you are building something like Amazon. You need to keep track of:",[67,68,69,76,82,88],"ul",{},[70,71,72,75],"li",{},[28,73,74],{},"Customers"," — who they are, their email, their address",[70,77,78,81],{},[28,79,80],{},"Products"," — names, prices, stock counts",[70,83,84,87],{},[28,85,86],{},"Orders"," — which customer bought which product, when, and for how much",[70,89,90,93],{},[28,91,92],{},"Payments"," — transaction IDs, payment method, status",[16,95,96,97,100,101,104],{},"All of this data is ",[20,98,99],{},"related"," to each other. An order belongs to a customer.\nAn order contains products. A payment belongs to an order. The ",[28,102,103],{},"relational\ndatabase"," model gives us a clean, structured, and efficient way to represent\nthese connections — and SQL gives us the power to query across all of them\ninstantly.",[106,107,108],"blockquote",{},[16,109,110,113,114,117],{},[28,111,112],{},"Why SQL still matters in 2026:"," Despite the rise of NoSQL databases like\nMongoDB, the vast majority of production systems still rely on relational\ndatabases (PostgreSQL, MySQL, SQLite, Oracle, SQL Server). When comparing\n",[28,115,116],{},"RDBMS vs NoSQL",", the relational model wins for structured, transactional\ndata. Understanding SQL deeply makes you a far more capable engineer,\nregardless of your specialization.",[119,120],"hr",{},[11,122,124],{"id":123},"_2-foundational-concepts","2. Foundational Concepts",[52,126,128],{"id":127},"_21-what-is-a-database","2.1 What is a Database?",[16,130,38,131,133],{},[28,132,30],{}," is an organized collection of structured data stored\nelectronically. Think of it like a digital filing cabinet — but one that can\nfind any document in milliseconds, even if there are a billion of them.",[135,136,137,153],"table",{},[138,139,140],"thead",{},[141,142,143,147,150],"tr",{},[144,145,146],"th",{},"Analogy",[144,148,149],{},"Real World",[144,151,152],{},"Database World",[154,155,156,168,179,190],"tbody",{},[141,157,158,162,165],{},[159,160,161],"td",{},"Filing Cabinet",[159,163,164],{},"Physical storage room",[159,166,167],{},"Database",[141,169,170,173,176],{},[159,171,172],{},"File Folder",[159,174,175],{},"A category of documents",[159,177,178],{},"Table",[141,180,181,184,187],{},[159,182,183],{},"One Document",[159,185,186],{},"A single record",[159,188,189],{},"Row (tuple)",[141,191,192,195,198],{},[159,193,194],{},"A field on the document",[159,196,197],{},"One piece of info",[159,199,200],{},"Column (attribute)",[52,202,204],{"id":203},"_22-what-is-an-rdbms","2.2 What is an RDBMS?",[16,206,207,208,211],{},"An ",[28,209,210],{},"RDBMS"," (Relational Database Management System) is the software engine\nthat manages the database. It handles:",[67,213,214,217,220,223],{},[70,215,216],{},"Storing data safely to disk",[70,218,219],{},"Letting multiple users read/write simultaneously without corruption",[70,221,222],{},"Enforcing rules (e.g., \"every order must have a valid customer\")",[70,224,225],{},"Executing SQL queries with high performance",[16,227,228],{},[28,229,230],{},"Popular RDBMS options:",[135,232,233,242],{},[138,234,235],{},[141,236,237,239],{},[144,238,210],{},[144,240,241],{},"Best Known For",[154,243,244,254,264,274,284],{},[141,245,246,251],{},[159,247,248],{},[28,249,250],{},"PostgreSQL",[159,252,253],{},"Open-source, feature-rich, industry favourite",[141,255,256,261],{},[159,257,258],{},[28,259,260],{},"MySQL / MariaDB",[159,262,263],{},"Web applications (LAMP stack)",[141,265,266,271],{},[159,267,268],{},[28,269,270],{},"SQLite",[159,272,273],{},"Lightweight, embedded (used in Android, iOS)",[141,275,276,281],{},[159,277,278],{},[28,279,280],{},"Oracle DB",[159,282,283],{},"Enterprise, banking systems",[141,285,286,291],{},[159,287,288],{},[28,289,290],{},"Microsoft SQL Server",[159,292,293],{},"Windows/enterprise ecosystems",[106,295,296],{},[16,297,298,299,301,302,304],{},"For learning, ",[28,300,270],{}," is recommended because it requires zero setup.\nFor production projects, use ",[28,303,250],{},". Both are covered in this\ncomplete SQL guide.",[52,306,308],{"id":307},"_23-tables-rows-and-columns","2.3 Tables, Rows, and Columns",[16,310,38,311,313],{},[28,312,135],{}," is the fundamental unit of storage in a relational database. It\nlooks exactly like a spreadsheet grid.",[315,316,321],"pre",{"className":317,"code":319,"language":320},[318],"language-text","Table: students\n+------------+------------------+-----+--------+\n| student_id | name             | age | grade  |\n+------------+------------------+-----+--------+\n|     1      | Priya Sharma     |  20 |  A     |\n|     2      | Rahul Das        |  21 |  B+    |\n|     3      | Aisha Khan       |  19 |  A+    |\n+------------+------------------+-----+--------+\n","text",[322,323,319],"code",{"__ignoreMap":324},"",[67,326,327,338,352],{},[70,328,329,330,333,334,337],{},"Each ",[28,331,332],{},"column"," represents one ",[20,335,336],{},"attribute"," or property (name, age, grade).",[70,339,329,340,343,344,347,348,351],{},[28,341,342],{},"row"," (also called a ",[28,345,346],{},"record"," or ",[28,349,350],{},"tuple",") represents one complete\nentity — in this case, one student.",[70,353,354,355,358,359,362],{},"The ",[28,356,357],{},"schema"," is the blueprint of the table — its column names and their\ndata types. Good ",[28,360,361],{},"database schema design"," is the cornerstone of a\nwell-structured application.",[52,364,366],{"id":365},"_24-keys-the-identity-system","2.4 Keys — The Identity System",[16,368,369,370,373],{},"This is one of the most important concepts in all of RDBMS. Understanding the\ndifference between a ",[28,371,372],{},"primary key vs foreign key"," is fundamental to relational\ndatabase design.",[375,376,378],"h4",{"id":377},"primary-key-pk","Primary Key (PK)",[16,380,38,381,384,385,388],{},[28,382,383],{},"Primary Key"," is a column (or combination of columns) that ",[28,386,387],{},"uniquely\nidentifies each row"," in a table. No two rows can have the same primary key\nvalue, and it can never be NULL.",[16,390,391],{},"Think of it like an Aadhaar number — every citizen has one, it's unique, and\nit never changes.",[315,393,397],{"className":394,"code":395,"language":396,"meta":324,"style":324},"language-sql shiki shiki-themes github-dark","-- student_id is the Primary Key\nCREATE TABLE students (\n    student_id INT PRIMARY KEY,\n    name       VARCHAR(100),\n    age        INT\n);\n","sql",[322,398,399,408,426,441,460,469],{"__ignoreMap":324},[400,401,404],"span",{"class":402,"line":403},"line",1,[400,405,407],{"class":406},"sAwPA","-- student_id is the Primary Key\n",[400,409,411,415,418,422],{"class":402,"line":410},2,[400,412,414],{"class":413},"snl16","CREATE",[400,416,417],{"class":413}," TABLE",[400,419,421],{"class":420},"svObZ"," students",[400,423,425],{"class":424},"s95oV"," (\n",[400,427,429,432,435,438],{"class":402,"line":428},3,[400,430,431],{"class":424},"    student_id ",[400,433,434],{"class":413},"INT",[400,436,437],{"class":413}," PRIMARY KEY",[400,439,440],{"class":424},",\n",[400,442,444,447,450,453,457],{"class":402,"line":443},4,[400,445,446],{"class":413},"    name",[400,448,449],{"class":413},"       VARCHAR",[400,451,452],{"class":424},"(",[400,454,456],{"class":455},"sDLfK","100",[400,458,459],{"class":424},"),\n",[400,461,463,466],{"class":402,"line":462},5,[400,464,465],{"class":424},"    age        ",[400,467,468],{"class":413},"INT\n",[400,470,472],{"class":402,"line":471},6,[400,473,474],{"class":424},");\n",[375,476,478],{"id":477},"foreign-key-fk","Foreign Key (FK)",[16,480,38,481,484,485,488,489,491],{},[28,482,483],{},"Foreign Key"," is a column in one table that ",[20,486,487],{},"references"," the Primary Key\nof another table. This is how relationships between tables are enforced.\nThe ",[28,490,372],{}," distinction is what makes the \"relational\"\nin RDBMS meaningful.",[315,493,495],{"className":394,"code":494,"language":396,"meta":324,"style":324},"-- course_id in enrollments REFERENCES the courses table\nCREATE TABLE enrollments (\n    enrollment_id INT PRIMARY KEY,\n    student_id    INT REFERENCES students(student_id),\n    course_id     INT REFERENCES courses(course_id),\n    enrolled_on   DATE\n);\n",[322,496,497,502,513,524,537,549,557],{"__ignoreMap":324},[400,498,499],{"class":402,"line":403},[400,500,501],{"class":406},"-- course_id in enrollments REFERENCES the courses table\n",[400,503,504,506,508,511],{"class":402,"line":410},[400,505,414],{"class":413},[400,507,417],{"class":413},[400,509,510],{"class":420}," enrollments",[400,512,425],{"class":424},[400,514,515,518,520,522],{"class":402,"line":428},[400,516,517],{"class":424},"    enrollment_id ",[400,519,434],{"class":413},[400,521,437],{"class":413},[400,523,440],{"class":424},[400,525,526,529,531,534],{"class":402,"line":443},[400,527,528],{"class":424},"    student_id    ",[400,530,434],{"class":413},[400,532,533],{"class":413}," REFERENCES",[400,535,536],{"class":424}," students(student_id),\n",[400,538,539,542,544,546],{"class":402,"line":462},[400,540,541],{"class":424},"    course_id     ",[400,543,434],{"class":413},[400,545,533],{"class":413},[400,547,548],{"class":424}," courses(course_id),\n",[400,550,551,554],{"class":402,"line":471},[400,552,553],{"class":424},"    enrolled_on   ",[400,555,556],{"class":413},"DATE\n",[400,558,560],{"class":402,"line":559},7,[400,561,474],{"class":424},[106,563,564],{},[16,565,566,569,570,573,574,577,578,581],{},[28,567,568],{},"Analogy:"," If ",[322,571,572],{},"students"," is a list of employees and ",[322,575,576],{},"enrollments"," is a\nlist of projects, then the foreign key is like writing an employee's badge\nnumber on the project sheet — it ",[20,579,580],{},"links"," back to the actual person.",[375,583,585],{"id":584},"candidate-key-composite-key-surrogate-key","Candidate Key, Composite Key, Surrogate Key",[135,587,588,601],{},[138,589,590],{},[141,591,592,595,598],{},[144,593,594],{},"Key Type",[144,596,597],{},"Definition",[144,599,600],{},"Example",[154,602,603,625,641,656],{},[141,604,605,610,617],{},[159,606,607],{},[28,608,609],{},"Candidate Key",[159,611,612,613,616],{},"Any column that ",[20,614,615],{},"could"," be a PK",[159,618,619,347,622],{},[322,620,621],{},"email",[322,623,624],{},"student_id",[141,626,627,632,635],{},[159,628,629],{},[28,630,631],{},"Composite Key",[159,633,634],{},"PK made of two or more columns",[159,636,637,640],{},[322,638,639],{},"(student_id, course_id)"," together",[141,642,643,648,651],{},[159,644,645],{},[28,646,647],{},"Surrogate Key",[159,649,650],{},"An artificial PK (like an auto-increment ID)",[159,652,653],{},[322,654,655],{},"id SERIAL",[141,657,658,663,666],{},[159,659,660],{},[28,661,662],{},"Natural Key",[159,664,665],{},"A PK from real-world data",[159,667,668],{},[322,669,670],{},"PAN_number",[52,672,674],{"id":673},"_25-relationships-between-tables","2.5 Relationships Between Tables",[16,676,677,678,681,682,685],{},"The \"relational\" in RDBMS refers to the ",[20,679,680],{},"relationships"," between tables, which is a central part of ",[28,683,684],{},"entity relationship"," modelling. There are three fundamental types:",[16,687,688],{},[59,689],{"alt":690,"src":691},"Database Relationship Types","/post-images/sql-made-dead-simple-rdbms-guide/database-relationship-types.png",[375,693,695],{"id":694},"one-to-one-11","One-to-One (1:1)",[16,697,698],{},"One row in Table A corresponds to exactly one row in Table B.",[16,700,701,704,705,708,709,35],{},[28,702,703],{},"Example:"," One ",[322,706,707],{},"user"," has exactly one ",[322,710,711],{},"user_profile",[315,713,716],{"className":714,"code":715,"language":320},[318],"users             user_profiles\n+----+--------+   +----+---------+-----------+\n| id | name   |   | id | user_id | bio       |\n+----+--------+   +----+---------+-----------+\n|  1 | Rahul  |   |  1 |    1    | Developer |\n|  2 | Priya  |   |  2 |    2    | Designer  |\n+----+--------+   +----+---------+-----------+\n",[322,717,715],{"__ignoreMap":324},[375,719,721],{"id":720},"one-to-many-1n-most-common","One-to-Many (1:N) ← Most Common",[16,723,724,725,728],{},"One row in Table A corresponds to ",[20,726,727],{},"many"," rows in Table B.",[16,730,731,704,733,736,737,35],{},[28,732,703],{},[322,734,735],{},"customer"," can place many ",[322,738,739],{},"orders",[315,741,744],{"className":742,"code":743,"language":320},[318],"customers                orders\n+----+--------+          +----+-------------+----------+\n| id | name   |          | id | customer_id | amount   |\n+----+--------+          +----+-------------+----------+\n|  1 | Rahul  |          |  1 |      1      | ₹500     |\n|  2 | Priya  |          |  2 |      1      | ₹1200    |\n+----+--------+          |  3 |      2      | ₹800     |\n                         +----+-------------+----------+\n",[322,745,743],{"__ignoreMap":324},[375,747,749],{"id":748},"many-to-many-mn","Many-to-Many (M:N)",[16,751,752,753,756],{},"Many rows in Table A correspond to many rows in Table B. This requires a\n",[28,754,755],{},"junction table"," (also called a bridge or pivot table) in the middle.",[16,758,759,761,762,765,766,769,770,773,774,35],{},[28,760,703],{}," A ",[322,763,764],{},"student"," can enroll in many ",[322,767,768],{},"courses",", and a ",[322,771,772],{},"course"," can have many ",[322,775,572],{},[315,777,779],{"className":394,"code":778,"language":396,"meta":324,"style":324},"CREATE TABLE enrollments (\n    student_id INT REFERENCES students(id),\n    course_id  INT REFERENCES courses(id),\n    PRIMARY KEY (student_id, course_id)   -- Composite PK\n);\n",[322,780,781,791,802,814,825],{"__ignoreMap":324},[400,782,783,785,787,789],{"class":402,"line":403},[400,784,414],{"class":413},[400,786,417],{"class":413},[400,788,510],{"class":420},[400,790,425],{"class":424},[400,792,793,795,797,799],{"class":402,"line":410},[400,794,431],{"class":424},[400,796,434],{"class":413},[400,798,533],{"class":413},[400,800,801],{"class":424}," students(id),\n",[400,803,804,807,809,811],{"class":402,"line":428},[400,805,806],{"class":424},"    course_id  ",[400,808,434],{"class":413},[400,810,533],{"class":413},[400,812,813],{"class":424}," courses(id),\n",[400,815,816,819,822],{"class":402,"line":443},[400,817,818],{"class":413},"    PRIMARY KEY",[400,820,821],{"class":424}," (student_id, course_id)   ",[400,823,824],{"class":406},"-- Composite PK\n",[400,826,827],{"class":402,"line":462},[400,828,474],{"class":424},[52,830,832],{"id":831},"_26-data-types","2.6 Data Types",[16,834,835,836,839,840,843],{},"Every column has a ",[28,837,838],{},"data type"," that restricts what kind of data it can hold.\nChoosing the right ",[28,841,842],{},"data types in SQL"," is crucial for data integrity and\nstorage efficiency.",[135,845,846,859],{},[138,847,848],{},[141,849,850,853,856],{},[144,851,852],{},"Category",[144,854,855],{},"Common Types",[144,857,858],{},"Example Values",[154,860,861,890,916,942,962,988],{},[141,862,863,868,879],{},[159,864,865],{},[28,866,867],{},"Integer",[159,869,870,872,873,872,876],{},[322,871,434],{},", ",[322,874,875],{},"BIGINT",[322,877,878],{},"SMALLINT",[159,880,881,872,884,872,887],{},[322,882,883],{},"1",[322,885,886],{},"99",[322,888,889],{},"1000000",[141,891,892,897,908],{},[159,893,894],{},[28,895,896],{},"Decimal",[159,898,899,872,902,872,905],{},[322,900,901],{},"DECIMAL(p,s)",[322,903,904],{},"NUMERIC",[322,906,907],{},"FLOAT",[159,909,910,872,913],{},[322,911,912],{},"9.99",[322,914,915],{},"3.14159",[141,917,918,923,934],{},[159,919,920],{},[28,921,922],{},"Text",[159,924,925,872,928,872,931],{},[322,926,927],{},"VARCHAR(n)",[322,929,930],{},"TEXT",[322,932,933],{},"CHAR(n)",[159,935,936,872,939],{},[322,937,938],{},"'Rahul'",[322,940,941],{},"'Hello World'",[141,943,944,949,954],{},[159,945,946],{},[28,947,948],{},"Boolean",[159,950,951],{},[322,952,953],{},"BOOLEAN",[159,955,956,872,959],{},[322,957,958],{},"TRUE",[322,960,961],{},"FALSE",[141,963,964,969,980],{},[159,965,966],{},[28,967,968],{},"Date/Time",[159,970,971,872,974,872,977],{},[322,972,973],{},"DATE",[322,975,976],{},"TIME",[322,978,979],{},"TIMESTAMP",[159,981,982,872,985],{},[322,983,984],{},"2024-01-15",[322,986,987],{},"09:30:00",[141,989,990,995,1003],{},[159,991,992],{},[28,993,994],{},"Binary",[159,996,997,872,1000],{},[322,998,999],{},"BYTEA",[322,1001,1002],{},"BLOB",[159,1004,1005],{},"Image files, PDFs",[106,1007,1008],{},[16,1009,1010,1018,1019,1021,1022,1024],{},[28,1011,1012,1014,1015,1017],{},[322,1013,927],{}," vs ",[322,1016,930],{},":"," Use ",[322,1020,927],{}," when you know the max length\n(e.g., a phone number is always ≤15 chars). Use ",[322,1023,930],{}," for open-ended\nstrings like comments or descriptions.",[52,1026,1028],{"id":1027},"_27-null-the-absence-of-a-value","2.7 NULL — The Absence of a Value",[16,1030,1031,1034,1035,1038,1039,1042,1043,1045],{},[322,1032,1033],{},"NULL"," in SQL means ",[28,1036,1037],{},"the value is unknown or does not exist",". It is ",[20,1040,1041],{},"not","\nzero, it is ",[20,1044,1041],{}," an empty string — it is the complete absence of a value.",[16,1047,1048],{},"This is a frequent source of confusion for beginners learning SQL.",[315,1050,1052],{"className":394,"code":1051,"language":396,"meta":324,"style":324},"-- These are all DIFFERENT:\nage = 0        -- The person is 0 years old\nage = ''       -- Invalid for INT; for text, it's an empty string\nage = NULL     -- We simply don't know the person's age\n",[322,1053,1054,1059,1073,1086],{"__ignoreMap":324},[400,1055,1056],{"class":402,"line":403},[400,1057,1058],{"class":406},"-- These are all DIFFERENT:\n",[400,1060,1061,1064,1067,1070],{"class":402,"line":410},[400,1062,1063],{"class":424},"age ",[400,1065,1066],{"class":413},"=",[400,1068,1069],{"class":455}," 0",[400,1071,1072],{"class":406},"        -- The person is 0 years old\n",[400,1074,1075,1077,1079,1083],{"class":402,"line":428},[400,1076,1063],{"class":424},[400,1078,1066],{"class":413},[400,1080,1082],{"class":1081},"sU2Wk"," ''",[400,1084,1085],{"class":406},"       -- Invalid for INT; for text, it's an empty string\n",[400,1087,1088,1090,1092,1095],{"class":402,"line":443},[400,1089,1063],{"class":424},[400,1091,1066],{"class":413},[400,1093,1094],{"class":413}," NULL",[400,1096,1097],{"class":406},"     -- We simply don't know the person's age\n",[106,1099,1100],{},[16,1101,1102,1105,1106,1108,1109,347,1112,35],{},[28,1103,1104],{},"Critical Rule:"," You cannot compare NULL using ",[322,1107,1066],{},". You must use\n",[322,1110,1111],{},"IS NULL",[322,1113,1114],{},"IS NOT NULL",[315,1116,1118],{"className":394,"code":1117,"language":396,"meta":324,"style":324},"-- WRONG — this will never return results even if age is NULL\nSELECT * FROM students WHERE age = NULL;\n\n-- CORRECT\nSELECT * FROM students WHERE age IS NULL;\n",[322,1119,1120,1125,1152,1158,1163],{"__ignoreMap":324},[400,1121,1122],{"class":402,"line":403},[400,1123,1124],{"class":406},"-- WRONG — this will never return results even if age is NULL\n",[400,1126,1127,1130,1133,1136,1139,1142,1145,1147,1149],{"class":402,"line":410},[400,1128,1129],{"class":413},"SELECT",[400,1131,1132],{"class":413}," *",[400,1134,1135],{"class":413}," FROM",[400,1137,1138],{"class":424}," students ",[400,1140,1141],{"class":413},"WHERE",[400,1143,1144],{"class":424}," age ",[400,1146,1066],{"class":413},[400,1148,1094],{"class":413},[400,1150,1151],{"class":424},";\n",[400,1153,1154],{"class":402,"line":428},[400,1155,1157],{"emptyLinePlaceholder":1156},true,"\n",[400,1159,1160],{"class":402,"line":443},[400,1161,1162],{"class":406},"-- CORRECT\n",[400,1164,1165,1167,1169,1171,1173,1175,1177,1180,1182],{"class":402,"line":462},[400,1166,1129],{"class":413},[400,1168,1132],{"class":413},[400,1170,1135],{"class":413},[400,1172,1138],{"class":424},[400,1174,1141],{"class":413},[400,1176,1144],{"class":424},[400,1178,1179],{"class":413},"IS",[400,1181,1094],{"class":413},[400,1183,1151],{"class":424},[119,1185],{},[11,1187,1189],{"id":1188},"_3-sql-the-language-of-databases","3. SQL — The Language of Databases",[16,1191,1192,1193,1017],{},"SQL (pronounced \"sequel\" or \"S-Q-L\") is divided into sub-languages based on\nwhat they do. This is essential knowledge when you ",[28,1194,49],{},[135,1196,1197,1213],{},[138,1198,1199],{},[141,1200,1201,1204,1207,1210],{},[144,1202,1203],{},"Sub-language",[144,1205,1206],{},"Full Name",[144,1208,1209],{},"Purpose",[144,1211,1212],{},"Commands",[154,1214,1215,1241,1265,1282,1303],{},[141,1216,1217,1222,1225,1228],{},[159,1218,1219],{},[28,1220,1221],{},"DDL",[159,1223,1224],{},"Data Definition Language",[159,1226,1227],{},"Define/modify structure",[159,1229,1230,872,1232,872,1235,872,1238],{},[322,1231,414],{},[322,1233,1234],{},"ALTER",[322,1236,1237],{},"DROP",[322,1239,1240],{},"TRUNCATE",[141,1242,1243,1248,1251,1254],{},[159,1244,1245],{},[28,1246,1247],{},"DML",[159,1249,1250],{},"Data Manipulation Language",[159,1252,1253],{},"Add/change/delete data",[159,1255,1256,872,1259,872,1262],{},[322,1257,1258],{},"INSERT",[322,1260,1261],{},"UPDATE",[322,1263,1264],{},"DELETE",[141,1266,1267,1272,1275,1278],{},[159,1268,1269],{},[28,1270,1271],{},"DQL",[159,1273,1274],{},"Data Query Language",[159,1276,1277],{},"Read/fetch data",[159,1279,1280],{},[322,1281,1129],{},[141,1283,1284,1289,1292,1295],{},[159,1285,1286],{},[28,1287,1288],{},"DCL",[159,1290,1291],{},"Data Control Language",[159,1293,1294],{},"Manage permissions",[159,1296,1297,872,1300],{},[322,1298,1299],{},"GRANT",[322,1301,1302],{},"REVOKE",[141,1304,1305,1310,1313,1316],{},[159,1306,1307],{},[28,1308,1309],{},"TCL",[159,1311,1312],{},"Transaction Control Language",[159,1314,1315],{},"Manage transactions",[159,1317,1318,872,1321,872,1324],{},[322,1319,1320],{},"COMMIT",[322,1322,1323],{},"ROLLBACK",[322,1325,1326],{},"SAVEPOINT",[52,1328,1330],{"id":1329},"_31-ddl-defining-structure","3.1 DDL — Defining Structure",[375,1332,1334],{"id":1333},"create-table","CREATE TABLE",[315,1336,1338],{"className":394,"code":1337,"language":396,"meta":324,"style":324},"CREATE TABLE products (\n    product_id   SERIAL PRIMARY KEY,       -- auto-incrementing ID\n    name         VARCHAR(200) NOT NULL,\n    description  TEXT,\n    price        DECIMAL(10, 2) NOT NULL,  -- up to 10 digits, 2 decimal places\n    stock_count  INT DEFAULT 0,\n    created_at   TIMESTAMP DEFAULT NOW()\n);\n",[322,1339,1340,1351,1367,1387,1397,1425,1439,1454],{"__ignoreMap":324},[400,1341,1342,1344,1346,1349],{"class":402,"line":403},[400,1343,414],{"class":413},[400,1345,417],{"class":413},[400,1347,1348],{"class":420}," products",[400,1350,425],{"class":424},[400,1352,1353,1356,1359,1361,1364],{"class":402,"line":410},[400,1354,1355],{"class":424},"    product_id   ",[400,1357,1358],{"class":413},"SERIAL",[400,1360,437],{"class":413},[400,1362,1363],{"class":424},",       ",[400,1365,1366],{"class":406},"-- auto-incrementing ID\n",[400,1368,1369,1371,1374,1376,1379,1382,1385],{"class":402,"line":428},[400,1370,446],{"class":413},[400,1372,1373],{"class":413},"         VARCHAR",[400,1375,452],{"class":424},[400,1377,1378],{"class":455},"200",[400,1380,1381],{"class":424},") ",[400,1383,1384],{"class":413},"NOT NULL",[400,1386,440],{"class":424},[400,1388,1389,1392,1395],{"class":402,"line":443},[400,1390,1391],{"class":413},"    description",[400,1393,1394],{"class":413},"  TEXT",[400,1396,440],{"class":424},[400,1398,1399,1402,1405,1407,1410,1412,1415,1417,1419,1422],{"class":402,"line":462},[400,1400,1401],{"class":424},"    price        ",[400,1403,1404],{"class":413},"DECIMAL",[400,1406,452],{"class":424},[400,1408,1409],{"class":455},"10",[400,1411,872],{"class":424},[400,1413,1414],{"class":455},"2",[400,1416,1381],{"class":424},[400,1418,1384],{"class":413},[400,1420,1421],{"class":424},",  ",[400,1423,1424],{"class":406},"-- up to 10 digits, 2 decimal places\n",[400,1426,1427,1430,1432,1435,1437],{"class":402,"line":471},[400,1428,1429],{"class":424},"    stock_count  ",[400,1431,434],{"class":413},[400,1433,1434],{"class":413}," DEFAULT",[400,1436,1069],{"class":455},[400,1438,440],{"class":424},[400,1440,1441,1444,1446,1448,1451],{"class":402,"line":559},[400,1442,1443],{"class":424},"    created_at   ",[400,1445,979],{"class":413},[400,1447,1434],{"class":413},[400,1449,1450],{"class":413}," NOW",[400,1452,1453],{"class":424},"()\n",[400,1455,1457],{"class":402,"line":1456},8,[400,1458,474],{"class":424},[375,1460,1462],{"id":1461},"alter-table","ALTER TABLE",[315,1464,1466],{"className":394,"code":1465,"language":396,"meta":324,"style":324},"-- Add a new column\nALTER TABLE products ADD COLUMN category VARCHAR(100);\n\n-- Change a column's data type\nALTER TABLE products ALTER COLUMN name TYPE TEXT;\n\n-- Rename a column\nALTER TABLE products RENAME COLUMN stock_count TO quantity;\n\n-- Drop a column\nALTER TABLE products DROP COLUMN description;\n",[322,1467,1468,1473,1497,1501,1506,1530,1534,1539,1554,1559,1565],{"__ignoreMap":324},[400,1469,1470],{"class":402,"line":403},[400,1471,1472],{"class":406},"-- Add a new column\n",[400,1474,1475,1477,1479,1482,1485,1488,1491,1493,1495],{"class":402,"line":410},[400,1476,1234],{"class":413},[400,1478,417],{"class":413},[400,1480,1481],{"class":424}," products ",[400,1483,1484],{"class":413},"ADD",[400,1486,1487],{"class":424}," COLUMN category ",[400,1489,1490],{"class":413},"VARCHAR",[400,1492,452],{"class":424},[400,1494,456],{"class":455},[400,1496,474],{"class":424},[400,1498,1499],{"class":402,"line":428},[400,1500,1157],{"emptyLinePlaceholder":1156},[400,1502,1503],{"class":402,"line":443},[400,1504,1505],{"class":406},"-- Change a column's data type\n",[400,1507,1508,1510,1512,1514,1516,1519,1522,1525,1528],{"class":402,"line":462},[400,1509,1234],{"class":413},[400,1511,417],{"class":413},[400,1513,1481],{"class":424},[400,1515,1234],{"class":413},[400,1517,1518],{"class":424}," COLUMN ",[400,1520,1521],{"class":413},"name",[400,1523,1524],{"class":413}," TYPE",[400,1526,1527],{"class":413}," TEXT",[400,1529,1151],{"class":424},[400,1531,1532],{"class":402,"line":471},[400,1533,1157],{"emptyLinePlaceholder":1156},[400,1535,1536],{"class":402,"line":559},[400,1537,1538],{"class":406},"-- Rename a column\n",[400,1540,1541,1543,1545,1548,1551],{"class":402,"line":1456},[400,1542,1234],{"class":413},[400,1544,417],{"class":413},[400,1546,1547],{"class":424}," products RENAME COLUMN stock_count ",[400,1549,1550],{"class":413},"TO",[400,1552,1553],{"class":424}," quantity;\n",[400,1555,1557],{"class":402,"line":1556},9,[400,1558,1157],{"emptyLinePlaceholder":1156},[400,1560,1562],{"class":402,"line":1561},10,[400,1563,1564],{"class":406},"-- Drop a column\n",[400,1566,1568,1570,1572,1574,1576,1578,1581],{"class":402,"line":1567},11,[400,1569,1234],{"class":413},[400,1571,417],{"class":413},[400,1573,1481],{"class":424},[400,1575,1237],{"class":413},[400,1577,1518],{"class":424},[400,1579,1580],{"class":413},"description",[400,1582,1151],{"class":424},[375,1584,1586],{"id":1585},"drop-truncate","DROP & TRUNCATE",[315,1588,1590],{"className":394,"code":1589,"language":396,"meta":324,"style":324},"-- Deletes the entire table structure AND all data (irreversible)\nDROP TABLE products;\n\n-- Deletes ALL data inside the table, but keeps the structure\nTRUNCATE TABLE products;\n",[322,1591,1592,1597,1606,1610,1615],{"__ignoreMap":324},[400,1593,1594],{"class":402,"line":403},[400,1595,1596],{"class":406},"-- Deletes the entire table structure AND all data (irreversible)\n",[400,1598,1599,1601,1603],{"class":402,"line":410},[400,1600,1237],{"class":413},[400,1602,417],{"class":413},[400,1604,1605],{"class":424}," products;\n",[400,1607,1608],{"class":402,"line":428},[400,1609,1157],{"emptyLinePlaceholder":1156},[400,1611,1612],{"class":402,"line":443},[400,1613,1614],{"class":406},"-- Deletes ALL data inside the table, but keeps the structure\n",[400,1616,1617,1619,1621],{"class":402,"line":462},[400,1618,1240],{"class":413},[400,1620,417],{"class":413},[400,1622,1605],{"class":424},[106,1624,1625],{},[16,1626,1627,1630,1631,1633,1634,1636],{},[28,1628,1629],{},"Warning:"," ",[322,1632,1237],{}," and ",[322,1635,1240],{}," are dangerous. Always double-check before\nrunning them, especially in production.",[52,1638,1640],{"id":1639},"_32-dml-manipulating-data","3.2 DML — Manipulating Data",[375,1642,1258],{"id":1643},"insert",[315,1645,1647],{"className":394,"code":1646,"language":396,"meta":324,"style":324},"-- Insert one row\nINSERT INTO products (name, price, stock_count)\nVALUES ('Mechanical Keyboard', 3499.00, 50);\n\n-- Insert multiple rows at once\nINSERT INTO products (name, price, stock_count) VALUES\n    ('Wireless Mouse', 999.00, 120),\n    ('USB-C Hub', 1499.00, 75),\n    ('Laptop Stand', 2199.00, 30);\n",[322,1648,1649,1654,1667,1695,1699,1704,1718,1742,1765],{"__ignoreMap":324},[400,1650,1651],{"class":402,"line":403},[400,1652,1653],{"class":406},"-- Insert one row\n",[400,1655,1656,1659,1662,1664],{"class":402,"line":410},[400,1657,1658],{"class":413},"INSERT INTO",[400,1660,1661],{"class":424}," products (",[400,1663,1521],{"class":413},[400,1665,1666],{"class":424},", price, stock_count)\n",[400,1668,1669,1672,1675,1678,1680,1683,1685,1688,1690,1693],{"class":402,"line":428},[400,1670,1671],{"class":413},"VALUES",[400,1673,1674],{"class":424}," (",[400,1676,1677],{"class":1081},"'Mechanical Keyboard'",[400,1679,872],{"class":424},[400,1681,1682],{"class":455},"3499",[400,1684,35],{"class":424},[400,1686,1687],{"class":455},"00",[400,1689,872],{"class":424},[400,1691,1692],{"class":455},"50",[400,1694,474],{"class":424},[400,1696,1697],{"class":402,"line":443},[400,1698,1157],{"emptyLinePlaceholder":1156},[400,1700,1701],{"class":402,"line":462},[400,1702,1703],{"class":406},"-- Insert multiple rows at once\n",[400,1705,1706,1708,1710,1712,1715],{"class":402,"line":471},[400,1707,1658],{"class":413},[400,1709,1661],{"class":424},[400,1711,1521],{"class":413},[400,1713,1714],{"class":424},", price, stock_count) ",[400,1716,1717],{"class":413},"VALUES\n",[400,1719,1720,1723,1726,1728,1731,1733,1735,1737,1740],{"class":402,"line":559},[400,1721,1722],{"class":424},"    (",[400,1724,1725],{"class":1081},"'Wireless Mouse'",[400,1727,872],{"class":424},[400,1729,1730],{"class":455},"999",[400,1732,35],{"class":424},[400,1734,1687],{"class":455},[400,1736,872],{"class":424},[400,1738,1739],{"class":455},"120",[400,1741,459],{"class":424},[400,1743,1744,1746,1749,1751,1754,1756,1758,1760,1763],{"class":402,"line":1456},[400,1745,1722],{"class":424},[400,1747,1748],{"class":1081},"'USB-C Hub'",[400,1750,872],{"class":424},[400,1752,1753],{"class":455},"1499",[400,1755,35],{"class":424},[400,1757,1687],{"class":455},[400,1759,872],{"class":424},[400,1761,1762],{"class":455},"75",[400,1764,459],{"class":424},[400,1766,1767,1769,1772,1774,1777,1779,1781,1783,1786],{"class":402,"line":1556},[400,1768,1722],{"class":424},[400,1770,1771],{"class":1081},"'Laptop Stand'",[400,1773,872],{"class":424},[400,1775,1776],{"class":455},"2199",[400,1778,35],{"class":424},[400,1780,1687],{"class":455},[400,1782,872],{"class":424},[400,1784,1785],{"class":455},"30",[400,1787,474],{"class":424},[375,1789,1261],{"id":1790},"update",[315,1792,1794],{"className":394,"code":1793,"language":396,"meta":324,"style":324},"-- ALWAYS use WHERE with UPDATE, or you'll update every single row!\nUPDATE products\nSET price = 3199.00, stock_count = 45\nWHERE product_id = 1;\n\n-- Increase all prices by 10%\nUPDATE products\nSET price = price * 1.10;\n",[322,1795,1796,1801,1808,1833,1847,1851,1856,1862],{"__ignoreMap":324},[400,1797,1798],{"class":402,"line":403},[400,1799,1800],{"class":406},"-- ALWAYS use WHERE with UPDATE, or you'll update every single row!\n",[400,1802,1803,1805],{"class":402,"line":410},[400,1804,1261],{"class":413},[400,1806,1807],{"class":424}," products\n",[400,1809,1810,1813,1816,1818,1821,1823,1825,1828,1830],{"class":402,"line":428},[400,1811,1812],{"class":413},"SET",[400,1814,1815],{"class":424}," price ",[400,1817,1066],{"class":413},[400,1819,1820],{"class":455}," 3199",[400,1822,35],{"class":424},[400,1824,1687],{"class":455},[400,1826,1827],{"class":424},", stock_count ",[400,1829,1066],{"class":413},[400,1831,1832],{"class":455}," 45\n",[400,1834,1835,1837,1840,1842,1845],{"class":402,"line":443},[400,1836,1141],{"class":413},[400,1838,1839],{"class":424}," product_id ",[400,1841,1066],{"class":413},[400,1843,1844],{"class":455}," 1",[400,1846,1151],{"class":424},[400,1848,1849],{"class":402,"line":462},[400,1850,1157],{"emptyLinePlaceholder":1156},[400,1852,1853],{"class":402,"line":471},[400,1854,1855],{"class":406},"-- Increase all prices by 10%\n",[400,1857,1858,1860],{"class":402,"line":559},[400,1859,1261],{"class":413},[400,1861,1807],{"class":424},[400,1863,1864,1866,1868,1870,1872,1875,1877,1879,1881],{"class":402,"line":1456},[400,1865,1812],{"class":413},[400,1867,1815],{"class":424},[400,1869,1066],{"class":413},[400,1871,1815],{"class":424},[400,1873,1874],{"class":413},"*",[400,1876,1844],{"class":455},[400,1878,35],{"class":424},[400,1880,1409],{"class":455},[400,1882,1151],{"class":424},[375,1884,1264],{"id":1885},"delete",[315,1887,1889],{"className":394,"code":1888,"language":396,"meta":324,"style":324},"-- Delete a specific row\nDELETE FROM products WHERE product_id = 3;\n\n-- Delete all products that are out of stock\nDELETE FROM products WHERE stock_count = 0;\n",[322,1890,1891,1896,1915,1919,1924],{"__ignoreMap":324},[400,1892,1893],{"class":402,"line":403},[400,1894,1895],{"class":406},"-- Delete a specific row\n",[400,1897,1898,1900,1902,1904,1906,1908,1910,1913],{"class":402,"line":410},[400,1899,1264],{"class":413},[400,1901,1135],{"class":413},[400,1903,1481],{"class":424},[400,1905,1141],{"class":413},[400,1907,1839],{"class":424},[400,1909,1066],{"class":413},[400,1911,1912],{"class":455}," 3",[400,1914,1151],{"class":424},[400,1916,1917],{"class":402,"line":428},[400,1918,1157],{"emptyLinePlaceholder":1156},[400,1920,1921],{"class":402,"line":443},[400,1922,1923],{"class":406},"-- Delete all products that are out of stock\n",[400,1925,1926,1928,1930,1932,1934,1937,1939,1941],{"class":402,"line":462},[400,1927,1264],{"class":413},[400,1929,1135],{"class":413},[400,1931,1481],{"class":424},[400,1933,1141],{"class":413},[400,1935,1936],{"class":424}," stock_count ",[400,1938,1066],{"class":413},[400,1940,1069],{"class":455},[400,1942,1151],{"class":424},[106,1944,1945],{},[16,1946,1947,1950,1951,1953,1954,347,1956,1958,1959,1961,1962,1965],{},[28,1948,1949],{},"Golden Rule of DML:"," Always write your ",[322,1952,1141],{}," clause first in your head\nbefore writing ",[322,1955,1261],{},[322,1957,1264],{},". A missing ",[322,1960,1141],{}," clause affects\n",[20,1963,1964],{},"every row"," in the table.",[52,1967,1969],{"id":1968},"_33-dql-querying-data","3.3 DQL — Querying Data",[16,1971,1972,1974,1975,1978],{},[322,1973,1129],{}," is the most important and most used SQL command. Knowing ",[28,1976,1977],{},"how to\nwrite SQL queries step by step"," starts here.",[315,1980,1982],{"className":394,"code":1981,"language":396,"meta":324,"style":324},"-- Basic syntax\nSELECT column1, column2, ...\nFROM   table_name\nWHERE  condition\nORDER BY column ASC|DESC\nLIMIT  n;\n\n-- Select all columns (use sparingly in production)\nSELECT * FROM products;\n\n-- Select specific columns with an alias\nSELECT\n    name        AS product_name,\n    price       AS selling_price,\n    stock_count AS qty_available\nFROM products;\n",[322,1983,1984,1989,1996,2004,2011,2028,2036,2040,2045,2055,2059,2064,2070,2081,2093,2104],{"__ignoreMap":324},[400,1985,1986],{"class":402,"line":403},[400,1987,1988],{"class":406},"-- Basic syntax\n",[400,1990,1991,1993],{"class":402,"line":410},[400,1992,1129],{"class":413},[400,1994,1995],{"class":424}," column1, column2, ...\n",[400,1997,1998,2001],{"class":402,"line":428},[400,1999,2000],{"class":413},"FROM",[400,2002,2003],{"class":424},"   table_name\n",[400,2005,2006,2008],{"class":402,"line":443},[400,2007,1141],{"class":413},[400,2009,2010],{"class":424},"  condition\n",[400,2012,2013,2016,2019,2022,2025],{"class":402,"line":462},[400,2014,2015],{"class":413},"ORDER BY",[400,2017,2018],{"class":424}," column ",[400,2020,2021],{"class":413},"ASC",[400,2023,2024],{"class":424},"|",[400,2026,2027],{"class":413},"DESC\n",[400,2029,2030,2033],{"class":402,"line":471},[400,2031,2032],{"class":413},"LIMIT",[400,2034,2035],{"class":424},"  n;\n",[400,2037,2038],{"class":402,"line":559},[400,2039,1157],{"emptyLinePlaceholder":1156},[400,2041,2042],{"class":402,"line":1456},[400,2043,2044],{"class":406},"-- Select all columns (use sparingly in production)\n",[400,2046,2047,2049,2051,2053],{"class":402,"line":1556},[400,2048,1129],{"class":413},[400,2050,1132],{"class":413},[400,2052,1135],{"class":413},[400,2054,1605],{"class":424},[400,2056,2057],{"class":402,"line":1561},[400,2058,1157],{"emptyLinePlaceholder":1156},[400,2060,2061],{"class":402,"line":1567},[400,2062,2063],{"class":406},"-- Select specific columns with an alias\n",[400,2065,2067],{"class":402,"line":2066},12,[400,2068,2069],{"class":413},"SELECT\n",[400,2071,2073,2075,2078],{"class":402,"line":2072},13,[400,2074,446],{"class":413},[400,2076,2077],{"class":413},"        AS",[400,2079,2080],{"class":424}," product_name,\n",[400,2082,2084,2087,2090],{"class":402,"line":2083},14,[400,2085,2086],{"class":424},"    price       ",[400,2088,2089],{"class":413},"AS",[400,2091,2092],{"class":424}," selling_price,\n",[400,2094,2096,2099,2101],{"class":402,"line":2095},15,[400,2097,2098],{"class":424},"    stock_count ",[400,2100,2089],{"class":413},[400,2102,2103],{"class":424}," qty_available\n",[400,2105,2107,2109],{"class":402,"line":2106},16,[400,2108,2000],{"class":413},[400,2110,1605],{"class":424},[52,2112,2114],{"id":2113},"_34-dcl-tcl-control-transactions","3.4 DCL & TCL — Control & Transactions",[315,2116,2118],{"className":394,"code":2117,"language":396,"meta":324,"style":324},"-- DCL: Grant read access to a user\nGRANT SELECT ON products TO 'readonly_user';\n\n-- TCL: Transaction block\nBEGIN;\n    UPDATE accounts SET balance = balance - 500 WHERE id = 1;\n    UPDATE accounts SET balance = balance + 500 WHERE id = 2;\nCOMMIT;  -- Make it permanent\n\n-- If something goes wrong, undo everything\nROLLBACK;\n",[322,2119,2120,2125,2144,2148,2153,2160,2195,2225,2235,2239,2244],{"__ignoreMap":324},[400,2121,2122],{"class":402,"line":403},[400,2123,2124],{"class":406},"-- DCL: Grant read access to a user\n",[400,2126,2127,2129,2132,2135,2137,2139,2142],{"class":402,"line":410},[400,2128,1299],{"class":413},[400,2130,2131],{"class":413}," SELECT",[400,2133,2134],{"class":413}," ON",[400,2136,1481],{"class":424},[400,2138,1550],{"class":413},[400,2140,2141],{"class":1081}," 'readonly_user'",[400,2143,1151],{"class":424},[400,2145,2146],{"class":402,"line":428},[400,2147,1157],{"emptyLinePlaceholder":1156},[400,2149,2150],{"class":402,"line":443},[400,2151,2152],{"class":406},"-- TCL: Transaction block\n",[400,2154,2155,2158],{"class":402,"line":462},[400,2156,2157],{"class":413},"BEGIN",[400,2159,1151],{"class":424},[400,2161,2162,2165,2168,2170,2173,2175,2177,2180,2183,2186,2189,2191,2193],{"class":402,"line":471},[400,2163,2164],{"class":413},"    UPDATE",[400,2166,2167],{"class":424}," accounts ",[400,2169,1812],{"class":413},[400,2171,2172],{"class":424}," balance ",[400,2174,1066],{"class":413},[400,2176,2172],{"class":424},[400,2178,2179],{"class":413},"-",[400,2181,2182],{"class":455}," 500",[400,2184,2185],{"class":413}," WHERE",[400,2187,2188],{"class":424}," id ",[400,2190,1066],{"class":413},[400,2192,1844],{"class":455},[400,2194,1151],{"class":424},[400,2196,2197,2199,2201,2203,2205,2207,2209,2212,2214,2216,2218,2220,2223],{"class":402,"line":559},[400,2198,2164],{"class":413},[400,2200,2167],{"class":424},[400,2202,1812],{"class":413},[400,2204,2172],{"class":424},[400,2206,1066],{"class":413},[400,2208,2172],{"class":424},[400,2210,2211],{"class":413},"+",[400,2213,2182],{"class":455},[400,2215,2185],{"class":413},[400,2217,2188],{"class":424},[400,2219,1066],{"class":413},[400,2221,2222],{"class":455}," 2",[400,2224,1151],{"class":424},[400,2226,2227,2229,2232],{"class":402,"line":1456},[400,2228,1320],{"class":413},[400,2230,2231],{"class":424},";  ",[400,2233,2234],{"class":406},"-- Make it permanent\n",[400,2236,2237],{"class":402,"line":1556},[400,2238,1157],{"emptyLinePlaceholder":1156},[400,2240,2241],{"class":402,"line":1561},[400,2242,2243],{"class":406},"-- If something goes wrong, undo everything\n",[400,2245,2246,2248],{"class":402,"line":1567},[400,2247,1323],{"class":413},[400,2249,1151],{"class":424},[119,2251],{},[11,2253,2255],{"id":2254},"_4-querying-in-depth","4. Querying in Depth",[52,2257,2259],{"id":2258},"_41-filtering-with-where","4.1 Filtering with WHERE",[16,2261,354,2262,2265],{},[28,2263,2264],{},"SQL WHERE clause"," filters which rows are returned. It's one of the most\nfrequently used tools when writing SQL queries.",[315,2267,2269],{"className":394,"code":2268,"language":396,"meta":324,"style":324},"-- Comparison operators\nSELECT * FROM products WHERE price > 1000;\nSELECT * FROM products WHERE stock_count = 0;\nSELECT * FROM products WHERE name != 'USB-C Hub';\n\n-- Range\nSELECT * FROM products WHERE price BETWEEN 500 AND 2000;\n\n-- Pattern matching (% = any sequence of chars, _ = exactly one char)\nSELECT * FROM products WHERE name LIKE 'Wire%';    -- starts with \"Wire\"\nSELECT * FROM products WHERE name LIKE '%Mouse%';  -- contains \"Mouse\"\nSELECT * FROM products WHERE name LIKE 'M____';    -- \"M\" + exactly 4 chars\n\n-- Match against a list\nSELECT * FROM products WHERE category IN ('Electronics', 'Accessories');\n\n-- NULL check\nSELECT * FROM products WHERE category IS NULL;\n\n-- Combining conditions\nSELECT * FROM products\nWHERE price \u003C 2000 AND stock_count > 10;\n\nSELECT * FROM products\nWHERE category = 'Electronics' OR price \u003C 500;\n\n-- NOT operator\nSELECT * FROM products WHERE NOT (price > 3000);\n",[322,2270,2271,2276,2298,2318,2341,2345,2350,2377,2381,2386,2412,2436,2460,2464,2469,2499,2503,2509,2530,2535,2541,2552,2575,2580,2591,2614,2619,2625],{"__ignoreMap":324},[400,2272,2273],{"class":402,"line":403},[400,2274,2275],{"class":406},"-- Comparison operators\n",[400,2277,2278,2280,2282,2284,2286,2288,2290,2293,2296],{"class":402,"line":410},[400,2279,1129],{"class":413},[400,2281,1132],{"class":413},[400,2283,1135],{"class":413},[400,2285,1481],{"class":424},[400,2287,1141],{"class":413},[400,2289,1815],{"class":424},[400,2291,2292],{"class":413},">",[400,2294,2295],{"class":455}," 1000",[400,2297,1151],{"class":424},[400,2299,2300,2302,2304,2306,2308,2310,2312,2314,2316],{"class":402,"line":428},[400,2301,1129],{"class":413},[400,2303,1132],{"class":413},[400,2305,1135],{"class":413},[400,2307,1481],{"class":424},[400,2309,1141],{"class":413},[400,2311,1936],{"class":424},[400,2313,1066],{"class":413},[400,2315,1069],{"class":455},[400,2317,1151],{"class":424},[400,2319,2320,2322,2324,2326,2328,2330,2333,2336,2339],{"class":402,"line":443},[400,2321,1129],{"class":413},[400,2323,1132],{"class":413},[400,2325,1135],{"class":413},[400,2327,1481],{"class":424},[400,2329,1141],{"class":413},[400,2331,2332],{"class":413}," name",[400,2334,2335],{"class":413}," !=",[400,2337,2338],{"class":1081}," 'USB-C Hub'",[400,2340,1151],{"class":424},[400,2342,2343],{"class":402,"line":462},[400,2344,1157],{"emptyLinePlaceholder":1156},[400,2346,2347],{"class":402,"line":471},[400,2348,2349],{"class":406},"-- Range\n",[400,2351,2352,2354,2356,2358,2360,2362,2364,2367,2369,2372,2375],{"class":402,"line":559},[400,2353,1129],{"class":413},[400,2355,1132],{"class":413},[400,2357,1135],{"class":413},[400,2359,1481],{"class":424},[400,2361,1141],{"class":413},[400,2363,1815],{"class":424},[400,2365,2366],{"class":413},"BETWEEN",[400,2368,2182],{"class":455},[400,2370,2371],{"class":413}," AND",[400,2373,2374],{"class":455}," 2000",[400,2376,1151],{"class":424},[400,2378,2379],{"class":402,"line":1456},[400,2380,1157],{"emptyLinePlaceholder":1156},[400,2382,2383],{"class":402,"line":1556},[400,2384,2385],{"class":406},"-- Pattern matching (% = any sequence of chars, _ = exactly one char)\n",[400,2387,2388,2390,2392,2394,2396,2398,2400,2403,2406,2409],{"class":402,"line":1561},[400,2389,1129],{"class":413},[400,2391,1132],{"class":413},[400,2393,1135],{"class":413},[400,2395,1481],{"class":424},[400,2397,1141],{"class":413},[400,2399,2332],{"class":413},[400,2401,2402],{"class":413}," LIKE",[400,2404,2405],{"class":1081}," 'Wire%'",[400,2407,2408],{"class":424},";    ",[400,2410,2411],{"class":406},"-- starts with \"Wire\"\n",[400,2413,2414,2416,2418,2420,2422,2424,2426,2428,2431,2433],{"class":402,"line":1567},[400,2415,1129],{"class":413},[400,2417,1132],{"class":413},[400,2419,1135],{"class":413},[400,2421,1481],{"class":424},[400,2423,1141],{"class":413},[400,2425,2332],{"class":413},[400,2427,2402],{"class":413},[400,2429,2430],{"class":1081}," '%Mouse%'",[400,2432,2231],{"class":424},[400,2434,2435],{"class":406},"-- contains \"Mouse\"\n",[400,2437,2438,2440,2442,2444,2446,2448,2450,2452,2455,2457],{"class":402,"line":2066},[400,2439,1129],{"class":413},[400,2441,1132],{"class":413},[400,2443,1135],{"class":413},[400,2445,1481],{"class":424},[400,2447,1141],{"class":413},[400,2449,2332],{"class":413},[400,2451,2402],{"class":413},[400,2453,2454],{"class":1081}," 'M____'",[400,2456,2408],{"class":424},[400,2458,2459],{"class":406},"-- \"M\" + exactly 4 chars\n",[400,2461,2462],{"class":402,"line":2072},[400,2463,1157],{"emptyLinePlaceholder":1156},[400,2465,2466],{"class":402,"line":2083},[400,2467,2468],{"class":406},"-- Match against a list\n",[400,2470,2471,2473,2475,2477,2479,2481,2484,2487,2489,2492,2494,2497],{"class":402,"line":2095},[400,2472,1129],{"class":413},[400,2474,1132],{"class":413},[400,2476,1135],{"class":413},[400,2478,1481],{"class":424},[400,2480,1141],{"class":413},[400,2482,2483],{"class":424}," category ",[400,2485,2486],{"class":413},"IN",[400,2488,1674],{"class":424},[400,2490,2491],{"class":1081},"'Electronics'",[400,2493,872],{"class":424},[400,2495,2496],{"class":1081},"'Accessories'",[400,2498,474],{"class":424},[400,2500,2501],{"class":402,"line":2106},[400,2502,1157],{"emptyLinePlaceholder":1156},[400,2504,2506],{"class":402,"line":2505},17,[400,2507,2508],{"class":406},"-- NULL check\n",[400,2510,2512,2514,2516,2518,2520,2522,2524,2526,2528],{"class":402,"line":2511},18,[400,2513,1129],{"class":413},[400,2515,1132],{"class":413},[400,2517,1135],{"class":413},[400,2519,1481],{"class":424},[400,2521,1141],{"class":413},[400,2523,2483],{"class":424},[400,2525,1179],{"class":413},[400,2527,1094],{"class":413},[400,2529,1151],{"class":424},[400,2531,2533],{"class":402,"line":2532},19,[400,2534,1157],{"emptyLinePlaceholder":1156},[400,2536,2538],{"class":402,"line":2537},20,[400,2539,2540],{"class":406},"-- Combining conditions\n",[400,2542,2544,2546,2548,2550],{"class":402,"line":2543},21,[400,2545,1129],{"class":413},[400,2547,1132],{"class":413},[400,2549,1135],{"class":413},[400,2551,1807],{"class":424},[400,2553,2555,2557,2559,2562,2564,2566,2568,2570,2573],{"class":402,"line":2554},22,[400,2556,1141],{"class":413},[400,2558,1815],{"class":424},[400,2560,2561],{"class":413},"\u003C",[400,2563,2374],{"class":455},[400,2565,2371],{"class":413},[400,2567,1936],{"class":424},[400,2569,2292],{"class":413},[400,2571,2572],{"class":455}," 10",[400,2574,1151],{"class":424},[400,2576,2578],{"class":402,"line":2577},23,[400,2579,1157],{"emptyLinePlaceholder":1156},[400,2581,2583,2585,2587,2589],{"class":402,"line":2582},24,[400,2584,1129],{"class":413},[400,2586,1132],{"class":413},[400,2588,1135],{"class":413},[400,2590,1807],{"class":424},[400,2592,2594,2596,2598,2600,2603,2606,2608,2610,2612],{"class":402,"line":2593},25,[400,2595,1141],{"class":413},[400,2597,2483],{"class":424},[400,2599,1066],{"class":413},[400,2601,2602],{"class":1081}," 'Electronics'",[400,2604,2605],{"class":413}," OR",[400,2607,1815],{"class":424},[400,2609,2561],{"class":413},[400,2611,2182],{"class":455},[400,2613,1151],{"class":424},[400,2615,2617],{"class":402,"line":2616},26,[400,2618,1157],{"emptyLinePlaceholder":1156},[400,2620,2622],{"class":402,"line":2621},27,[400,2623,2624],{"class":406},"-- NOT operator\n",[400,2626,2628,2630,2632,2634,2636,2638,2641,2644,2646,2649],{"class":402,"line":2627},28,[400,2629,1129],{"class":413},[400,2631,1132],{"class":413},[400,2633,1135],{"class":413},[400,2635,1481],{"class":424},[400,2637,1141],{"class":413},[400,2639,2640],{"class":413}," NOT",[400,2642,2643],{"class":424}," (price ",[400,2645,2292],{"class":413},[400,2647,2648],{"class":455}," 3000",[400,2650,474],{"class":424},[52,2652,2654],{"id":2653},"_42-sorting-with-order-by","4.2 Sorting with ORDER BY",[315,2656,2658],{"className":394,"code":2657,"language":396,"meta":324,"style":324},"-- Ascending (default)\nSELECT * FROM products ORDER BY price ASC;\n\n-- Descending\nSELECT * FROM products ORDER BY price DESC;\n\n-- Sort by multiple columns\nSELECT * FROM products ORDER BY category ASC, price DESC;\n\n-- Limit results (great for pagination)\nSELECT * FROM products ORDER BY price DESC LIMIT 5;\n\n-- Pagination: skip the first 10 rows, get the next 10\nSELECT * FROM products ORDER BY product_id LIMIT 10 OFFSET 10;\n",[322,2659,2660,2665,2683,2687,2692,2711,2715,2720,2743,2747,2752,2776,2780,2785],{"__ignoreMap":324},[400,2661,2662],{"class":402,"line":403},[400,2663,2664],{"class":406},"-- Ascending (default)\n",[400,2666,2667,2669,2671,2673,2675,2677,2679,2681],{"class":402,"line":410},[400,2668,1129],{"class":413},[400,2670,1132],{"class":413},[400,2672,1135],{"class":413},[400,2674,1481],{"class":424},[400,2676,2015],{"class":413},[400,2678,1815],{"class":424},[400,2680,2021],{"class":413},[400,2682,1151],{"class":424},[400,2684,2685],{"class":402,"line":428},[400,2686,1157],{"emptyLinePlaceholder":1156},[400,2688,2689],{"class":402,"line":443},[400,2690,2691],{"class":406},"-- Descending\n",[400,2693,2694,2696,2698,2700,2702,2704,2706,2709],{"class":402,"line":462},[400,2695,1129],{"class":413},[400,2697,1132],{"class":413},[400,2699,1135],{"class":413},[400,2701,1481],{"class":424},[400,2703,2015],{"class":413},[400,2705,1815],{"class":424},[400,2707,2708],{"class":413},"DESC",[400,2710,1151],{"class":424},[400,2712,2713],{"class":402,"line":471},[400,2714,1157],{"emptyLinePlaceholder":1156},[400,2716,2717],{"class":402,"line":559},[400,2718,2719],{"class":406},"-- Sort by multiple columns\n",[400,2721,2722,2724,2726,2728,2730,2732,2734,2736,2739,2741],{"class":402,"line":1456},[400,2723,1129],{"class":413},[400,2725,1132],{"class":413},[400,2727,1135],{"class":413},[400,2729,1481],{"class":424},[400,2731,2015],{"class":413},[400,2733,2483],{"class":424},[400,2735,2021],{"class":413},[400,2737,2738],{"class":424},", price ",[400,2740,2708],{"class":413},[400,2742,1151],{"class":424},[400,2744,2745],{"class":402,"line":1556},[400,2746,1157],{"emptyLinePlaceholder":1156},[400,2748,2749],{"class":402,"line":1561},[400,2750,2751],{"class":406},"-- Limit results (great for pagination)\n",[400,2753,2754,2756,2758,2760,2762,2764,2766,2768,2771,2774],{"class":402,"line":1567},[400,2755,1129],{"class":413},[400,2757,1132],{"class":413},[400,2759,1135],{"class":413},[400,2761,1481],{"class":424},[400,2763,2015],{"class":413},[400,2765,1815],{"class":424},[400,2767,2708],{"class":413},[400,2769,2770],{"class":413}," LIMIT",[400,2772,2773],{"class":455}," 5",[400,2775,1151],{"class":424},[400,2777,2778],{"class":402,"line":2066},[400,2779,1157],{"emptyLinePlaceholder":1156},[400,2781,2782],{"class":402,"line":2072},[400,2783,2784],{"class":406},"-- Pagination: skip the first 10 rows, get the next 10\n",[400,2786,2787,2789,2791,2793,2795,2797,2799,2801,2803,2806,2808],{"class":402,"line":2083},[400,2788,1129],{"class":413},[400,2790,1132],{"class":413},[400,2792,1135],{"class":413},[400,2794,1481],{"class":424},[400,2796,2015],{"class":413},[400,2798,1839],{"class":424},[400,2800,2032],{"class":413},[400,2802,2572],{"class":455},[400,2804,2805],{"class":424}," OFFSET ",[400,2807,1409],{"class":455},[400,2809,1151],{"class":424},[52,2811,2813],{"id":2812},"_43-aggregate-functions-group-by","4.3 Aggregate Functions & GROUP BY",[16,2815,2816,2819,2820,2823],{},[28,2817,2818],{},"SQL aggregate functions"," calculate a ",[20,2821,2822],{},"single result"," from a set of rows.\nThey are essential for reporting, analytics, and summarizing structured data.",[135,2825,2826,2838],{},[138,2827,2828],{},[141,2829,2830,2833,2836],{},[144,2831,2832],{},"Function",[144,2834,2835],{},"Description",[144,2837,600],{},[154,2839,2840,2858,2876,2894,2912],{},[141,2841,2842,2847,2850],{},[159,2843,2844],{},[322,2845,2846],{},"COUNT(*)",[159,2848,2849],{},"Number of rows",[159,2851,2852,2854,2855],{},[322,2853,2846],{}," → ",[322,2856,2857],{},"4",[141,2859,2860,2865,2868],{},[159,2861,2862],{},[322,2863,2864],{},"SUM(col)",[159,2866,2867],{},"Total of a numeric column",[159,2869,2870,2854,2873],{},[322,2871,2872],{},"SUM(price)",[322,2874,2875],{},"8196.00",[141,2877,2878,2883,2886],{},[159,2879,2880],{},[322,2881,2882],{},"AVG(col)",[159,2884,2885],{},"Average value",[159,2887,2888,2854,2891],{},[322,2889,2890],{},"AVG(price)",[322,2892,2893],{},"2049.00",[141,2895,2896,2901,2904],{},[159,2897,2898],{},[322,2899,2900],{},"MIN(col)",[159,2902,2903],{},"Smallest value",[159,2905,2906,2854,2909],{},[322,2907,2908],{},"MIN(price)",[322,2910,2911],{},"999.00",[141,2913,2914,2919,2922],{},[159,2915,2916],{},[322,2917,2918],{},"MAX(col)",[159,2920,2921],{},"Largest value",[159,2923,2924,2854,2927],{},[322,2925,2926],{},"MAX(price)",[322,2928,2929],{},"3499.00",[315,2931,2933],{"className":394,"code":2932,"language":396,"meta":324,"style":324},"-- How many products do we have?\nSELECT COUNT(*) AS total_products FROM products;\n\n-- What is the average price?\nSELECT AVG(price) AS avg_price FROM products;\n\n-- Aggregation per group using GROUP BY\nSELECT\n    category,\n    COUNT(*)       AS num_products,\n    AVG(price)     AS avg_price,\n    SUM(stock_count) AS total_stock\nFROM products\nGROUP BY category;\n",[322,2934,2935,2940,2962,2966,2971,2990,2994,2999,3003,3008,3025,3038,3051,3057],{"__ignoreMap":324},[400,2936,2937],{"class":402,"line":403},[400,2938,2939],{"class":406},"-- How many products do we have?\n",[400,2941,2942,2944,2947,2949,2951,2953,2955,2958,2960],{"class":402,"line":410},[400,2943,1129],{"class":413},[400,2945,2946],{"class":455}," COUNT",[400,2948,452],{"class":424},[400,2950,1874],{"class":413},[400,2952,1381],{"class":424},[400,2954,2089],{"class":413},[400,2956,2957],{"class":424}," total_products ",[400,2959,2000],{"class":413},[400,2961,1605],{"class":424},[400,2963,2964],{"class":402,"line":428},[400,2965,1157],{"emptyLinePlaceholder":1156},[400,2967,2968],{"class":402,"line":443},[400,2969,2970],{"class":406},"-- What is the average price?\n",[400,2972,2973,2975,2978,2981,2983,2986,2988],{"class":402,"line":462},[400,2974,1129],{"class":413},[400,2976,2977],{"class":455}," AVG",[400,2979,2980],{"class":424},"(price) ",[400,2982,2089],{"class":413},[400,2984,2985],{"class":424}," avg_price ",[400,2987,2000],{"class":413},[400,2989,1605],{"class":424},[400,2991,2992],{"class":402,"line":471},[400,2993,1157],{"emptyLinePlaceholder":1156},[400,2995,2996],{"class":402,"line":559},[400,2997,2998],{"class":406},"-- Aggregation per group using GROUP BY\n",[400,3000,3001],{"class":402,"line":1456},[400,3002,2069],{"class":413},[400,3004,3005],{"class":402,"line":1556},[400,3006,3007],{"class":424},"    category,\n",[400,3009,3010,3013,3015,3017,3020,3022],{"class":402,"line":1561},[400,3011,3012],{"class":455},"    COUNT",[400,3014,452],{"class":424},[400,3016,1874],{"class":413},[400,3018,3019],{"class":424},")       ",[400,3021,2089],{"class":413},[400,3023,3024],{"class":424}," num_products,\n",[400,3026,3027,3030,3033,3035],{"class":402,"line":1567},[400,3028,3029],{"class":455},"    AVG",[400,3031,3032],{"class":424},"(price)     ",[400,3034,2089],{"class":413},[400,3036,3037],{"class":424}," avg_price,\n",[400,3039,3040,3043,3046,3048],{"class":402,"line":2066},[400,3041,3042],{"class":455},"    SUM",[400,3044,3045],{"class":424},"(stock_count) ",[400,3047,2089],{"class":413},[400,3049,3050],{"class":424}," total_stock\n",[400,3052,3053,3055],{"class":402,"line":2072},[400,3054,2000],{"class":413},[400,3056,1807],{"class":424},[400,3058,3059,3062],{"class":402,"line":2083},[400,3060,3061],{"class":413},"GROUP BY",[400,3063,3064],{"class":424}," category;\n",[16,3066,3067],{},[28,3068,3069],{},"Output:",[315,3071,3074],{"className":3072,"code":3073,"language":320},[318],"category      | num_products | avg_price | total_stock\n--------------+--------------+-----------+-------------\nElectronics   |      3       |  2332.33  |     275\nAccessories   |      1       |   999.00  |     120\n",[322,3075,3073],{"__ignoreMap":324},[375,3077,3079],{"id":3078},"having-filtering-groups","HAVING — Filtering Groups",[16,3081,3082,3084,3085,3088,3089,3084,3092,3095,3096,3099],{},[322,3083,1141],{}," filters ",[20,3086,3087],{},"rows"," before grouping. ",[322,3090,3091],{},"HAVING",[20,3093,3094],{},"groups"," after\naggregation. Understanding ",[28,3097,3098],{},"SQL GROUP BY and HAVING explained with examples","\nis key to writing analytical queries.",[315,3101,3103],{"className":394,"code":3102,"language":396,"meta":324,"style":324},"-- Only show categories that have more than 2 products\nSELECT category, COUNT(*) AS num_products\nFROM products\nGROUP BY category\nHAVING COUNT(*) > 2;\n\n-- Categories where the average price exceeds ₹2000\nSELECT category, AVG(price) AS avg_price\nFROM products\nGROUP BY category\nHAVING AVG(price) > 2000;\n",[322,3104,3105,3110,3131,3137,3144,3162,3166,3171,3187,3193,3199],{"__ignoreMap":324},[400,3106,3107],{"class":402,"line":403},[400,3108,3109],{"class":406},"-- Only show categories that have more than 2 products\n",[400,3111,3112,3114,3117,3120,3122,3124,3126,3128],{"class":402,"line":410},[400,3113,1129],{"class":413},[400,3115,3116],{"class":424}," category, ",[400,3118,3119],{"class":455},"COUNT",[400,3121,452],{"class":424},[400,3123,1874],{"class":413},[400,3125,1381],{"class":424},[400,3127,2089],{"class":413},[400,3129,3130],{"class":424}," num_products\n",[400,3132,3133,3135],{"class":402,"line":428},[400,3134,2000],{"class":413},[400,3136,1807],{"class":424},[400,3138,3139,3141],{"class":402,"line":443},[400,3140,3061],{"class":413},[400,3142,3143],{"class":424}," category\n",[400,3145,3146,3148,3150,3152,3154,3156,3158,3160],{"class":402,"line":462},[400,3147,3091],{"class":413},[400,3149,2946],{"class":455},[400,3151,452],{"class":424},[400,3153,1874],{"class":413},[400,3155,1381],{"class":424},[400,3157,2292],{"class":413},[400,3159,2222],{"class":455},[400,3161,1151],{"class":424},[400,3163,3164],{"class":402,"line":471},[400,3165,1157],{"emptyLinePlaceholder":1156},[400,3167,3168],{"class":402,"line":559},[400,3169,3170],{"class":406},"-- Categories where the average price exceeds ₹2000\n",[400,3172,3173,3175,3177,3180,3182,3184],{"class":402,"line":1456},[400,3174,1129],{"class":413},[400,3176,3116],{"class":424},[400,3178,3179],{"class":455},"AVG",[400,3181,2980],{"class":424},[400,3183,2089],{"class":413},[400,3185,3186],{"class":424}," avg_price\n",[400,3188,3189,3191],{"class":402,"line":1556},[400,3190,2000],{"class":413},[400,3192,1807],{"class":424},[400,3194,3195,3197],{"class":402,"line":1561},[400,3196,3061],{"class":413},[400,3198,3143],{"class":424},[400,3200,3201,3203,3205,3207,3209,3211],{"class":402,"line":1567},[400,3202,3091],{"class":413},[400,3204,2977],{"class":455},[400,3206,2980],{"class":424},[400,3208,2292],{"class":413},[400,3210,2374],{"class":455},[400,3212,1151],{"class":424},[106,3214,3215],{},[16,3216,3217,1630,3220,3222,3223,3225],{},[28,3218,3219],{},"Memory trick:",[322,3221,1141],{}," is for rows, ",[322,3224,3091],{}," is for groups.",[375,3227,3229],{"id":3228},"the-logical-order-of-sql-clauses","The Logical Order of SQL Clauses",[16,3231,3232,3233,3236,3237,3240],{},"SQL clauses are ",[20,3234,3235],{},"written"," in one order but ",[20,3238,3239],{},"executed"," in another:",[315,3242,3245],{"className":3243,"code":3244,"language":320},[318],"Written Order:             Execution Order:\n1. SELECT                  1. FROM\n2. FROM                    2. WHERE\n3. WHERE                   3. GROUP BY\n4. GROUP BY                4. HAVING\n5. HAVING                  5. SELECT\n6. ORDER BY                6. ORDER BY\n7. LIMIT                   7. LIMIT\n",[322,3246,3244],{"__ignoreMap":324},[16,3248,3249,3250,3253,3254,3256,3257,3259],{},"Understanding execution order explains ",[20,3251,3252],{},"why"," you can't use a ",[322,3255,1129],{}," alias\nin a ",[322,3258,1141],{}," clause — the alias hasn't been created yet at that point.",[52,3261,3263],{"id":3262},"_44-joins-combining-tables","4.4 JOINs — Combining Tables",[16,3265,3266,3269,3270,3273,3274,3277],{},[28,3267,3268],{},"SQL JOIN types explained"," — JOINs are the most powerful feature in SQL.\nThey let you query ",[20,3271,3272],{},"multiple tables at once"," by linking them through their\nrelated keys. Knowing the ",[28,3275,3276],{},"difference between INNER JOIN and LEFT JOIN"," is one of the most practical skills in relational databases.",[16,3279,3280],{},"Let's use a concrete example:",[315,3282,3284],{"className":394,"code":3283,"language":396,"meta":324,"style":324},"-- Our tables:\n-- customers(id, name, email)\n-- orders(id, customer_id, total_amount, order_date, status)\n",[322,3285,3286,3291,3296],{"__ignoreMap":324},[400,3287,3288],{"class":402,"line":403},[400,3289,3290],{"class":406},"-- Our tables:\n",[400,3292,3293],{"class":402,"line":410},[400,3294,3295],{"class":406},"-- customers(id, name, email)\n",[400,3297,3298],{"class":402,"line":428},[400,3299,3300],{"class":406},"-- orders(id, customer_id, total_amount, order_date, status)\n",[16,3302,3303],{},[59,3304],{"alt":3305,"src":3306},"SQL JOINs Venn Diagram","/post-images/sql-made-dead-simple-rdbms-guide/sql-joins-venn-diagram.png",[375,3308,3310],{"id":3309},"inner-join","INNER JOIN",[16,3312,3313,3314,35],{},"Returns only the rows where there is a ",[28,3315,3316],{},"match in both tables",[315,3318,3320],{"className":394,"code":3319,"language":396,"meta":324,"style":324},"SELECT\n    c.name        AS customer_name,\n    o.id          AS order_id,\n    o.total_amount,\n    o.order_date\nFROM customers c\nINNER JOIN orders o ON c.id = o.customer_id;\n",[322,3321,3322,3326,3340,3356,3367,3376,3383],{"__ignoreMap":324},[400,3323,3324],{"class":402,"line":403},[400,3325,2069],{"class":413},[400,3327,3328,3331,3333,3335,3337],{"class":402,"line":410},[400,3329,3330],{"class":455},"    c",[400,3332,35],{"class":424},[400,3334,1521],{"class":455},[400,3336,2077],{"class":413},[400,3338,3339],{"class":424}," customer_name,\n",[400,3341,3342,3345,3347,3350,3353],{"class":402,"line":428},[400,3343,3344],{"class":455},"    o",[400,3346,35],{"class":424},[400,3348,3349],{"class":455},"id",[400,3351,3352],{"class":413},"          AS",[400,3354,3355],{"class":424}," order_id,\n",[400,3357,3358,3360,3362,3365],{"class":402,"line":443},[400,3359,3344],{"class":455},[400,3361,35],{"class":424},[400,3363,3364],{"class":455},"total_amount",[400,3366,440],{"class":424},[400,3368,3369,3371,3373],{"class":402,"line":462},[400,3370,3344],{"class":455},[400,3372,35],{"class":424},[400,3374,3375],{"class":455},"order_date\n",[400,3377,3378,3380],{"class":402,"line":471},[400,3379,2000],{"class":413},[400,3381,3382],{"class":424}," customers c\n",[400,3384,3385,3387,3390,3393,3396,3398,3400,3403,3406,3408,3411],{"class":402,"line":559},[400,3386,3310],{"class":413},[400,3388,3389],{"class":424}," orders o ",[400,3391,3392],{"class":413},"ON",[400,3394,3395],{"class":455}," c",[400,3397,35],{"class":424},[400,3399,3349],{"class":455},[400,3401,3402],{"class":413}," =",[400,3404,3405],{"class":455}," o",[400,3407,35],{"class":424},[400,3409,3410],{"class":455},"customer_id",[400,3412,1151],{"class":424},[106,3414,3415],{},[16,3416,3417,3418,3421],{},"Customers who have never placed an order will ",[28,3419,3420],{},"NOT"," appear here.",[375,3423,3425],{"id":3424},"left-join-left-outer-join","LEFT JOIN (LEFT OUTER JOIN)",[16,3427,3428,3429,3432],{},"Returns ",[28,3430,3431],{},"all rows from the left table",", and matched rows from the right.\nIf there is no match, the right side columns return NULL.",[315,3434,3436],{"className":394,"code":3435,"language":396,"meta":324,"style":324},"-- All customers, even those with no orders\nSELECT\n    c.name        AS customer_name,\n    o.id          AS order_id,\n    o.total_amount\nFROM customers c\nLEFT JOIN orders o ON c.id = o.customer_id;\n",[322,3437,3438,3443,3447,3459,3471,3480,3486],{"__ignoreMap":324},[400,3439,3440],{"class":402,"line":403},[400,3441,3442],{"class":406},"-- All customers, even those with no orders\n",[400,3444,3445],{"class":402,"line":410},[400,3446,2069],{"class":413},[400,3448,3449,3451,3453,3455,3457],{"class":402,"line":428},[400,3450,3330],{"class":455},[400,3452,35],{"class":424},[400,3454,1521],{"class":455},[400,3456,2077],{"class":413},[400,3458,3339],{"class":424},[400,3460,3461,3463,3465,3467,3469],{"class":402,"line":443},[400,3462,3344],{"class":455},[400,3464,35],{"class":424},[400,3466,3349],{"class":455},[400,3468,3352],{"class":413},[400,3470,3355],{"class":424},[400,3472,3473,3475,3477],{"class":402,"line":462},[400,3474,3344],{"class":455},[400,3476,35],{"class":424},[400,3478,3479],{"class":455},"total_amount\n",[400,3481,3482,3484],{"class":402,"line":471},[400,3483,2000],{"class":413},[400,3485,3382],{"class":424},[400,3487,3488,3491,3493,3495,3497,3499,3501,3503,3505,3507,3509],{"class":402,"line":559},[400,3489,3490],{"class":413},"LEFT JOIN",[400,3492,3389],{"class":424},[400,3494,3392],{"class":413},[400,3496,3395],{"class":455},[400,3498,35],{"class":424},[400,3500,3349],{"class":455},[400,3502,3402],{"class":413},[400,3504,3405],{"class":455},[400,3506,35],{"class":424},[400,3508,3410],{"class":455},[400,3510,1151],{"class":424},[106,3512,3513],{},[16,3514,3515,3516,35],{},"A customer with no orders will show up with ",[322,3517,3518],{},"order_id = NULL",[375,3520,3522],{"id":3521},"right-join-right-outer-join","RIGHT JOIN (RIGHT OUTER JOIN)",[16,3524,3525],{},"The mirror of LEFT JOIN — all rows from the right table, matched rows from\nthe left. (Less common; usually rewritten as a LEFT JOIN for clarity.)",[375,3527,3529],{"id":3528},"full-outer-join","FULL OUTER JOIN",[16,3531,3532,3533,3536],{},"Returns all rows from ",[28,3534,3535],{},"both"," tables. NULLs fill in where there is no match\non either side.",[315,3538,3540],{"className":394,"code":3539,"language":396,"meta":324,"style":324},"SELECT c.name, o.id AS order_id\nFROM customers c\nFULL OUTER JOIN orders o ON c.id = o.customer_id;\n",[322,3541,3542,3567,3573],{"__ignoreMap":324},[400,3543,3544,3546,3548,3550,3552,3554,3557,3559,3561,3564],{"class":402,"line":403},[400,3545,1129],{"class":413},[400,3547,3395],{"class":455},[400,3549,35],{"class":424},[400,3551,1521],{"class":455},[400,3553,872],{"class":424},[400,3555,3556],{"class":455},"o",[400,3558,35],{"class":424},[400,3560,3349],{"class":455},[400,3562,3563],{"class":413}," AS",[400,3565,3566],{"class":424}," order_id\n",[400,3568,3569,3571],{"class":402,"line":410},[400,3570,2000],{"class":413},[400,3572,3382],{"class":424},[400,3574,3575,3577,3579,3581,3583,3585,3587,3589,3591,3593,3595],{"class":402,"line":428},[400,3576,3529],{"class":413},[400,3578,3389],{"class":424},[400,3580,3392],{"class":413},[400,3582,3395],{"class":455},[400,3584,35],{"class":424},[400,3586,3349],{"class":455},[400,3588,3402],{"class":413},[400,3590,3405],{"class":455},[400,3592,35],{"class":424},[400,3594,3410],{"class":455},[400,3596,1151],{"class":424},[375,3598,3600],{"id":3599},"cross-join","CROSS JOIN",[16,3602,3603,3604,3607],{},"Returns the ",[28,3605,3606],{},"Cartesian product"," — every row in Table A combined with every\nrow in Table B. Use with extreme caution (1000 rows × 1000 rows = 1,000,000\nresult rows).",[315,3609,3611],{"className":394,"code":3610,"language":396,"meta":324,"style":324},"-- Every possible pairing of colors and sizes\nSELECT colors.name, sizes.label\nFROM colors\nCROSS JOIN sizes;\n",[322,3612,3613,3618,3639,3646],{"__ignoreMap":324},[400,3614,3615],{"class":402,"line":403},[400,3616,3617],{"class":406},"-- Every possible pairing of colors and sizes\n",[400,3619,3620,3622,3625,3627,3629,3631,3634,3636],{"class":402,"line":410},[400,3621,1129],{"class":413},[400,3623,3624],{"class":455}," colors",[400,3626,35],{"class":424},[400,3628,1521],{"class":455},[400,3630,872],{"class":424},[400,3632,3633],{"class":455},"sizes",[400,3635,35],{"class":424},[400,3637,3638],{"class":455},"label\n",[400,3640,3641,3643],{"class":402,"line":428},[400,3642,2000],{"class":413},[400,3644,3645],{"class":424}," colors\n",[400,3647,3648,3650],{"class":402,"line":443},[400,3649,3600],{"class":413},[400,3651,3652],{"class":424}," sizes;\n",[375,3654,3656],{"id":3655},"join-with-multiple-tables","JOIN with Multiple Tables",[315,3658,3660],{"className":394,"code":3659,"language":396,"meta":324,"style":324},"SELECT\n    c.name          AS customer,\n    p.name          AS product,\n    oi.quantity,\n    oi.unit_price\nFROM customers c\nJOIN orders    o  ON c.id    = o.customer_id\nJOIN order_items oi ON o.id = oi.order_id\nJOIN products  p  ON p.id   = oi.product_id\nWHERE c.id = 5;\n",[322,3661,3662,3666,3679,3693,3705,3714,3720,3746,3771,3797],{"__ignoreMap":324},[400,3663,3664],{"class":402,"line":403},[400,3665,2069],{"class":413},[400,3667,3668,3670,3672,3674,3676],{"class":402,"line":410},[400,3669,3330],{"class":455},[400,3671,35],{"class":424},[400,3673,1521],{"class":455},[400,3675,3352],{"class":413},[400,3677,3678],{"class":424}," customer,\n",[400,3680,3681,3684,3686,3688,3690],{"class":402,"line":428},[400,3682,3683],{"class":455},"    p",[400,3685,35],{"class":424},[400,3687,1521],{"class":455},[400,3689,3352],{"class":413},[400,3691,3692],{"class":424}," product,\n",[400,3694,3695,3698,3700,3703],{"class":402,"line":443},[400,3696,3697],{"class":455},"    oi",[400,3699,35],{"class":424},[400,3701,3702],{"class":455},"quantity",[400,3704,440],{"class":424},[400,3706,3707,3709,3711],{"class":402,"line":462},[400,3708,3697],{"class":455},[400,3710,35],{"class":424},[400,3712,3713],{"class":455},"unit_price\n",[400,3715,3716,3718],{"class":402,"line":471},[400,3717,2000],{"class":413},[400,3719,3382],{"class":424},[400,3721,3722,3725,3728,3730,3732,3734,3736,3739,3741,3743],{"class":402,"line":559},[400,3723,3724],{"class":413},"JOIN",[400,3726,3727],{"class":424}," orders    o  ",[400,3729,3392],{"class":413},[400,3731,3395],{"class":455},[400,3733,35],{"class":424},[400,3735,3349],{"class":455},[400,3737,3738],{"class":413},"    =",[400,3740,3405],{"class":455},[400,3742,35],{"class":424},[400,3744,3745],{"class":455},"customer_id\n",[400,3747,3748,3750,3753,3755,3757,3759,3761,3763,3766,3768],{"class":402,"line":1456},[400,3749,3724],{"class":413},[400,3751,3752],{"class":424}," order_items oi ",[400,3754,3392],{"class":413},[400,3756,3405],{"class":455},[400,3758,35],{"class":424},[400,3760,3349],{"class":455},[400,3762,3402],{"class":413},[400,3764,3765],{"class":455}," oi",[400,3767,35],{"class":424},[400,3769,3770],{"class":455},"order_id\n",[400,3772,3773,3775,3778,3780,3783,3785,3787,3790,3792,3794],{"class":402,"line":1556},[400,3774,3724],{"class":413},[400,3776,3777],{"class":424}," products  p  ",[400,3779,3392],{"class":413},[400,3781,3782],{"class":455}," p",[400,3784,35],{"class":424},[400,3786,3349],{"class":455},[400,3788,3789],{"class":413},"   =",[400,3791,3765],{"class":455},[400,3793,35],{"class":424},[400,3795,3796],{"class":455},"product_id\n",[400,3798,3799,3801,3803,3805,3807,3809,3811],{"class":402,"line":1561},[400,3800,1141],{"class":413},[400,3802,3395],{"class":455},[400,3804,35],{"class":424},[400,3806,3349],{"class":455},[400,3808,3402],{"class":413},[400,3810,2773],{"class":455},[400,3812,1151],{"class":424},[52,3814,3816],{"id":3815},"_45-subqueries","4.5 Subqueries",[16,3818,38,3819,3822],{},[28,3820,3821],{},"subquery"," is a query nested inside another query. The inner query runs\nfirst, and its result is used by the outer query.",[315,3824,3826],{"className":394,"code":3825,"language":396,"meta":324,"style":324},"-- Find all customers who have placed at least one order\nSELECT name FROM customers\nWHERE id IN (\n    SELECT DISTINCT customer_id FROM orders\n);\n\n-- Find products that cost more than the average price\nSELECT name, price FROM products\nWHERE price > (\n    SELECT AVG(price) FROM products\n);\n\n-- Subquery in FROM clause (derived table)\nSELECT category, avg_price\nFROM (\n    SELECT category, AVG(price) AS avg_price\n    FROM products\n    GROUP BY category\n) AS category_summary\nWHERE avg_price > 1500;\n",[322,3827,3828,3833,3844,3854,3867,3871,3875,3880,3892,3902,3915,3919,3923,3928,3935,3941,3955,3962,3969,3978],{"__ignoreMap":324},[400,3829,3830],{"class":402,"line":403},[400,3831,3832],{"class":406},"-- Find all customers who have placed at least one order\n",[400,3834,3835,3837,3839,3841],{"class":402,"line":410},[400,3836,1129],{"class":413},[400,3838,2332],{"class":413},[400,3840,1135],{"class":413},[400,3842,3843],{"class":424}," customers\n",[400,3845,3846,3848,3850,3852],{"class":402,"line":428},[400,3847,1141],{"class":413},[400,3849,2188],{"class":424},[400,3851,2486],{"class":413},[400,3853,425],{"class":424},[400,3855,3856,3859,3862,3864],{"class":402,"line":443},[400,3857,3858],{"class":413},"    SELECT DISTINCT",[400,3860,3861],{"class":424}," customer_id ",[400,3863,2000],{"class":413},[400,3865,3866],{"class":424}," orders\n",[400,3868,3869],{"class":402,"line":462},[400,3870,474],{"class":424},[400,3872,3873],{"class":402,"line":471},[400,3874,1157],{"emptyLinePlaceholder":1156},[400,3876,3877],{"class":402,"line":559},[400,3878,3879],{"class":406},"-- Find products that cost more than the average price\n",[400,3881,3882,3884,3886,3888,3890],{"class":402,"line":1456},[400,3883,1129],{"class":413},[400,3885,2332],{"class":413},[400,3887,2738],{"class":424},[400,3889,2000],{"class":413},[400,3891,1807],{"class":424},[400,3893,3894,3896,3898,3900],{"class":402,"line":1556},[400,3895,1141],{"class":413},[400,3897,1815],{"class":424},[400,3899,2292],{"class":413},[400,3901,425],{"class":424},[400,3903,3904,3907,3909,3911,3913],{"class":402,"line":1561},[400,3905,3906],{"class":413},"    SELECT",[400,3908,2977],{"class":455},[400,3910,2980],{"class":424},[400,3912,2000],{"class":413},[400,3914,1807],{"class":424},[400,3916,3917],{"class":402,"line":1567},[400,3918,474],{"class":424},[400,3920,3921],{"class":402,"line":2066},[400,3922,1157],{"emptyLinePlaceholder":1156},[400,3924,3925],{"class":402,"line":2072},[400,3926,3927],{"class":406},"-- Subquery in FROM clause (derived table)\n",[400,3929,3930,3932],{"class":402,"line":2083},[400,3931,1129],{"class":413},[400,3933,3934],{"class":424}," category, avg_price\n",[400,3936,3937,3939],{"class":402,"line":2095},[400,3938,2000],{"class":413},[400,3940,425],{"class":424},[400,3942,3943,3945,3947,3949,3951,3953],{"class":402,"line":2106},[400,3944,3906],{"class":413},[400,3946,3116],{"class":424},[400,3948,3179],{"class":455},[400,3950,2980],{"class":424},[400,3952,2089],{"class":413},[400,3954,3186],{"class":424},[400,3956,3957,3960],{"class":402,"line":2505},[400,3958,3959],{"class":413},"    FROM",[400,3961,1807],{"class":424},[400,3963,3964,3967],{"class":402,"line":2511},[400,3965,3966],{"class":413},"    GROUP BY",[400,3968,3143],{"class":424},[400,3970,3971,3973,3975],{"class":402,"line":2532},[400,3972,1381],{"class":424},[400,3974,2089],{"class":413},[400,3976,3977],{"class":424}," category_summary\n",[400,3979,3980,3982,3984,3986,3989],{"class":402,"line":2537},[400,3981,1141],{"class":413},[400,3983,2985],{"class":424},[400,3985,2292],{"class":413},[400,3987,3988],{"class":455}," 1500",[400,3990,1151],{"class":424},[119,3992],{},[11,3994,3996],{"id":3995},"_5-constraints-enforcing-rules","5. Constraints — Enforcing Rules",[16,3998,3999,4002,4003,4006],{},[28,4000,4001],{},"SQL constraints"," are rules applied to columns that the database enforces\nautomatically. They are a core part of maintaining ",[28,4004,4005],{},"data integrity"," and\nprevent bad data from ever entering your database.",[135,4008,4009,4019],{},[138,4010,4011],{},[141,4012,4013,4016],{},[144,4014,4015],{},"Constraint",[144,4017,4018],{},"What It Does",[154,4020,4021,4031,4041,4050,4060,4070],{},[141,4022,4023,4028],{},[159,4024,4025],{},[322,4026,4027],{},"PRIMARY KEY",[159,4029,4030],{},"Unique + NOT NULL. Uniquely identifies each row.",[141,4032,4033,4038],{},[159,4034,4035],{},[322,4036,4037],{},"FOREIGN KEY",[159,4039,4040],{},"Value must exist in the referenced table.",[141,4042,4043,4047],{},[159,4044,4045],{},[322,4046,1384],{},[159,4048,4049],{},"Column cannot be empty.",[141,4051,4052,4057],{},[159,4053,4054],{},[322,4055,4056],{},"UNIQUE",[159,4058,4059],{},"All values in the column must be different.",[141,4061,4062,4067],{},[159,4063,4064],{},[322,4065,4066],{},"DEFAULT",[159,4068,4069],{},"Provides a default value if none is given.",[141,4071,4072,4077],{},[159,4073,4074],{},[322,4075,4076],{},"CHECK",[159,4078,4079],{},"Value must satisfy a custom boolean expression.",[315,4081,4083],{"className":394,"code":4082,"language":396,"meta":324,"style":324},"CREATE TABLE employees (\n    id         SERIAL PRIMARY KEY,\n    email      VARCHAR(255) NOT NULL UNIQUE,\n    name       VARCHAR(100) NOT NULL,\n    salary     DECIMAL(10,2) CHECK (salary > 0),\n    department VARCHAR(50) DEFAULT 'General',\n    manager_id INT REFERENCES employees(id)    -- Self-referencing FK\n);\n",[322,4084,4085,4096,4107,4128,4144,4173,4193,4208],{"__ignoreMap":324},[400,4086,4087,4089,4091,4094],{"class":402,"line":403},[400,4088,414],{"class":413},[400,4090,417],{"class":413},[400,4092,4093],{"class":420}," employees",[400,4095,425],{"class":424},[400,4097,4098,4101,4103,4105],{"class":402,"line":410},[400,4099,4100],{"class":424},"    id         ",[400,4102,1358],{"class":413},[400,4104,437],{"class":413},[400,4106,440],{"class":424},[400,4108,4109,4112,4114,4116,4119,4121,4123,4126],{"class":402,"line":428},[400,4110,4111],{"class":424},"    email      ",[400,4113,1490],{"class":413},[400,4115,452],{"class":424},[400,4117,4118],{"class":455},"255",[400,4120,1381],{"class":424},[400,4122,1384],{"class":413},[400,4124,4125],{"class":413}," UNIQUE",[400,4127,440],{"class":424},[400,4129,4130,4132,4134,4136,4138,4140,4142],{"class":402,"line":443},[400,4131,446],{"class":413},[400,4133,449],{"class":413},[400,4135,452],{"class":424},[400,4137,456],{"class":455},[400,4139,1381],{"class":424},[400,4141,1384],{"class":413},[400,4143,440],{"class":424},[400,4145,4146,4149,4151,4153,4155,4158,4160,4162,4164,4167,4169,4171],{"class":402,"line":462},[400,4147,4148],{"class":424},"    salary     ",[400,4150,1404],{"class":413},[400,4152,452],{"class":424},[400,4154,1409],{"class":455},[400,4156,4157],{"class":424},",",[400,4159,1414],{"class":455},[400,4161,1381],{"class":424},[400,4163,4076],{"class":413},[400,4165,4166],{"class":424}," (salary ",[400,4168,2292],{"class":413},[400,4170,1069],{"class":455},[400,4172,459],{"class":424},[400,4174,4175,4178,4180,4182,4184,4186,4188,4191],{"class":402,"line":471},[400,4176,4177],{"class":424},"    department ",[400,4179,1490],{"class":413},[400,4181,452],{"class":424},[400,4183,1692],{"class":455},[400,4185,1381],{"class":424},[400,4187,4066],{"class":413},[400,4189,4190],{"class":1081}," 'General'",[400,4192,440],{"class":424},[400,4194,4195,4198,4200,4202,4205],{"class":402,"line":559},[400,4196,4197],{"class":424},"    manager_id ",[400,4199,434],{"class":413},[400,4201,533],{"class":413},[400,4203,4204],{"class":424}," employees(id)    ",[400,4206,4207],{"class":406},"-- Self-referencing FK\n",[400,4209,4210],{"class":402,"line":1456},[400,4211,474],{"class":424},[16,4213,4214],{},[28,4215,4216],{},"What happens when a constraint is violated?",[315,4218,4220],{"className":394,"code":4219,"language":396,"meta":324,"style":324},"-- This will FAIL with an error because email must be unique\nINSERT INTO employees (email, name, salary)\nVALUES ('dev@example.com', 'Rahul', 50000);\n\nINSERT INTO employees (email, name, salary)\nVALUES ('dev@example.com', 'Priya', 60000);  -- ERROR: duplicate key value\n",[322,4221,4222,4227,4239,4259,4263,4273],{"__ignoreMap":324},[400,4223,4224],{"class":402,"line":403},[400,4225,4226],{"class":406},"-- This will FAIL with an error because email must be unique\n",[400,4228,4229,4231,4234,4236],{"class":402,"line":410},[400,4230,1658],{"class":413},[400,4232,4233],{"class":424}," employees (email, ",[400,4235,1521],{"class":413},[400,4237,4238],{"class":424},", salary)\n",[400,4240,4241,4243,4245,4248,4250,4252,4254,4257],{"class":402,"line":428},[400,4242,1671],{"class":413},[400,4244,1674],{"class":424},[400,4246,4247],{"class":1081},"'dev@example.com'",[400,4249,872],{"class":424},[400,4251,938],{"class":1081},[400,4253,872],{"class":424},[400,4255,4256],{"class":455},"50000",[400,4258,474],{"class":424},[400,4260,4261],{"class":402,"line":443},[400,4262,1157],{"emptyLinePlaceholder":1156},[400,4264,4265,4267,4269,4271],{"class":402,"line":462},[400,4266,1658],{"class":413},[400,4268,4233],{"class":424},[400,4270,1521],{"class":413},[400,4272,4238],{"class":424},[400,4274,4275,4277,4279,4281,4283,4286,4288,4291,4294],{"class":402,"line":471},[400,4276,1671],{"class":413},[400,4278,1674],{"class":424},[400,4280,4247],{"class":1081},[400,4282,872],{"class":424},[400,4284,4285],{"class":1081},"'Priya'",[400,4287,872],{"class":424},[400,4289,4290],{"class":455},"60000",[400,4292,4293],{"class":424},");  ",[400,4295,4296],{"class":406},"-- ERROR: duplicate key value\n",[16,4298,4299,4300,4303],{},"The database rejects the second insert automatically. You don't need to write\nany application-level code to check for this — the database handles ",[28,4301,4302],{},"data\nintegrity"," natively.",[119,4305],{},[11,4307,4309],{"id":4308},"_6-normalization-designing-clean-databases","6. Normalization — Designing Clean Databases",[16,4311,4312,4315,4316,4319,4320,4322,4323,35],{},[28,4313,4314],{},"Database normalization explained:"," Normalization is the process of organizing\na database to reduce ",[28,4317,4318],{},"data redundancy"," (storing the same data in multiple\nplaces) and improve ",[28,4321,4005],{},". It is a foundational step when you\n",[28,4324,4325],{},"design a relational database from scratch",[52,4327,4329],{"id":4328},"the-problem-un-normalized-data","The Problem: Un-normalized Data",[16,4331,4332],{},"Imagine storing all order data in one flat table:",[315,4334,4337],{"className":4335,"code":4336,"language":320},[318],"+----------+----------+-------------------+----------+----------+-------+\n| order_id | cust_name| cust_email        | product  | category | price |\n+----------+----------+-------------------+----------+----------+-------+\n|    1     | Rahul    | rahul@example.com | Keyboard | Electronics | 3499|\n|    2     | Rahul    | rahul@example.com | Mouse    | Electronics | 999 |\n|    3     | Priya    | priya@example.com | Hub      | Electronics | 1499|\n+----------+----------+-------------------+----------+----------+-------+\n",[322,4338,4336],{"__ignoreMap":324},[16,4340,4341],{},[28,4342,4343],{},"Problems:",[67,4345,4346,4353,4356],{},[70,4347,4348,4349,4352],{},"Rahul's email is repeated — if he changes it, you must update ",[20,4350,4351],{},"every"," row",[70,4354,4355],{},"Deleting all of Priya's orders accidentally deletes her customer record too",[70,4357,4358],{},"Inserting a new customer requires placing a dummy order",[52,4360,4362],{"id":4361},"normal-forms","Normal Forms",[375,4364,4366],{"id":4365},"first-normal-form-1nf","First Normal Form (1NF)",[67,4368,4369,4376],{},[70,4370,4371,4372,4375],{},"Every column contains ",[28,4373,4374],{},"atomic (indivisible) values"," — no lists or sets\nin a single cell",[70,4377,4378],{},"Each row is unique",[315,4380,4382],{"className":394,"code":4381,"language":396,"meta":324,"style":324},"-- VIOLATION of 1NF: storing multiple values in one column\n| order_id | products                          |\n|----------|-----------------------------------|\n|    1     | 'Keyboard, Mouse, USB Hub'        | ← BAD\n\n-- CORRECT 1NF: one value per cell, one row per item\n| order_id | product   |\n|----------|-----------|\n|    1     | Keyboard  |\n|    1     | Mouse     |\n|    1     | USB Hub   |\n",[322,4383,4384,4389,4394,4401,4417,4421,4426,4431,4438,4447,4456],{"__ignoreMap":324},[400,4385,4386],{"class":402,"line":403},[400,4387,4388],{"class":406},"-- VIOLATION of 1NF: storing multiple values in one column\n",[400,4390,4391],{"class":402,"line":410},[400,4392,4393],{"class":424},"| order_id | products                          |\n",[400,4395,4396,4398],{"class":402,"line":428},[400,4397,2024],{"class":424},[400,4399,4400],{"class":406},"----------|-----------------------------------|\n",[400,4402,4403,4406,4408,4411,4414],{"class":402,"line":443},[400,4404,4405],{"class":424},"|    ",[400,4407,883],{"class":455},[400,4409,4410],{"class":424},"     | ",[400,4412,4413],{"class":1081},"'Keyboard, Mouse, USB Hub'",[400,4415,4416],{"class":424},"        | ← BAD\n",[400,4418,4419],{"class":402,"line":462},[400,4420,1157],{"emptyLinePlaceholder":1156},[400,4422,4423],{"class":402,"line":471},[400,4424,4425],{"class":406},"-- CORRECT 1NF: one value per cell, one row per item\n",[400,4427,4428],{"class":402,"line":559},[400,4429,4430],{"class":424},"| order_id | product   |\n",[400,4432,4433,4435],{"class":402,"line":1456},[400,4434,2024],{"class":424},[400,4436,4437],{"class":406},"----------|-----------|\n",[400,4439,4440,4442,4444],{"class":402,"line":1556},[400,4441,4405],{"class":424},[400,4443,883],{"class":455},[400,4445,4446],{"class":424},"     | Keyboard  |\n",[400,4448,4449,4451,4453],{"class":402,"line":1561},[400,4450,4405],{"class":424},[400,4452,883],{"class":455},[400,4454,4455],{"class":424},"     | Mouse     |\n",[400,4457,4458,4460,4462],{"class":402,"line":1567},[400,4459,4405],{"class":424},[400,4461,883],{"class":455},[400,4463,4464],{"class":424},"     | USB Hub   |\n",[375,4466,4468],{"id":4467},"second-normal-form-2nf","Second Normal Form (2NF)",[67,4470,4471,4474,4481],{},[70,4472,4473],{},"Must be in 1NF",[70,4475,4476,4477,4480],{},"Every non-key column must depend on the ",[28,4478,4479],{},"entire"," primary key (no partial\ndependencies)",[70,4482,4483],{},"Only relevant when the primary key is composite",[375,4485,4487],{"id":4486},"third-normal-form-3nf","Third Normal Form (3NF)",[67,4489,4490,4493],{},[70,4491,4492],{},"Must be in 2NF",[70,4494,4495,4496,4499,4500,4503],{},"No ",[28,4497,4498],{},"transitive dependencies"," — non-key columns must depend ",[20,4501,4502],{},"only"," on the\nprimary key, not on other non-key columns",[315,4505,4507],{"className":394,"code":4506,"language":396,"meta":324,"style":324},"-- VIOLATION: category_description depends on category, not on product_id\nproducts(product_id, name, category, category_description)\n\n-- CORRECT 3NF: split into two tables\nproducts(product_id, name, category_id)\ncategories(category_id, category_name, category_description)\n",[322,4508,4509,4514,4524,4528,4533,4542],{"__ignoreMap":324},[400,4510,4511],{"class":402,"line":403},[400,4512,4513],{"class":406},"-- VIOLATION: category_description depends on category, not on product_id\n",[400,4515,4516,4519,4521],{"class":402,"line":410},[400,4517,4518],{"class":424},"products(product_id, ",[400,4520,1521],{"class":413},[400,4522,4523],{"class":424},", category, category_description)\n",[400,4525,4526],{"class":402,"line":428},[400,4527,1157],{"emptyLinePlaceholder":1156},[400,4529,4530],{"class":402,"line":443},[400,4531,4532],{"class":406},"-- CORRECT 3NF: split into two tables\n",[400,4534,4535,4537,4539],{"class":402,"line":462},[400,4536,4518],{"class":424},[400,4538,1521],{"class":413},[400,4540,4541],{"class":424},", category_id)\n",[400,4543,4544],{"class":402,"line":471},[400,4545,4546],{"class":424},"categories(category_id, category_name, category_description)\n",[106,4548,4549],{},[16,4550,4551,4554,4555,4558,4559,4562],{},[28,4552,4553],{},"Practical advice:"," Aim for 3NF in most projects. ",[28,4556,4557],{},"How normalization works\nin databases"," is about finding the right balance — over-normalizing can\nsometimes hurt query performance (too many JOINs). Real-world systems\noccasionally ",[20,4560,4561],{},"deliberately"," denormalize for performance.",[119,4564],{},[11,4566,4568],{"id":4567},"_7-indexes-making-queries-fast","7. Indexes — Making Queries Fast",[16,4570,4571,4574,4575,4578,4579,4582],{},[28,4572,4573],{},"Database indexes explained:"," An index is a separate data structure (usually\na B-Tree) that the database builds to make searching faster. Without an index,\nthe database does a ",[28,4576,4577],{},"full table scan"," — it reads every single row to find a\nmatch. ",[28,4580,4581],{},"Query optimization"," in SQL largely comes down to strategic use of\nindexes.",[16,4584,4585],{},"Think of it like a book's index at the back — instead of reading all 500 pages\nto find \"Binary Search,\" you look it up in the index and jump directly to\npage 312.",[315,4587,4589],{"className":394,"code":4588,"language":396,"meta":324,"style":324},"-- Create an index on the email column (often searched)\nCREATE INDEX idx_customers_email ON customers(email);\n\n-- Create a composite index (for queries that filter on both columns)\nCREATE INDEX idx_orders_customer_date ON orders(customer_id, order_date);\n\n-- Unique index (also enforces uniqueness like a UNIQUE constraint)\nCREATE UNIQUE INDEX idx_products_sku ON products(sku);\n\n-- Drop an index\nDROP INDEX idx_customers_email;\n",[322,4590,4591,4596,4611,4615,4620,4634,4638,4643,4658,4662,4667],{"__ignoreMap":324},[400,4592,4593],{"class":402,"line":403},[400,4594,4595],{"class":406},"-- Create an index on the email column (often searched)\n",[400,4597,4598,4600,4603,4606,4608],{"class":402,"line":410},[400,4599,414],{"class":413},[400,4601,4602],{"class":413}," INDEX",[400,4604,4605],{"class":420}," idx_customers_email",[400,4607,2134],{"class":413},[400,4609,4610],{"class":424}," customers(email);\n",[400,4612,4613],{"class":402,"line":428},[400,4614,1157],{"emptyLinePlaceholder":1156},[400,4616,4617],{"class":402,"line":443},[400,4618,4619],{"class":406},"-- Create a composite index (for queries that filter on both columns)\n",[400,4621,4622,4624,4626,4629,4631],{"class":402,"line":462},[400,4623,414],{"class":413},[400,4625,4602],{"class":413},[400,4627,4628],{"class":420}," idx_orders_customer_date",[400,4630,2134],{"class":413},[400,4632,4633],{"class":424}," orders(customer_id, order_date);\n",[400,4635,4636],{"class":402,"line":471},[400,4637,1157],{"emptyLinePlaceholder":1156},[400,4639,4640],{"class":402,"line":559},[400,4641,4642],{"class":406},"-- Unique index (also enforces uniqueness like a UNIQUE constraint)\n",[400,4644,4645,4647,4650,4653,4655],{"class":402,"line":1456},[400,4646,414],{"class":413},[400,4648,4649],{"class":413}," UNIQUE INDEX",[400,4651,4652],{"class":420}," idx_products_sku",[400,4654,2134],{"class":413},[400,4656,4657],{"class":424}," products(sku);\n",[400,4659,4660],{"class":402,"line":1556},[400,4661,1157],{"emptyLinePlaceholder":1156},[400,4663,4664],{"class":402,"line":1561},[400,4665,4666],{"class":406},"-- Drop an index\n",[400,4668,4669,4671,4673],{"class":402,"line":1567},[400,4670,1237],{"class":413},[400,4672,4602],{"class":413},[400,4674,4675],{"class":424}," idx_customers_email;\n",[16,4677,4678],{},[28,4679,4680],{},"When to add an index:",[67,4682,4683,4695,4698],{},[70,4684,4685,4686,872,4688,4691,4692,4694],{},"Columns frequently used in ",[322,4687,1141],{},[322,4689,4690],{},"JOIN ON",", or ",[322,4693,2015],{}," clauses",[70,4696,4697],{},"Foreign key columns (most RDBMS recommend this)",[70,4699,4700],{},"Columns with high cardinality (many distinct values)",[16,4702,4703],{},[28,4704,4705],{},"When NOT to add an index:",[67,4707,4708,4711,4714],{},[70,4709,4710],{},"Small tables (full scan is fast enough)",[70,4712,4713],{},"Columns rarely used in queries",[70,4715,4716,4717,4719,4720,4719,4722,4724],{},"Tables with very frequent ",[322,4718,1258],{},"/",[322,4721,1261],{},[322,4723,1264],{}," (indexes slow down writes)",[106,4726,4727],{},[16,4728,4729,4732,4733,347,4736,4739,4740,35],{},[28,4730,4731],{},"Rule of thumb:"," Add indexes based on actual query patterns, not\npreemptively on every column. Use ",[322,4734,4735],{},"EXPLAIN",[322,4737,4738],{},"EXPLAIN ANALYZE"," to see\nhow the database is executing a query — this is your primary tool for\n",[28,4741,4742],{},"query optimization",[119,4744],{},[11,4746,4748],{"id":4747},"_8-transactions-acid-properties","8. Transactions & ACID Properties",[16,4750,38,4751,4754,4755,4758],{},[28,4752,4753],{},"transaction"," is a sequence of SQL operations treated as a ",[28,4756,4757],{},"single unit\nof work"," — either all of them succeed, or none of them do.",[52,4760,4762],{"id":4761},"the-classic-bank-transfer-example","The Classic Bank Transfer Example",[315,4764,4766],{"className":394,"code":4765,"language":396,"meta":324,"style":324},"BEGIN;  -- Start the transaction\n\n    -- Step 1: Deduct money from Rahul's account\n    UPDATE accounts SET balance = balance - 1000 WHERE id = 1;\n\n    -- Step 2: Add money to Priya's account\n    UPDATE accounts SET balance = balance + 1000 WHERE id = 2;\n\nCOMMIT; -- Only now are changes written permanently\n",[322,4767,4768,4777,4781,4786,4814,4818,4823,4851,4855],{"__ignoreMap":324},[400,4769,4770,4772,4774],{"class":402,"line":403},[400,4771,2157],{"class":413},[400,4773,2231],{"class":424},[400,4775,4776],{"class":406},"-- Start the transaction\n",[400,4778,4779],{"class":402,"line":410},[400,4780,1157],{"emptyLinePlaceholder":1156},[400,4782,4783],{"class":402,"line":428},[400,4784,4785],{"class":406},"    -- Step 1: Deduct money from Rahul's account\n",[400,4787,4788,4790,4792,4794,4796,4798,4800,4802,4804,4806,4808,4810,4812],{"class":402,"line":443},[400,4789,2164],{"class":413},[400,4791,2167],{"class":424},[400,4793,1812],{"class":413},[400,4795,2172],{"class":424},[400,4797,1066],{"class":413},[400,4799,2172],{"class":424},[400,4801,2179],{"class":413},[400,4803,2295],{"class":455},[400,4805,2185],{"class":413},[400,4807,2188],{"class":424},[400,4809,1066],{"class":413},[400,4811,1844],{"class":455},[400,4813,1151],{"class":424},[400,4815,4816],{"class":402,"line":462},[400,4817,1157],{"emptyLinePlaceholder":1156},[400,4819,4820],{"class":402,"line":471},[400,4821,4822],{"class":406},"    -- Step 2: Add money to Priya's account\n",[400,4824,4825,4827,4829,4831,4833,4835,4837,4839,4841,4843,4845,4847,4849],{"class":402,"line":559},[400,4826,2164],{"class":413},[400,4828,2167],{"class":424},[400,4830,1812],{"class":413},[400,4832,2172],{"class":424},[400,4834,1066],{"class":413},[400,4836,2172],{"class":424},[400,4838,2211],{"class":413},[400,4840,2295],{"class":455},[400,4842,2185],{"class":413},[400,4844,2188],{"class":424},[400,4846,1066],{"class":413},[400,4848,2222],{"class":455},[400,4850,1151],{"class":424},[400,4852,4853],{"class":402,"line":1456},[400,4854,1157],{"emptyLinePlaceholder":1156},[400,4856,4857,4859,4862],{"class":402,"line":1556},[400,4858,1320],{"class":413},[400,4860,4861],{"class":424},"; ",[400,4863,4864],{"class":406},"-- Only now are changes written permanently\n",[16,4866,4867,4868,4870],{},"If the database crashes between Step 1 and Step 2, the ",[322,4869,1323],{}," happens\nautomatically — Rahul's money is returned. You never lose money in the void.",[52,4872,4874],{"id":4873},"acid-properties-in-sql","ACID Properties in SQL",[16,4876,4877,4880],{},[28,4878,4879],{},"ACID properties"," are the set of guarantees every proper RDBMS provides for\ntransactions. For anyone learning SQL for computer science students or backend\ndevelopment, this is non-negotiable knowledge:",[135,4882,4883,4896],{},[138,4884,4885],{},[141,4886,4887,4890,4893],{},[144,4888,4889],{},"Property",[144,4891,4892],{},"What It Means",[144,4894,4895],{},"Real-World Analogy",[154,4897,4898,4912,4926,4940],{},[141,4899,4900,4906,4909],{},[159,4901,4902,4905],{},[28,4903,4904],{},"A","tomicity",[159,4907,4908],{},"All operations succeed, or none do",[159,4910,4911],{},"A flight booking — you either get the seat AND pay, or neither happens",[141,4913,4914,4920,4923],{},[159,4915,4916,4919],{},[28,4917,4918],{},"C","onsistency",[159,4921,4922],{},"The database moves from one valid state to another",[159,4924,4925],{},"A bank's total money never changes from a transfer",[141,4927,4928,4934,4937],{},[159,4929,4930,4933],{},[28,4931,4932],{},"I","solation",[159,4935,4936],{},"Concurrent transactions don't interfere with each other",[159,4938,4939],{},"Two cashiers at a bank can serve customers simultaneously without error",[141,4941,4942,4948,4951],{},[159,4943,4944,4947],{},[28,4945,4946],{},"D","urability",[159,4949,4950],{},"Once committed, changes survive crashes",[159,4952,4953],{},"A receipt means the transaction is permanent",[315,4955,4957],{"className":394,"code":4956,"language":396,"meta":324,"style":324},"-- Savepoints allow partial rollbacks within a transaction\nBEGIN;\n    INSERT INTO orders (...) VALUES (...);\n    SAVEPOINT order_created;\n\n    INSERT INTO payments (...) VALUES (...);\n    -- Something went wrong with payment:\n    ROLLBACK TO SAVEPOINT order_created;  -- Undo only the payment insert\n\nCOMMIT;  -- The order insert still gets committed\n",[322,4958,4959,4964,4970,4983,4988,4992,5003,5008,5022,5026],{"__ignoreMap":324},[400,4960,4961],{"class":402,"line":403},[400,4962,4963],{"class":406},"-- Savepoints allow partial rollbacks within a transaction\n",[400,4965,4966,4968],{"class":402,"line":410},[400,4967,2157],{"class":413},[400,4969,1151],{"class":424},[400,4971,4972,4975,4978,4980],{"class":402,"line":428},[400,4973,4974],{"class":413},"    INSERT INTO",[400,4976,4977],{"class":424}," orders (...) ",[400,4979,1671],{"class":413},[400,4981,4982],{"class":424}," (...);\n",[400,4984,4985],{"class":402,"line":443},[400,4986,4987],{"class":424},"    SAVEPOINT order_created;\n",[400,4989,4990],{"class":402,"line":462},[400,4991,1157],{"emptyLinePlaceholder":1156},[400,4993,4994,4996,4999,5001],{"class":402,"line":471},[400,4995,4974],{"class":413},[400,4997,4998],{"class":424}," payments (...) ",[400,5000,1671],{"class":413},[400,5002,4982],{"class":424},[400,5004,5005],{"class":402,"line":559},[400,5006,5007],{"class":406},"    -- Something went wrong with payment:\n",[400,5009,5010,5013,5016,5019],{"class":402,"line":1456},[400,5011,5012],{"class":413},"    ROLLBACK",[400,5014,5015],{"class":413}," TO",[400,5017,5018],{"class":424}," SAVEPOINT order_created;  ",[400,5020,5021],{"class":406},"-- Undo only the payment insert\n",[400,5023,5024],{"class":402,"line":1556},[400,5025,1157],{"emptyLinePlaceholder":1156},[400,5027,5028,5030,5032],{"class":402,"line":1561},[400,5029,1320],{"class":413},[400,5031,2231],{"class":424},[400,5033,5034],{"class":406},"-- The order insert still gets committed\n",[119,5036],{},[11,5038,5040],{"id":5039},"_9-views","9. Views",[16,5042,38,5043,5046,5047,5050],{},[28,5044,5045],{},"view"," is a saved SQL query that you can treat like a virtual table. The\nview itself stores no data — it executes the underlying query every time you\nselect from it. Views are an elegant tool for simplifying complex ",[28,5048,5049],{},"database\nmanagement system"," operations.",[315,5052,5054],{"className":394,"code":5053,"language":396,"meta":324,"style":324},"-- Create a view for frequently needed customer order summary\nCREATE VIEW customer_order_summary AS\nSELECT\n    c.id,\n    c.name,\n    c.email,\n    COUNT(o.id)       AS total_orders,\n    SUM(o.total_amount) AS lifetime_value\nFROM customers c\nLEFT JOIN orders o ON c.id = o.customer_id\nGROUP BY c.id, c.name, c.email;\n\n-- Now use it just like a regular table\nSELECT * FROM customer_order_summary WHERE lifetime_value > 10000;\nSELECT name, total_orders FROM customer_order_summary ORDER BY total_orders DESC LIMIT 10;\n\n-- Drop a view\nDROP VIEW customer_order_summary;\n",[322,5055,5056,5061,5074,5078,5088,5098,5108,5127,5146,5152,5174,5203,5207,5212,5235,5261,5265,5270],{"__ignoreMap":324},[400,5057,5058],{"class":402,"line":403},[400,5059,5060],{"class":406},"-- Create a view for frequently needed customer order summary\n",[400,5062,5063,5065,5068,5071],{"class":402,"line":410},[400,5064,414],{"class":413},[400,5066,5067],{"class":413}," VIEW",[400,5069,5070],{"class":420}," customer_order_summary",[400,5072,5073],{"class":413}," AS\n",[400,5075,5076],{"class":402,"line":428},[400,5077,2069],{"class":413},[400,5079,5080,5082,5084,5086],{"class":402,"line":443},[400,5081,3330],{"class":455},[400,5083,35],{"class":424},[400,5085,3349],{"class":455},[400,5087,440],{"class":424},[400,5089,5090,5092,5094,5096],{"class":402,"line":462},[400,5091,3330],{"class":455},[400,5093,35],{"class":424},[400,5095,1521],{"class":455},[400,5097,440],{"class":424},[400,5099,5100,5102,5104,5106],{"class":402,"line":471},[400,5101,3330],{"class":455},[400,5103,35],{"class":424},[400,5105,621],{"class":455},[400,5107,440],{"class":424},[400,5109,5110,5112,5114,5116,5118,5120,5122,5124],{"class":402,"line":559},[400,5111,3012],{"class":455},[400,5113,452],{"class":424},[400,5115,3556],{"class":455},[400,5117,35],{"class":424},[400,5119,3349],{"class":455},[400,5121,3019],{"class":424},[400,5123,2089],{"class":413},[400,5125,5126],{"class":424}," total_orders,\n",[400,5128,5129,5131,5133,5135,5137,5139,5141,5143],{"class":402,"line":1456},[400,5130,3042],{"class":455},[400,5132,452],{"class":424},[400,5134,3556],{"class":455},[400,5136,35],{"class":424},[400,5138,3364],{"class":455},[400,5140,1381],{"class":424},[400,5142,2089],{"class":413},[400,5144,5145],{"class":424}," lifetime_value\n",[400,5147,5148,5150],{"class":402,"line":1556},[400,5149,2000],{"class":413},[400,5151,3382],{"class":424},[400,5153,5154,5156,5158,5160,5162,5164,5166,5168,5170,5172],{"class":402,"line":1561},[400,5155,3490],{"class":413},[400,5157,3389],{"class":424},[400,5159,3392],{"class":413},[400,5161,3395],{"class":455},[400,5163,35],{"class":424},[400,5165,3349],{"class":455},[400,5167,3402],{"class":413},[400,5169,3405],{"class":455},[400,5171,35],{"class":424},[400,5173,3745],{"class":455},[400,5175,5176,5178,5180,5182,5184,5186,5189,5191,5193,5195,5197,5199,5201],{"class":402,"line":1567},[400,5177,3061],{"class":413},[400,5179,3395],{"class":455},[400,5181,35],{"class":424},[400,5183,3349],{"class":455},[400,5185,872],{"class":424},[400,5187,5188],{"class":455},"c",[400,5190,35],{"class":424},[400,5192,1521],{"class":455},[400,5194,872],{"class":424},[400,5196,5188],{"class":455},[400,5198,35],{"class":424},[400,5200,621],{"class":455},[400,5202,1151],{"class":424},[400,5204,5205],{"class":402,"line":2066},[400,5206,1157],{"emptyLinePlaceholder":1156},[400,5208,5209],{"class":402,"line":2072},[400,5210,5211],{"class":406},"-- Now use it just like a regular table\n",[400,5213,5214,5216,5218,5220,5223,5225,5228,5230,5233],{"class":402,"line":2083},[400,5215,1129],{"class":413},[400,5217,1132],{"class":413},[400,5219,1135],{"class":413},[400,5221,5222],{"class":424}," customer_order_summary ",[400,5224,1141],{"class":413},[400,5226,5227],{"class":424}," lifetime_value ",[400,5229,2292],{"class":413},[400,5231,5232],{"class":455}," 10000",[400,5234,1151],{"class":424},[400,5236,5237,5239,5241,5244,5246,5248,5250,5253,5255,5257,5259],{"class":402,"line":2095},[400,5238,1129],{"class":413},[400,5240,2332],{"class":413},[400,5242,5243],{"class":424},", total_orders ",[400,5245,2000],{"class":413},[400,5247,5222],{"class":424},[400,5249,2015],{"class":413},[400,5251,5252],{"class":424}," total_orders ",[400,5254,2708],{"class":413},[400,5256,2770],{"class":413},[400,5258,2572],{"class":455},[400,5260,1151],{"class":424},[400,5262,5263],{"class":402,"line":2106},[400,5264,1157],{"emptyLinePlaceholder":1156},[400,5266,5267],{"class":402,"line":2505},[400,5268,5269],{"class":406},"-- Drop a view\n",[400,5271,5272,5274,5276],{"class":402,"line":2511},[400,5273,1237],{"class":413},[400,5275,5067],{"class":413},[400,5277,5278],{"class":424}," customer_order_summary;\n",[16,5280,5281],{},[28,5282,5283],{},"Benefits of Views:",[67,5285,5286,5292,5298,5304],{},[70,5287,5288,5291],{},[28,5289,5290],{},"Simplicity:"," Hide complex joins behind a simple name",[70,5293,5294,5297],{},[28,5295,5296],{},"Security:"," Expose only certain columns to certain users",[70,5299,5300,5303],{},[28,5301,5302],{},"Consistency:"," Everyone queries the same definition",[70,5305,5306,5309],{},[28,5307,5308],{},"Maintainability:"," Change the query in one place",[119,5311],{},[11,5313,5315],{"id":5314},"_10-a-complete-practical-project","10. A Complete Practical Project",[16,5317,5318,5319,5321,5322,5325],{},"Let's ",[28,5320,4325],{}," — a minimal but real\n",[28,5323,5324],{},"Library Management System",". This is a great hands-on exercise for anyone\nfollowing this relational database tutorial.",[52,5327,5329],{"id":5328},"step-1-design-the-schema","Step 1: Design the Schema",[16,5331,5332],{},[59,5333],{"alt":5334,"src":5335},"Library Management System Database Schema Diagram","/post-images/sql-made-dead-simple-rdbms-guide/library-management-system-database-schema-diagram.png",[315,5337,5339],{"className":394,"code":5338,"language":396,"meta":324,"style":324},"-- Authors\nCREATE TABLE authors (\n    id         SERIAL PRIMARY KEY,\n    name       VARCHAR(150) NOT NULL,\n    country    VARCHAR(100),\n    birth_year INT CHECK (birth_year > 1000)\n);\n\n-- Books\nCREATE TABLE books (\n    id            SERIAL PRIMARY KEY,\n    title         VARCHAR(255) NOT NULL,\n    author_id     INT NOT NULL REFERENCES authors(id),\n    isbn          VARCHAR(20) UNIQUE,\n    published_year INT,\n    genre         VARCHAR(100),\n    total_copies  INT DEFAULT 1 CHECK (total_copies >= 0)\n);\n\n-- Members\nCREATE TABLE members (\n    id           SERIAL PRIMARY KEY,\n    name         VARCHAR(150) NOT NULL,\n    email        VARCHAR(255) NOT NULL UNIQUE,\n    joined_on    DATE DEFAULT CURRENT_DATE,\n    is_active    BOOLEAN DEFAULT TRUE\n);\n\n-- Borrowing records\nCREATE TABLE borrowings (\n    id            SERIAL PRIMARY KEY,\n    book_id       INT NOT NULL REFERENCES books(id),\n    member_id     INT NOT NULL REFERENCES members(id),\n    borrowed_on   DATE NOT NULL DEFAULT CURRENT_DATE,\n    due_on        DATE NOT NULL,\n    returned_on   DATE\n);\n",[322,5340,5341,5346,5357,5367,5384,5397,5417,5421,5425,5430,5441,5452,5469,5484,5502,5511,5524,5547,5551,5555,5560,5571,5582,5598,5617,5629,5641,5645,5649,5655,5667,5678,5693,5708,5722,5734,5742],{"__ignoreMap":324},[400,5342,5343],{"class":402,"line":403},[400,5344,5345],{"class":406},"-- Authors\n",[400,5347,5348,5350,5352,5355],{"class":402,"line":410},[400,5349,414],{"class":413},[400,5351,417],{"class":413},[400,5353,5354],{"class":420}," authors",[400,5356,425],{"class":424},[400,5358,5359,5361,5363,5365],{"class":402,"line":428},[400,5360,4100],{"class":424},[400,5362,1358],{"class":413},[400,5364,437],{"class":413},[400,5366,440],{"class":424},[400,5368,5369,5371,5373,5375,5378,5380,5382],{"class":402,"line":443},[400,5370,446],{"class":413},[400,5372,449],{"class":413},[400,5374,452],{"class":424},[400,5376,5377],{"class":455},"150",[400,5379,1381],{"class":424},[400,5381,1384],{"class":413},[400,5383,440],{"class":424},[400,5385,5386,5389,5391,5393,5395],{"class":402,"line":462},[400,5387,5388],{"class":424},"    country    ",[400,5390,1490],{"class":413},[400,5392,452],{"class":424},[400,5394,456],{"class":455},[400,5396,459],{"class":424},[400,5398,5399,5402,5404,5407,5410,5412,5414],{"class":402,"line":471},[400,5400,5401],{"class":424},"    birth_year ",[400,5403,434],{"class":413},[400,5405,5406],{"class":413}," CHECK",[400,5408,5409],{"class":424}," (birth_year ",[400,5411,2292],{"class":413},[400,5413,2295],{"class":455},[400,5415,5416],{"class":424},")\n",[400,5418,5419],{"class":402,"line":559},[400,5420,474],{"class":424},[400,5422,5423],{"class":402,"line":1456},[400,5424,1157],{"emptyLinePlaceholder":1156},[400,5426,5427],{"class":402,"line":1556},[400,5428,5429],{"class":406},"-- Books\n",[400,5431,5432,5434,5436,5439],{"class":402,"line":1561},[400,5433,414],{"class":413},[400,5435,417],{"class":413},[400,5437,5438],{"class":420}," books",[400,5440,425],{"class":424},[400,5442,5443,5446,5448,5450],{"class":402,"line":1567},[400,5444,5445],{"class":424},"    id            ",[400,5447,1358],{"class":413},[400,5449,437],{"class":413},[400,5451,440],{"class":424},[400,5453,5454,5457,5459,5461,5463,5465,5467],{"class":402,"line":2066},[400,5455,5456],{"class":424},"    title         ",[400,5458,1490],{"class":413},[400,5460,452],{"class":424},[400,5462,4118],{"class":455},[400,5464,1381],{"class":424},[400,5466,1384],{"class":413},[400,5468,440],{"class":424},[400,5470,5471,5474,5476,5479,5481],{"class":402,"line":2072},[400,5472,5473],{"class":424},"    author_id     ",[400,5475,434],{"class":413},[400,5477,5478],{"class":413}," NOT NULL",[400,5480,533],{"class":413},[400,5482,5483],{"class":424}," authors(id),\n",[400,5485,5486,5489,5491,5493,5496,5498,5500],{"class":402,"line":2083},[400,5487,5488],{"class":424},"    isbn          ",[400,5490,1490],{"class":413},[400,5492,452],{"class":424},[400,5494,5495],{"class":455},"20",[400,5497,1381],{"class":424},[400,5499,4056],{"class":413},[400,5501,440],{"class":424},[400,5503,5504,5507,5509],{"class":402,"line":2095},[400,5505,5506],{"class":424},"    published_year ",[400,5508,434],{"class":413},[400,5510,440],{"class":424},[400,5512,5513,5516,5518,5520,5522],{"class":402,"line":2106},[400,5514,5515],{"class":424},"    genre         ",[400,5517,1490],{"class":413},[400,5519,452],{"class":424},[400,5521,456],{"class":455},[400,5523,459],{"class":424},[400,5525,5526,5529,5531,5533,5535,5537,5540,5543,5545],{"class":402,"line":2505},[400,5527,5528],{"class":424},"    total_copies  ",[400,5530,434],{"class":413},[400,5532,1434],{"class":413},[400,5534,1844],{"class":455},[400,5536,5406],{"class":413},[400,5538,5539],{"class":424}," (total_copies ",[400,5541,5542],{"class":413},">=",[400,5544,1069],{"class":455},[400,5546,5416],{"class":424},[400,5548,5549],{"class":402,"line":2511},[400,5550,474],{"class":424},[400,5552,5553],{"class":402,"line":2532},[400,5554,1157],{"emptyLinePlaceholder":1156},[400,5556,5557],{"class":402,"line":2537},[400,5558,5559],{"class":406},"-- Members\n",[400,5561,5562,5564,5566,5569],{"class":402,"line":2543},[400,5563,414],{"class":413},[400,5565,417],{"class":413},[400,5567,5568],{"class":420}," members",[400,5570,425],{"class":424},[400,5572,5573,5576,5578,5580],{"class":402,"line":2554},[400,5574,5575],{"class":424},"    id           ",[400,5577,1358],{"class":413},[400,5579,437],{"class":413},[400,5581,440],{"class":424},[400,5583,5584,5586,5588,5590,5592,5594,5596],{"class":402,"line":2577},[400,5585,446],{"class":413},[400,5587,1373],{"class":413},[400,5589,452],{"class":424},[400,5591,5377],{"class":455},[400,5593,1381],{"class":424},[400,5595,1384],{"class":413},[400,5597,440],{"class":424},[400,5599,5600,5603,5605,5607,5609,5611,5613,5615],{"class":402,"line":2582},[400,5601,5602],{"class":424},"    email        ",[400,5604,1490],{"class":413},[400,5606,452],{"class":424},[400,5608,4118],{"class":455},[400,5610,1381],{"class":424},[400,5612,1384],{"class":413},[400,5614,4125],{"class":413},[400,5616,440],{"class":424},[400,5618,5619,5622,5624,5626],{"class":402,"line":2593},[400,5620,5621],{"class":424},"    joined_on    ",[400,5623,973],{"class":413},[400,5625,1434],{"class":413},[400,5627,5628],{"class":424}," CURRENT_DATE,\n",[400,5630,5631,5634,5636,5638],{"class":402,"line":2616},[400,5632,5633],{"class":424},"    is_active    ",[400,5635,953],{"class":413},[400,5637,1434],{"class":413},[400,5639,5640],{"class":424}," TRUE\n",[400,5642,5643],{"class":402,"line":2621},[400,5644,474],{"class":424},[400,5646,5647],{"class":402,"line":2627},[400,5648,1157],{"emptyLinePlaceholder":1156},[400,5650,5652],{"class":402,"line":5651},29,[400,5653,5654],{"class":406},"-- Borrowing records\n",[400,5656,5658,5660,5662,5665],{"class":402,"line":5657},30,[400,5659,414],{"class":413},[400,5661,417],{"class":413},[400,5663,5664],{"class":420}," borrowings",[400,5666,425],{"class":424},[400,5668,5670,5672,5674,5676],{"class":402,"line":5669},31,[400,5671,5445],{"class":424},[400,5673,1358],{"class":413},[400,5675,437],{"class":413},[400,5677,440],{"class":424},[400,5679,5681,5684,5686,5688,5690],{"class":402,"line":5680},32,[400,5682,5683],{"class":424},"    book_id       ",[400,5685,434],{"class":413},[400,5687,5478],{"class":413},[400,5689,533],{"class":413},[400,5691,5692],{"class":424}," books(id),\n",[400,5694,5696,5699,5701,5703,5705],{"class":402,"line":5695},33,[400,5697,5698],{"class":424},"    member_id     ",[400,5700,434],{"class":413},[400,5702,5478],{"class":413},[400,5704,533],{"class":413},[400,5706,5707],{"class":424}," members(id),\n",[400,5709,5711,5714,5716,5718,5720],{"class":402,"line":5710},34,[400,5712,5713],{"class":424},"    borrowed_on   ",[400,5715,973],{"class":413},[400,5717,5478],{"class":413},[400,5719,1434],{"class":413},[400,5721,5628],{"class":424},[400,5723,5725,5728,5730,5732],{"class":402,"line":5724},35,[400,5726,5727],{"class":424},"    due_on        ",[400,5729,973],{"class":413},[400,5731,5478],{"class":413},[400,5733,440],{"class":424},[400,5735,5737,5740],{"class":402,"line":5736},36,[400,5738,5739],{"class":424},"    returned_on   ",[400,5741,556],{"class":413},[400,5743,5745],{"class":402,"line":5744},37,[400,5746,474],{"class":424},[52,5748,5750],{"id":5749},"step-2-insert-sample-data","Step 2: Insert Sample Data",[315,5752,5754],{"className":394,"code":5753,"language":396,"meta":324,"style":324},"INSERT INTO authors (name, country, birth_year) VALUES\n    ('George Orwell', 'United Kingdom', 1903),\n    ('Yuval Noah Harari', 'Israel', 1976),\n    ('Robert C. Martin', 'United States', 1952);\n\nINSERT INTO books (title, author_id, isbn, published_year, genre, total_copies) VALUES\n    ('1984',                1, '978-0451524935', 1949, 'Dystopian', 5),\n    ('Animal Farm',         1, '978-0451526342', 1945, 'Satire',    3),\n    ('Sapiens',             2, '978-0062316097', 2011, 'Non-Fiction', 4),\n    ('Clean Code',          3, '978-0132350884', 2008, 'Technology', 2);\n\nINSERT INTO members (name, email) VALUES\n    ('Priya Sharma', 'priya@example.com'),\n    ('Rahul Das',    'rahul@example.com'),\n    ('Aisha Khan',   'aisha@example.com');\n\nINSERT INTO borrowings (book_id, member_id, borrowed_on, due_on, returned_on) VALUES\n    (1, 1, '2024-01-10', '2024-01-24', '2024-01-20'),  -- returned\n    (3, 2, '2024-01-15', '2024-01-29', NULL),           -- still out\n    (1, 3, '2024-01-18', '2024-02-01', NULL);            -- still out\n",[322,5755,5756,5770,5789,5808,5827,5831,5840,5874,5909,5942,5975,5979,5993,6007,6021,6036,6040,6049,6080,6110],{"__ignoreMap":324},[400,5757,5758,5760,5763,5765,5768],{"class":402,"line":403},[400,5759,1658],{"class":413},[400,5761,5762],{"class":424}," authors (",[400,5764,1521],{"class":413},[400,5766,5767],{"class":424},", country, birth_year) ",[400,5769,1717],{"class":413},[400,5771,5772,5774,5777,5779,5782,5784,5787],{"class":402,"line":410},[400,5773,1722],{"class":424},[400,5775,5776],{"class":1081},"'George Orwell'",[400,5778,872],{"class":424},[400,5780,5781],{"class":1081},"'United Kingdom'",[400,5783,872],{"class":424},[400,5785,5786],{"class":455},"1903",[400,5788,459],{"class":424},[400,5790,5791,5793,5796,5798,5801,5803,5806],{"class":402,"line":428},[400,5792,1722],{"class":424},[400,5794,5795],{"class":1081},"'Yuval Noah Harari'",[400,5797,872],{"class":424},[400,5799,5800],{"class":1081},"'Israel'",[400,5802,872],{"class":424},[400,5804,5805],{"class":455},"1976",[400,5807,459],{"class":424},[400,5809,5810,5812,5815,5817,5820,5822,5825],{"class":402,"line":443},[400,5811,1722],{"class":424},[400,5813,5814],{"class":1081},"'Robert C. Martin'",[400,5816,872],{"class":424},[400,5818,5819],{"class":1081},"'United States'",[400,5821,872],{"class":424},[400,5823,5824],{"class":455},"1952",[400,5826,474],{"class":424},[400,5828,5829],{"class":402,"line":462},[400,5830,1157],{"emptyLinePlaceholder":1156},[400,5832,5833,5835,5838],{"class":402,"line":471},[400,5834,1658],{"class":413},[400,5836,5837],{"class":424}," books (title, author_id, isbn, published_year, genre, total_copies) ",[400,5839,1717],{"class":413},[400,5841,5842,5844,5847,5850,5852,5854,5857,5859,5862,5864,5867,5869,5872],{"class":402,"line":559},[400,5843,1722],{"class":424},[400,5845,5846],{"class":1081},"'1984'",[400,5848,5849],{"class":424},",                ",[400,5851,883],{"class":455},[400,5853,872],{"class":424},[400,5855,5856],{"class":1081},"'978-0451524935'",[400,5858,872],{"class":424},[400,5860,5861],{"class":455},"1949",[400,5863,872],{"class":424},[400,5865,5866],{"class":1081},"'Dystopian'",[400,5868,872],{"class":424},[400,5870,5871],{"class":455},"5",[400,5873,459],{"class":424},[400,5875,5876,5878,5881,5884,5886,5888,5891,5893,5896,5898,5901,5904,5907],{"class":402,"line":1456},[400,5877,1722],{"class":424},[400,5879,5880],{"class":1081},"'Animal Farm'",[400,5882,5883],{"class":424},",         ",[400,5885,883],{"class":455},[400,5887,872],{"class":424},[400,5889,5890],{"class":1081},"'978-0451526342'",[400,5892,872],{"class":424},[400,5894,5895],{"class":455},"1945",[400,5897,872],{"class":424},[400,5899,5900],{"class":1081},"'Satire'",[400,5902,5903],{"class":424},",    ",[400,5905,5906],{"class":455},"3",[400,5908,459],{"class":424},[400,5910,5911,5913,5916,5919,5921,5923,5926,5928,5931,5933,5936,5938,5940],{"class":402,"line":1556},[400,5912,1722],{"class":424},[400,5914,5915],{"class":1081},"'Sapiens'",[400,5917,5918],{"class":424},",             ",[400,5920,1414],{"class":455},[400,5922,872],{"class":424},[400,5924,5925],{"class":1081},"'978-0062316097'",[400,5927,872],{"class":424},[400,5929,5930],{"class":455},"2011",[400,5932,872],{"class":424},[400,5934,5935],{"class":1081},"'Non-Fiction'",[400,5937,872],{"class":424},[400,5939,2857],{"class":455},[400,5941,459],{"class":424},[400,5943,5944,5946,5949,5952,5954,5956,5959,5961,5964,5966,5969,5971,5973],{"class":402,"line":1561},[400,5945,1722],{"class":424},[400,5947,5948],{"class":1081},"'Clean Code'",[400,5950,5951],{"class":424},",          ",[400,5953,5906],{"class":455},[400,5955,872],{"class":424},[400,5957,5958],{"class":1081},"'978-0132350884'",[400,5960,872],{"class":424},[400,5962,5963],{"class":455},"2008",[400,5965,872],{"class":424},[400,5967,5968],{"class":1081},"'Technology'",[400,5970,872],{"class":424},[400,5972,1414],{"class":455},[400,5974,474],{"class":424},[400,5976,5977],{"class":402,"line":1567},[400,5978,1157],{"emptyLinePlaceholder":1156},[400,5980,5981,5983,5986,5988,5991],{"class":402,"line":2066},[400,5982,1658],{"class":413},[400,5984,5985],{"class":424}," members (",[400,5987,1521],{"class":413},[400,5989,5990],{"class":424},", email) ",[400,5992,1717],{"class":413},[400,5994,5995,5997,6000,6002,6005],{"class":402,"line":2072},[400,5996,1722],{"class":424},[400,5998,5999],{"class":1081},"'Priya Sharma'",[400,6001,872],{"class":424},[400,6003,6004],{"class":1081},"'priya@example.com'",[400,6006,459],{"class":424},[400,6008,6009,6011,6014,6016,6019],{"class":402,"line":2083},[400,6010,1722],{"class":424},[400,6012,6013],{"class":1081},"'Rahul Das'",[400,6015,5903],{"class":424},[400,6017,6018],{"class":1081},"'rahul@example.com'",[400,6020,459],{"class":424},[400,6022,6023,6025,6028,6031,6034],{"class":402,"line":2095},[400,6024,1722],{"class":424},[400,6026,6027],{"class":1081},"'Aisha Khan'",[400,6029,6030],{"class":424},",   ",[400,6032,6033],{"class":1081},"'aisha@example.com'",[400,6035,474],{"class":424},[400,6037,6038],{"class":402,"line":2106},[400,6039,1157],{"emptyLinePlaceholder":1156},[400,6041,6042,6044,6047],{"class":402,"line":2505},[400,6043,1658],{"class":413},[400,6045,6046],{"class":424}," borrowings (book_id, member_id, borrowed_on, due_on, returned_on) ",[400,6048,1717],{"class":413},[400,6050,6051,6053,6055,6057,6059,6061,6064,6066,6069,6071,6074,6077],{"class":402,"line":2511},[400,6052,1722],{"class":424},[400,6054,883],{"class":455},[400,6056,872],{"class":424},[400,6058,883],{"class":455},[400,6060,872],{"class":424},[400,6062,6063],{"class":1081},"'2024-01-10'",[400,6065,872],{"class":424},[400,6067,6068],{"class":1081},"'2024-01-24'",[400,6070,872],{"class":424},[400,6072,6073],{"class":1081},"'2024-01-20'",[400,6075,6076],{"class":424},"),  ",[400,6078,6079],{"class":406},"-- returned\n",[400,6081,6082,6084,6086,6088,6090,6092,6095,6097,6100,6102,6104,6107],{"class":402,"line":2532},[400,6083,1722],{"class":424},[400,6085,5906],{"class":455},[400,6087,872],{"class":424},[400,6089,1414],{"class":455},[400,6091,872],{"class":424},[400,6093,6094],{"class":1081},"'2024-01-15'",[400,6096,872],{"class":424},[400,6098,6099],{"class":1081},"'2024-01-29'",[400,6101,872],{"class":424},[400,6103,1033],{"class":413},[400,6105,6106],{"class":424},"),           ",[400,6108,6109],{"class":406},"-- still out\n",[400,6111,6112,6114,6116,6118,6120,6122,6125,6127,6130,6132,6134,6137],{"class":402,"line":2537},[400,6113,1722],{"class":424},[400,6115,883],{"class":455},[400,6117,872],{"class":424},[400,6119,5906],{"class":455},[400,6121,872],{"class":424},[400,6123,6124],{"class":1081},"'2024-01-18'",[400,6126,872],{"class":424},[400,6128,6129],{"class":1081},"'2024-02-01'",[400,6131,872],{"class":424},[400,6133,1033],{"class":413},[400,6135,6136],{"class":424},");            ",[400,6138,6109],{"class":406},[52,6140,6142],{"id":6141},"step-3-useful-queries","Step 3: Useful Queries",[315,6144,6146],{"className":394,"code":6145,"language":396,"meta":324,"style":324},"-- Q1: All books with their author names\nSELECT b.title, a.name AS author, b.genre, b.published_year\nFROM books b\nJOIN authors a ON b.author_id = a.id\nORDER BY b.published_year DESC;\n\n-- Q2: Which books are currently borrowed (not yet returned)?\nSELECT\n    m.name     AS member,\n    b.title    AS book,\n    br.borrowed_on,\n    br.due_on,\n    CURRENT_DATE - br.due_on AS days_overdue\nFROM borrowings br\nJOIN members m ON br.member_id = m.id\nJOIN books   b ON br.book_id   = b.id\nWHERE br.returned_on IS NULL;\n\n-- Q3: Members who have never borrowed a book\nSELECT m.name, m.email\nFROM members m\nLEFT JOIN borrowings br ON m.id = br.member_id\nWHERE br.id IS NULL;\n\n-- Q4: Most popular book (borrowed most times)\nSELECT b.title, COUNT(*) AS borrow_count\nFROM borrowings br\nJOIN books b ON br.book_id = b.id\nGROUP BY b.title\nORDER BY borrow_count DESC\nLIMIT 3;\n\n-- Q5: Create a view for the library dashboard\nCREATE VIEW library_dashboard AS\nSELECT\n    b.id,\n    b.title,\n    a.name AS author,\n    b.total_copies,\n    b.total_copies - COUNT(br.id) FILTER (WHERE br.returned_on IS NULL) AS available_copies\nFROM books b\nJOIN authors a ON b.author_id = a.id\nLEFT JOIN borrowings br ON b.id = br.book_id\nGROUP BY b.id, b.title, a.name, b.total_copies;\n\nSELECT * FROM library_dashboard;\n",[322,6147,6148,6153,6196,6203,6229,6245,6249,6254,6258,6273,6288,6300,6311,6330,6337,6362,6386,6404,6408,6413,6433,6440,6464,6480,6484,6489,6514,6520,6543,6554,6563,6571,6575,6580,6591,6595,6605,6615,6630,6642,6691,6698,6721,6745,6782,6787],{"__ignoreMap":324},[400,6149,6150],{"class":402,"line":403},[400,6151,6152],{"class":406},"-- Q1: All books with their author names\n",[400,6154,6155,6157,6160,6162,6165,6167,6170,6172,6174,6176,6179,6182,6184,6187,6189,6191,6193],{"class":402,"line":410},[400,6156,1129],{"class":413},[400,6158,6159],{"class":455}," b",[400,6161,35],{"class":424},[400,6163,6164],{"class":455},"title",[400,6166,872],{"class":424},[400,6168,6169],{"class":455},"a",[400,6171,35],{"class":424},[400,6173,1521],{"class":455},[400,6175,3563],{"class":413},[400,6177,6178],{"class":424}," author, ",[400,6180,6181],{"class":455},"b",[400,6183,35],{"class":424},[400,6185,6186],{"class":455},"genre",[400,6188,872],{"class":424},[400,6190,6181],{"class":455},[400,6192,35],{"class":424},[400,6194,6195],{"class":455},"published_year\n",[400,6197,6198,6200],{"class":402,"line":428},[400,6199,2000],{"class":413},[400,6201,6202],{"class":424}," books b\n",[400,6204,6205,6207,6210,6212,6214,6216,6219,6221,6224,6226],{"class":402,"line":443},[400,6206,3724],{"class":413},[400,6208,6209],{"class":424}," authors a ",[400,6211,3392],{"class":413},[400,6213,6159],{"class":455},[400,6215,35],{"class":424},[400,6217,6218],{"class":455},"author_id",[400,6220,3402],{"class":413},[400,6222,6223],{"class":455}," a",[400,6225,35],{"class":424},[400,6227,6228],{"class":455},"id\n",[400,6230,6231,6233,6235,6237,6240,6243],{"class":402,"line":462},[400,6232,2015],{"class":413},[400,6234,6159],{"class":455},[400,6236,35],{"class":424},[400,6238,6239],{"class":455},"published_year",[400,6241,6242],{"class":413}," DESC",[400,6244,1151],{"class":424},[400,6246,6247],{"class":402,"line":471},[400,6248,1157],{"emptyLinePlaceholder":1156},[400,6250,6251],{"class":402,"line":559},[400,6252,6253],{"class":406},"-- Q2: Which books are currently borrowed (not yet returned)?\n",[400,6255,6256],{"class":402,"line":1456},[400,6257,2069],{"class":413},[400,6259,6260,6263,6265,6267,6270],{"class":402,"line":1556},[400,6261,6262],{"class":455},"    m",[400,6264,35],{"class":424},[400,6266,1521],{"class":455},[400,6268,6269],{"class":413},"     AS",[400,6271,6272],{"class":424}," member,\n",[400,6274,6275,6278,6280,6282,6285],{"class":402,"line":1561},[400,6276,6277],{"class":455},"    b",[400,6279,35],{"class":424},[400,6281,6164],{"class":455},[400,6283,6284],{"class":413},"    AS",[400,6286,6287],{"class":424}," book,\n",[400,6289,6290,6293,6295,6298],{"class":402,"line":1567},[400,6291,6292],{"class":455},"    br",[400,6294,35],{"class":424},[400,6296,6297],{"class":455},"borrowed_on",[400,6299,440],{"class":424},[400,6301,6302,6304,6306,6309],{"class":402,"line":2066},[400,6303,6292],{"class":455},[400,6305,35],{"class":424},[400,6307,6308],{"class":455},"due_on",[400,6310,440],{"class":424},[400,6312,6313,6316,6318,6321,6323,6325,6327],{"class":402,"line":2072},[400,6314,6315],{"class":424},"    CURRENT_DATE ",[400,6317,2179],{"class":413},[400,6319,6320],{"class":455}," br",[400,6322,35],{"class":424},[400,6324,6308],{"class":455},[400,6326,3563],{"class":413},[400,6328,6329],{"class":424}," days_overdue\n",[400,6331,6332,6334],{"class":402,"line":2083},[400,6333,2000],{"class":413},[400,6335,6336],{"class":424}," borrowings br\n",[400,6338,6339,6341,6344,6346,6348,6350,6353,6355,6358,6360],{"class":402,"line":2095},[400,6340,3724],{"class":413},[400,6342,6343],{"class":424}," members m ",[400,6345,3392],{"class":413},[400,6347,6320],{"class":455},[400,6349,35],{"class":424},[400,6351,6352],{"class":455},"member_id",[400,6354,3402],{"class":413},[400,6356,6357],{"class":455}," m",[400,6359,35],{"class":424},[400,6361,6228],{"class":455},[400,6363,6364,6366,6369,6371,6373,6375,6378,6380,6382,6384],{"class":402,"line":2106},[400,6365,3724],{"class":413},[400,6367,6368],{"class":424}," books   b ",[400,6370,3392],{"class":413},[400,6372,6320],{"class":455},[400,6374,35],{"class":424},[400,6376,6377],{"class":455},"book_id",[400,6379,3789],{"class":413},[400,6381,6159],{"class":455},[400,6383,35],{"class":424},[400,6385,6228],{"class":455},[400,6387,6388,6390,6392,6394,6397,6400,6402],{"class":402,"line":2505},[400,6389,1141],{"class":413},[400,6391,6320],{"class":455},[400,6393,35],{"class":424},[400,6395,6396],{"class":455},"returned_on",[400,6398,6399],{"class":413}," IS",[400,6401,1094],{"class":413},[400,6403,1151],{"class":424},[400,6405,6406],{"class":402,"line":2511},[400,6407,1157],{"emptyLinePlaceholder":1156},[400,6409,6410],{"class":402,"line":2532},[400,6411,6412],{"class":406},"-- Q3: Members who have never borrowed a book\n",[400,6414,6415,6417,6419,6421,6423,6425,6428,6430],{"class":402,"line":2537},[400,6416,1129],{"class":413},[400,6418,6357],{"class":455},[400,6420,35],{"class":424},[400,6422,1521],{"class":455},[400,6424,872],{"class":424},[400,6426,6427],{"class":455},"m",[400,6429,35],{"class":424},[400,6431,6432],{"class":455},"email\n",[400,6434,6435,6437],{"class":402,"line":2543},[400,6436,2000],{"class":413},[400,6438,6439],{"class":424}," members m\n",[400,6441,6442,6444,6447,6449,6451,6453,6455,6457,6459,6461],{"class":402,"line":2554},[400,6443,3490],{"class":413},[400,6445,6446],{"class":424}," borrowings br ",[400,6448,3392],{"class":413},[400,6450,6357],{"class":455},[400,6452,35],{"class":424},[400,6454,3349],{"class":455},[400,6456,3402],{"class":413},[400,6458,6320],{"class":455},[400,6460,35],{"class":424},[400,6462,6463],{"class":455},"member_id\n",[400,6465,6466,6468,6470,6472,6474,6476,6478],{"class":402,"line":2577},[400,6467,1141],{"class":413},[400,6469,6320],{"class":455},[400,6471,35],{"class":424},[400,6473,3349],{"class":455},[400,6475,6399],{"class":413},[400,6477,1094],{"class":413},[400,6479,1151],{"class":424},[400,6481,6482],{"class":402,"line":2582},[400,6483,1157],{"emptyLinePlaceholder":1156},[400,6485,6486],{"class":402,"line":2593},[400,6487,6488],{"class":406},"-- Q4: Most popular book (borrowed most times)\n",[400,6490,6491,6493,6495,6497,6499,6501,6503,6505,6507,6509,6511],{"class":402,"line":2616},[400,6492,1129],{"class":413},[400,6494,6159],{"class":455},[400,6496,35],{"class":424},[400,6498,6164],{"class":455},[400,6500,872],{"class":424},[400,6502,3119],{"class":455},[400,6504,452],{"class":424},[400,6506,1874],{"class":413},[400,6508,1381],{"class":424},[400,6510,2089],{"class":413},[400,6512,6513],{"class":424}," borrow_count\n",[400,6515,6516,6518],{"class":402,"line":2621},[400,6517,2000],{"class":413},[400,6519,6336],{"class":424},[400,6521,6522,6524,6527,6529,6531,6533,6535,6537,6539,6541],{"class":402,"line":2627},[400,6523,3724],{"class":413},[400,6525,6526],{"class":424}," books b ",[400,6528,3392],{"class":413},[400,6530,6320],{"class":455},[400,6532,35],{"class":424},[400,6534,6377],{"class":455},[400,6536,3402],{"class":413},[400,6538,6159],{"class":455},[400,6540,35],{"class":424},[400,6542,6228],{"class":455},[400,6544,6545,6547,6549,6551],{"class":402,"line":5651},[400,6546,3061],{"class":413},[400,6548,6159],{"class":455},[400,6550,35],{"class":424},[400,6552,6553],{"class":455},"title\n",[400,6555,6556,6558,6561],{"class":402,"line":5657},[400,6557,2015],{"class":413},[400,6559,6560],{"class":424}," borrow_count ",[400,6562,2027],{"class":413},[400,6564,6565,6567,6569],{"class":402,"line":5669},[400,6566,2032],{"class":413},[400,6568,1912],{"class":455},[400,6570,1151],{"class":424},[400,6572,6573],{"class":402,"line":5680},[400,6574,1157],{"emptyLinePlaceholder":1156},[400,6576,6577],{"class":402,"line":5695},[400,6578,6579],{"class":406},"-- Q5: Create a view for the library dashboard\n",[400,6581,6582,6584,6586,6589],{"class":402,"line":5710},[400,6583,414],{"class":413},[400,6585,5067],{"class":413},[400,6587,6588],{"class":420}," library_dashboard",[400,6590,5073],{"class":413},[400,6592,6593],{"class":402,"line":5724},[400,6594,2069],{"class":413},[400,6596,6597,6599,6601,6603],{"class":402,"line":5736},[400,6598,6277],{"class":455},[400,6600,35],{"class":424},[400,6602,3349],{"class":455},[400,6604,440],{"class":424},[400,6606,6607,6609,6611,6613],{"class":402,"line":5744},[400,6608,6277],{"class":455},[400,6610,35],{"class":424},[400,6612,6164],{"class":455},[400,6614,440],{"class":424},[400,6616,6618,6621,6623,6625,6627],{"class":402,"line":6617},38,[400,6619,6620],{"class":455},"    a",[400,6622,35],{"class":424},[400,6624,1521],{"class":455},[400,6626,3563],{"class":413},[400,6628,6629],{"class":424}," author,\n",[400,6631,6633,6635,6637,6640],{"class":402,"line":6632},39,[400,6634,6277],{"class":455},[400,6636,35],{"class":424},[400,6638,6639],{"class":455},"total_copies",[400,6641,440],{"class":424},[400,6643,6645,6647,6649,6651,6654,6656,6658,6661,6663,6665,6667,6670,6672,6674,6676,6678,6680,6682,6684,6686,6688],{"class":402,"line":6644},40,[400,6646,6277],{"class":455},[400,6648,35],{"class":424},[400,6650,6639],{"class":455},[400,6652,6653],{"class":413}," -",[400,6655,2946],{"class":455},[400,6657,452],{"class":424},[400,6659,6660],{"class":455},"br",[400,6662,35],{"class":424},[400,6664,3349],{"class":455},[400,6666,1381],{"class":424},[400,6668,6669],{"class":413},"FILTER",[400,6671,1674],{"class":424},[400,6673,1141],{"class":413},[400,6675,6320],{"class":455},[400,6677,35],{"class":424},[400,6679,6396],{"class":455},[400,6681,6399],{"class":413},[400,6683,1094],{"class":413},[400,6685,1381],{"class":424},[400,6687,2089],{"class":413},[400,6689,6690],{"class":424}," available_copies\n",[400,6692,6694,6696],{"class":402,"line":6693},41,[400,6695,2000],{"class":413},[400,6697,6202],{"class":424},[400,6699,6701,6703,6705,6707,6709,6711,6713,6715,6717,6719],{"class":402,"line":6700},42,[400,6702,3724],{"class":413},[400,6704,6209],{"class":424},[400,6706,3392],{"class":413},[400,6708,6159],{"class":455},[400,6710,35],{"class":424},[400,6712,6218],{"class":455},[400,6714,3402],{"class":413},[400,6716,6223],{"class":455},[400,6718,35],{"class":424},[400,6720,6228],{"class":455},[400,6722,6724,6726,6728,6730,6732,6734,6736,6738,6740,6742],{"class":402,"line":6723},43,[400,6725,3490],{"class":413},[400,6727,6446],{"class":424},[400,6729,3392],{"class":413},[400,6731,6159],{"class":455},[400,6733,35],{"class":424},[400,6735,3349],{"class":455},[400,6737,3402],{"class":413},[400,6739,6320],{"class":455},[400,6741,35],{"class":424},[400,6743,6744],{"class":455},"book_id\n",[400,6746,6748,6750,6752,6754,6756,6758,6760,6762,6764,6766,6768,6770,6772,6774,6776,6778,6780],{"class":402,"line":6747},44,[400,6749,3061],{"class":413},[400,6751,6159],{"class":455},[400,6753,35],{"class":424},[400,6755,3349],{"class":455},[400,6757,872],{"class":424},[400,6759,6181],{"class":455},[400,6761,35],{"class":424},[400,6763,6164],{"class":455},[400,6765,872],{"class":424},[400,6767,6169],{"class":455},[400,6769,35],{"class":424},[400,6771,1521],{"class":455},[400,6773,872],{"class":424},[400,6775,6181],{"class":455},[400,6777,35],{"class":424},[400,6779,6639],{"class":455},[400,6781,1151],{"class":424},[400,6783,6785],{"class":402,"line":6784},45,[400,6786,1157],{"emptyLinePlaceholder":1156},[400,6788,6790,6792,6794,6796],{"class":402,"line":6789},46,[400,6791,1129],{"class":413},[400,6793,1132],{"class":413},[400,6795,1135],{"class":413},[400,6797,6798],{"class":424}," library_dashboard;\n",[119,6800],{},[11,6802,6804],{"id":6803},"_11-common-beginner-mistakes","11. Common Beginner Mistakes",[16,6806,6807,6808,6811],{},"These are the most frequent errors seen when students first ",[28,6809,6810],{},"learn SQL from\nscratch"," — avoid them and you'll be ahead of the curve.",[135,6813,6814,6827],{},[138,6815,6816],{},[141,6817,6818,6821,6824],{},[144,6819,6820],{},"Mistake",[144,6822,6823],{},"Why It's Wrong",[144,6825,6826],{},"How to Fix It",[154,6828,6829,6851,6871,6898,6912,6926,6937,6948],{},[141,6830,6831,6839,6845],{},[159,6832,6833,6836,6837],{},[322,6834,6835],{},"UPDATE table SET col = val"," without ",[322,6838,1141],{},[159,6840,6841,6842,6844],{},"Updates ",[28,6843,4351],{}," row in the table",[159,6846,6847,6848,6850],{},"Always include ",[322,6849,1141],{}," unless intentional",[141,6852,6853,6860,6867],{},[159,6854,6855,6836,6858],{},[322,6856,6857],{},"DELETE FROM table",[322,6859,1141],{},[159,6861,6862,6863,6866],{},"Deletes ",[28,6864,6865],{},"all"," rows",[159,6868,6847,6869],{},[322,6870,1141],{},[141,6872,6873,6878,6890],{},[159,6874,6875,6876],{},"Comparing NULL with ",[322,6877,1066],{},[159,6879,6880,6883,6884,6887,6888],{},[322,6881,6882],{},"NULL = NULL"," is always ",[322,6885,6886],{},"UNKNOWN",", not ",[322,6889,958],{},[159,6891,6892,6893,6895,6896],{},"Use ",[322,6894,1111],{}," / ",[322,6897,1114],{},[141,6899,6900,6906,6909],{},[159,6901,6902,6905],{},[322,6903,6904],{},"SELECT *"," in production code",[159,6907,6908],{},"Fetches unnecessary data, breaks if schema changes",[159,6910,6911],{},"Explicitly list only needed columns",[141,6913,6914,6917,6920],{},[159,6915,6916],{},"Not using transactions for multi-step operations",[159,6918,6919],{},"Partial failure leaves data in inconsistent state",[159,6921,6922,6923],{},"Wrap related operations in ",[322,6924,6925],{},"BEGIN...COMMIT",[141,6927,6928,6931,6934],{},[159,6929,6930],{},"Forgetting to index foreign keys",[159,6932,6933],{},"Joins and lookups become full table scans",[159,6935,6936],{},"Add index on every FK column",[141,6938,6939,6942,6945],{},[159,6940,6941],{},"Putting business logic only in app code, not DB",[159,6943,6944],{},"App bugs can corrupt data",[159,6946,6947],{},"Use constraints, foreign keys, and CHECK",[141,6949,6950,6956,6962],{},[159,6951,6952,6953,6955],{},"Using ",[322,6954,907],{}," for money",[159,6957,6958,6959],{},"Floating-point is imprecise: ",[322,6960,6961],{},"0.1 + 0.2 ≠ 0.3",[159,6963,6892,6964,6967],{},[322,6965,6966],{},"DECIMAL(10,2)"," for monetary values",[119,6969],{},[11,6971,6973],{"id":6972},"_12-summary-what-to-learn-next","12. Summary & What to Learn Next",[52,6975,6977],{"id":6976},"what-youve-learned","What You've Learned",[135,6979,6980,6990],{},[138,6981,6982],{},[141,6983,6984,6987],{},[144,6985,6986],{},"Concept",[144,6988,6989],{},"Key Takeaway",[154,6991,6992,6999,7007,7015,7023,7031,7039,7047,7055,7063,7071,7079],{},[141,6993,6994,6996],{},[159,6995,210],{},[159,6997,6998],{},"Software engine that stores and manages relational data",[141,7000,7001,7004],{},[159,7002,7003],{},"Tables",[159,7005,7006],{},"Data is stored in rows and columns, like a strict spreadsheet",[141,7008,7009,7012],{},[159,7010,7011],{},"Keys",[159,7013,7014],{},"Primary keys identify rows; foreign keys link tables",[141,7016,7017,7020],{},[159,7018,7019],{},"Relationships",[159,7021,7022],{},"1:1, 1:N, M:N modeled with tables and foreign keys",[141,7024,7025,7028],{},[159,7026,7027],{},"SQL sublanguages",[159,7029,7030],{},"DDL (structure), DML (change data), DQL (query data)",[141,7032,7033,7036],{},[159,7034,7035],{},"Joins",[159,7037,7038],{},"INNER, LEFT, RIGHT, FULL — combine rows from multiple tables",[141,7040,7041,7044],{},[159,7042,7043],{},"Aggregation",[159,7045,7046],{},"GROUP BY + COUNT/SUM/AVG/MIN/MAX for summarizing data",[141,7048,7049,7052],{},[159,7050,7051],{},"Constraints",[159,7053,7054],{},"Enforce data integrity at the database level",[141,7056,7057,7060],{},[159,7058,7059],{},"Normalization",[159,7061,7062],{},"Design tables to eliminate redundancy (1NF → 2NF → 3NF)",[141,7064,7065,7068],{},[159,7066,7067],{},"Indexes",[159,7069,7070],{},"Speed up SELECT queries; come at a cost to writes",[141,7072,7073,7076],{},[159,7074,7075],{},"Transactions",[159,7077,7078],{},"ACID properties guarantee correctness in multi-step operations",[141,7080,7081,7084],{},[159,7082,7083],{},"Views",[159,7085,7086],{},"Virtual tables from saved queries for simplicity and security",[52,7088,7090],{"id":7089},"recommended-next-topics","Recommended Next Topics",[7092,7093,7094,7113,7121,7127,7133,7142,7148],"ol",{},[70,7095,7096,7099,7100,872,7103,872,7106,872,7109,7112],{},[28,7097,7098],{},"Window Functions",": ",[322,7101,7102],{},"RANK()",[322,7104,7105],{},"ROW_NUMBER()",[322,7107,7108],{},"LAG()",[322,7110,7111],{},"LEAD()"," — the\nmost powerful SQL feature most beginners never learn.",[70,7114,7115,7099,7118,7120],{},[28,7116,7117],{},"Query Optimization",[322,7119,4738],{},", reading query plans, index\nstrategies.",[70,7122,7123,7126],{},[28,7124,7125],{},"Stored Procedures & Functions",": reusable logic inside the database.",[70,7128,7129,7132],{},[28,7130,7131],{},"Triggers",": automatic actions that fire on INSERT/UPDATE/DELETE.",[70,7134,7135,7138,7139,35],{},[28,7136,7137],{},"CTEs (Common Table Expressions)",": cleaner alternative to subqueries\nusing ",[322,7140,7141],{},"WITH",[70,7143,7144,7147],{},[28,7145,7146],{},"PostgreSQL-specific features",": JSONB, arrays, full-text search,\npartitioning.",[70,7149,7150,7153],{},[28,7151,7152],{},"Database Security",": roles, row-level security, encryption at rest.",[52,7155,7157],{"id":7156},"practice-resources","Practice Resources",[67,7159,7160,7165,7171,7177],{},[70,7161,7162,7164],{},[28,7163,270],{},": Zero-install. Download DB Browser for SQLite and start immediately.",[70,7166,7167,7170],{},[28,7168,7169],{},"pgAdmin / DBeaver",": GUI tools for exploring and running queries.",[70,7172,7173,7176],{},[28,7174,7175],{},"LeetCode Database Problems",": SQL problems ranked by difficulty.",[70,7178,7179,7182],{},[28,7180,7181],{},"SQLZoo SQL Tutorial",": Interactive SQL practice in the browser.",[119,7184],{},[106,7186,7187],{},[16,7188,7189,7192],{},[20,7190,7191],{},"\"Bad programmers worry about the code. Good programmers worry about data\nstructures and their relationships.\"","\n— Linus Torvalds",[16,7194,7195],{},"The database is the foundation your entire application sits on. Get this\nfoundation right, and everything built on top of it becomes simpler,\nfaster, and more reliable.",[16,7197,7198],{},"Thanks for reading!",[7200,7201,7202],"style",{},"html pre.shiki code .sAwPA, html code.shiki .sAwPA{--shiki-default:#6A737D}html pre.shiki code .snl16, html code.shiki .snl16{--shiki-default:#F97583}html pre.shiki code .svObZ, html code.shiki .svObZ{--shiki-default:#B392F0}html pre.shiki code .s95oV, html code.shiki .s95oV{--shiki-default:#E1E4E8}html pre.shiki code .sDLfK, html code.shiki .sDLfK{--shiki-default:#79B8FF}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html pre.shiki code .sU2Wk, html code.shiki .sU2Wk{--shiki-default:#9ECBFF}",{"title":324,"searchDepth":410,"depth":410,"links":7204},[7205,7208,7217,7223,7230,7231,7235,7236,7240,7241,7246,7247],{"id":13,"depth":410,"text":14,"children":7206},[7207],{"id":54,"depth":428,"text":55},{"id":123,"depth":410,"text":124,"children":7209},[7210,7211,7212,7213,7214,7215,7216],{"id":127,"depth":428,"text":128},{"id":203,"depth":428,"text":204},{"id":307,"depth":428,"text":308},{"id":365,"depth":428,"text":366},{"id":673,"depth":428,"text":674},{"id":831,"depth":428,"text":832},{"id":1027,"depth":428,"text":1028},{"id":1188,"depth":410,"text":1189,"children":7218},[7219,7220,7221,7222],{"id":1329,"depth":428,"text":1330},{"id":1639,"depth":428,"text":1640},{"id":1968,"depth":428,"text":1969},{"id":2113,"depth":428,"text":2114},{"id":2254,"depth":410,"text":2255,"children":7224},[7225,7226,7227,7228,7229],{"id":2258,"depth":428,"text":2259},{"id":2653,"depth":428,"text":2654},{"id":2812,"depth":428,"text":2813},{"id":3262,"depth":428,"text":3263},{"id":3815,"depth":428,"text":3816},{"id":3995,"depth":410,"text":3996},{"id":4308,"depth":410,"text":4309,"children":7232},[7233,7234],{"id":4328,"depth":428,"text":4329},{"id":4361,"depth":428,"text":4362},{"id":4567,"depth":410,"text":4568},{"id":4747,"depth":410,"text":4748,"children":7237},[7238,7239],{"id":4761,"depth":428,"text":4762},{"id":4873,"depth":428,"text":4874},{"id":5039,"depth":410,"text":5040},{"id":5314,"depth":410,"text":5315,"children":7242},[7243,7244,7245],{"id":5328,"depth":428,"text":5329},{"id":5749,"depth":428,"text":5750},{"id":6141,"depth":428,"text":6142},{"id":6803,"depth":410,"text":6804},{"id":6972,"depth":410,"text":6973,"children":7248},[7249,7250,7251],{"id":6976,"depth":428,"text":6977},{"id":7089,"depth":428,"text":7090},{"id":7156,"depth":428,"text":7157},"2026-04-15","Learn SQL and RDBMS fundamentals with simple explanations of relational databases, tables, queries, primary keys vs foreign keys, joins, schema design, normalization, indexes, and transactions.",false,"md",null,"sql-made-dead-simple-rdbms-guide.png",{},"/backend/sql-made-dead-simple-rdbms-guide",{"title":5,"description":7253},"Backend/2.sql-made-dead-simple-rdbms-guide",[7263,210,167,7264],"SQL","Backend","T0ZNeQJaDr9_oMnNS87nraXnakFqyGlRhI1vCayAIKc",[7267,13160,14522],{"id":4,"title":5,"author":6,"body":7268,"date":7252,"description":7253,"draft":7254,"extension":7255,"guide":7256,"image":7257,"meta":13157,"navigation":1156,"path":7259,"seo":13158,"stem":7261,"tags":13159,"__hash__":7265},{"type":8,"value":7269,"toc":13108},[7270,7272,7282,7290,7292,7296,7298,7316,7322,7330,7332,7334,7336,7340,7386,7388,7392,7402,7406,7458,7466,7468,7472,7477,7499,7501,7505,7507,7513,7515,7565,7567,7575,7633,7645,7647,7713,7715,7721,7725,7727,7729,7737,7742,7744,7748,7756,7761,7763,7767,7779,7825,7827,7833,7959,7973,7975,7985,7987,8025,8037,8093,8095,8097,8101,8203,8205,8207,8307,8309,8409,8411,8443,8453,8455,8457,8577,8579,8659,8661,8713,8729,8731,8737,8841,8843,8959,8961,8963,8965,8969,9307,9309,9453,9455,9461,9545,9659,9663,9668,9670,9682,9786,9796,9798,9804,9809,9817,9819,9827,9829,9845,9849,9851,9855,9935,9941,9943,9947,10021,10027,10029,10031,10033,10037,10093,10095,10099,10137,10139,10277,10279,10283,10437,10439,10441,10447,10507,10625,10629,10699,10703,10705,10707,10717,10719,10721,10726,10730,10740,10742,10744,10752,10824,10826,10836,10838,10848,10884,10894,10896,10898,10906,10908,10984,10988,11002,11006,11020,11032,11034,11036,11042,11044,11140,11144,11146,11150,11204,11272,11274,11276,11282,11494,11498,11516,11518,11520,11526,11528,11532,11894,11896,12226,12228,12816,12818,12820,12824,12940,12942,12944,12946,13030,13032,13074,13076,13094,13096,13102,13104,13106],[11,7271,14],{"id":13},[16,7273,18,7274,23,7276,26,7278,31,7280,35],{},[20,7275,22],{},[20,7277,22],{},[28,7279,30],{},[28,7281,34],{},[16,7283,38,7284,42,7286,46,7288,50],{},[28,7285,41],{},[28,7287,45],{},[28,7289,49],{},[52,7291,55],{"id":54},[16,7293,7294],{},[59,7295],{"alt":61,"src":62},[16,7297,65],{},[67,7299,7300,7304,7308,7312],{},[70,7301,7302,75],{},[28,7303,74],{},[70,7305,7306,81],{},[28,7307,80],{},[70,7309,7310,87],{},[28,7311,86],{},[70,7313,7314,93],{},[28,7315,92],{},[16,7317,96,7318,100,7320,104],{},[20,7319,99],{},[28,7321,103],{},[106,7323,7324],{},[16,7325,7326,113,7328,117],{},[28,7327,112],{},[28,7329,116],{},[119,7331],{},[11,7333,124],{"id":123},[52,7335,128],{"id":127},[16,7337,38,7338,133],{},[28,7339,30],{},[135,7341,7342,7352],{},[138,7343,7344],{},[141,7345,7346,7348,7350],{},[144,7347,146],{},[144,7349,149],{},[144,7351,152],{},[154,7353,7354,7362,7370,7378],{},[141,7355,7356,7358,7360],{},[159,7357,161],{},[159,7359,164],{},[159,7361,167],{},[141,7363,7364,7366,7368],{},[159,7365,172],{},[159,7367,175],{},[159,7369,178],{},[141,7371,7372,7374,7376],{},[159,7373,183],{},[159,7375,186],{},[159,7377,189],{},[141,7379,7380,7382,7384],{},[159,7381,194],{},[159,7383,197],{},[159,7385,200],{},[52,7387,204],{"id":203},[16,7389,207,7390,211],{},[28,7391,210],{},[67,7393,7394,7396,7398,7400],{},[70,7395,216],{},[70,7397,219],{},[70,7399,222],{},[70,7401,225],{},[16,7403,7404],{},[28,7405,230],{},[135,7407,7408,7416],{},[138,7409,7410],{},[141,7411,7412,7414],{},[144,7413,210],{},[144,7415,241],{},[154,7417,7418,7426,7434,7442,7450],{},[141,7419,7420,7424],{},[159,7421,7422],{},[28,7423,250],{},[159,7425,253],{},[141,7427,7428,7432],{},[159,7429,7430],{},[28,7431,260],{},[159,7433,263],{},[141,7435,7436,7440],{},[159,7437,7438],{},[28,7439,270],{},[159,7441,273],{},[141,7443,7444,7448],{},[159,7445,7446],{},[28,7447,280],{},[159,7449,283],{},[141,7451,7452,7456],{},[159,7453,7454],{},[28,7455,290],{},[159,7457,293],{},[106,7459,7460],{},[16,7461,298,7462,301,7464,304],{},[28,7463,270],{},[28,7465,250],{},[52,7467,308],{"id":307},[16,7469,38,7470,313],{},[28,7471,135],{},[315,7473,7475],{"className":7474,"code":319,"language":320},[318],[322,7476,319],{"__ignoreMap":324},[67,7478,7479,7485,7493],{},[70,7480,329,7481,333,7483,337],{},[28,7482,332],{},[20,7484,336],{},[70,7486,329,7487,343,7489,347,7491,351],{},[28,7488,342],{},[28,7490,346],{},[28,7492,350],{},[70,7494,354,7495,358,7497,362],{},[28,7496,357],{},[28,7498,361],{},[52,7500,366],{"id":365},[16,7502,369,7503,373],{},[28,7504,372],{},[375,7506,378],{"id":377},[16,7508,38,7509,384,7511,388],{},[28,7510,383],{},[28,7512,387],{},[16,7514,391],{},[315,7516,7517],{"className":394,"code":395,"language":396,"meta":324,"style":324},[322,7518,7519,7523,7533,7543,7555,7561],{"__ignoreMap":324},[400,7520,7521],{"class":402,"line":403},[400,7522,407],{"class":406},[400,7524,7525,7527,7529,7531],{"class":402,"line":410},[400,7526,414],{"class":413},[400,7528,417],{"class":413},[400,7530,421],{"class":420},[400,7532,425],{"class":424},[400,7534,7535,7537,7539,7541],{"class":402,"line":428},[400,7536,431],{"class":424},[400,7538,434],{"class":413},[400,7540,437],{"class":413},[400,7542,440],{"class":424},[400,7544,7545,7547,7549,7551,7553],{"class":402,"line":443},[400,7546,446],{"class":413},[400,7548,449],{"class":413},[400,7550,452],{"class":424},[400,7552,456],{"class":455},[400,7554,459],{"class":424},[400,7556,7557,7559],{"class":402,"line":462},[400,7558,465],{"class":424},[400,7560,468],{"class":413},[400,7562,7563],{"class":402,"line":471},[400,7564,474],{"class":424},[375,7566,478],{"id":477},[16,7568,38,7569,484,7571,488,7573,491],{},[28,7570,483],{},[20,7572,487],{},[28,7574,372],{},[315,7576,7577],{"className":394,"code":494,"language":396,"meta":324,"style":324},[322,7578,7579,7583,7593,7603,7613,7623,7629],{"__ignoreMap":324},[400,7580,7581],{"class":402,"line":403},[400,7582,501],{"class":406},[400,7584,7585,7587,7589,7591],{"class":402,"line":410},[400,7586,414],{"class":413},[400,7588,417],{"class":413},[400,7590,510],{"class":420},[400,7592,425],{"class":424},[400,7594,7595,7597,7599,7601],{"class":402,"line":428},[400,7596,517],{"class":424},[400,7598,434],{"class":413},[400,7600,437],{"class":413},[400,7602,440],{"class":424},[400,7604,7605,7607,7609,7611],{"class":402,"line":443},[400,7606,528],{"class":424},[400,7608,434],{"class":413},[400,7610,533],{"class":413},[400,7612,536],{"class":424},[400,7614,7615,7617,7619,7621],{"class":402,"line":462},[400,7616,541],{"class":424},[400,7618,434],{"class":413},[400,7620,533],{"class":413},[400,7622,548],{"class":424},[400,7624,7625,7627],{"class":402,"line":471},[400,7626,553],{"class":424},[400,7628,556],{"class":413},[400,7630,7631],{"class":402,"line":559},[400,7632,474],{"class":424},[106,7634,7635],{},[16,7636,7637,569,7639,573,7641,577,7643,581],{},[28,7638,568],{},[322,7640,572],{},[322,7642,576],{},[20,7644,580],{},[375,7646,585],{"id":584},[135,7648,7649,7659],{},[138,7650,7651],{},[141,7652,7653,7655,7657],{},[144,7654,594],{},[144,7656,597],{},[144,7658,600],{},[154,7660,7661,7677,7689,7701],{},[141,7662,7663,7667,7671],{},[159,7664,7665],{},[28,7666,609],{},[159,7668,612,7669,616],{},[20,7670,615],{},[159,7672,7673,347,7675],{},[322,7674,621],{},[322,7676,624],{},[141,7678,7679,7683,7685],{},[159,7680,7681],{},[28,7682,631],{},[159,7684,634],{},[159,7686,7687,640],{},[322,7688,639],{},[141,7690,7691,7695,7697],{},[159,7692,7693],{},[28,7694,647],{},[159,7696,650],{},[159,7698,7699],{},[322,7700,655],{},[141,7702,7703,7707,7709],{},[159,7704,7705],{},[28,7706,662],{},[159,7708,665],{},[159,7710,7711],{},[322,7712,670],{},[52,7714,674],{"id":673},[16,7716,677,7717,681,7719,685],{},[20,7718,680],{},[28,7720,684],{},[16,7722,7723],{},[59,7724],{"alt":690,"src":691},[375,7726,695],{"id":694},[16,7728,698],{},[16,7730,7731,704,7733,708,7735,35],{},[28,7732,703],{},[322,7734,707],{},[322,7736,711],{},[315,7738,7740],{"className":7739,"code":715,"language":320},[318],[322,7741,715],{"__ignoreMap":324},[375,7743,721],{"id":720},[16,7745,724,7746,728],{},[20,7747,727],{},[16,7749,7750,704,7752,736,7754,35],{},[28,7751,703],{},[322,7753,735],{},[322,7755,739],{},[315,7757,7759],{"className":7758,"code":743,"language":320},[318],[322,7760,743],{"__ignoreMap":324},[375,7762,749],{"id":748},[16,7764,752,7765,756],{},[28,7766,755],{},[16,7768,7769,761,7771,765,7773,769,7775,773,7777,35],{},[28,7770,703],{},[322,7772,764],{},[322,7774,768],{},[322,7776,772],{},[322,7778,572],{},[315,7780,7781],{"className":394,"code":778,"language":396,"meta":324,"style":324},[322,7782,7783,7793,7803,7813,7821],{"__ignoreMap":324},[400,7784,7785,7787,7789,7791],{"class":402,"line":403},[400,7786,414],{"class":413},[400,7788,417],{"class":413},[400,7790,510],{"class":420},[400,7792,425],{"class":424},[400,7794,7795,7797,7799,7801],{"class":402,"line":410},[400,7796,431],{"class":424},[400,7798,434],{"class":413},[400,7800,533],{"class":413},[400,7802,801],{"class":424},[400,7804,7805,7807,7809,7811],{"class":402,"line":428},[400,7806,806],{"class":424},[400,7808,434],{"class":413},[400,7810,533],{"class":413},[400,7812,813],{"class":424},[400,7814,7815,7817,7819],{"class":402,"line":443},[400,7816,818],{"class":413},[400,7818,821],{"class":424},[400,7820,824],{"class":406},[400,7822,7823],{"class":402,"line":462},[400,7824,474],{"class":424},[52,7826,832],{"id":831},[16,7828,835,7829,839,7831,843],{},[28,7830,838],{},[28,7832,842],{},[135,7834,7835,7845],{},[138,7836,7837],{},[141,7838,7839,7841,7843],{},[144,7840,852],{},[144,7842,855],{},[144,7844,858],{},[154,7846,7847,7869,7889,7909,7925,7945],{},[141,7848,7849,7853,7861],{},[159,7850,7851],{},[28,7852,867],{},[159,7854,7855,872,7857,872,7859],{},[322,7856,434],{},[322,7858,875],{},[322,7860,878],{},[159,7862,7863,872,7865,872,7867],{},[322,7864,883],{},[322,7866,886],{},[322,7868,889],{},[141,7870,7871,7875,7883],{},[159,7872,7873],{},[28,7874,896],{},[159,7876,7877,872,7879,872,7881],{},[322,7878,901],{},[322,7880,904],{},[322,7882,907],{},[159,7884,7885,872,7887],{},[322,7886,912],{},[322,7888,915],{},[141,7890,7891,7895,7903],{},[159,7892,7893],{},[28,7894,922],{},[159,7896,7897,872,7899,872,7901],{},[322,7898,927],{},[322,7900,930],{},[322,7902,933],{},[159,7904,7905,872,7907],{},[322,7906,938],{},[322,7908,941],{},[141,7910,7911,7915,7919],{},[159,7912,7913],{},[28,7914,948],{},[159,7916,7917],{},[322,7918,953],{},[159,7920,7921,872,7923],{},[322,7922,958],{},[322,7924,961],{},[141,7926,7927,7931,7939],{},[159,7928,7929],{},[28,7930,968],{},[159,7932,7933,872,7935,872,7937],{},[322,7934,973],{},[322,7936,976],{},[322,7938,979],{},[159,7940,7941,872,7943],{},[322,7942,984],{},[322,7944,987],{},[141,7946,7947,7951,7957],{},[159,7948,7949],{},[28,7950,994],{},[159,7952,7953,872,7955],{},[322,7954,999],{},[322,7956,1002],{},[159,7958,1005],{},[106,7960,7961],{},[16,7962,7963,1018,7969,1021,7971,1024],{},[28,7964,7965,1014,7967,1017],{},[322,7966,927],{},[322,7968,930],{},[322,7970,927],{},[322,7972,930],{},[52,7974,1028],{"id":1027},[16,7976,7977,1034,7979,1038,7981,1042,7983,1045],{},[322,7978,1033],{},[28,7980,1037],{},[20,7982,1041],{},[20,7984,1041],{},[16,7986,1048],{},[315,7988,7989],{"className":394,"code":1051,"language":396,"meta":324,"style":324},[322,7990,7991,7995,8005,8015],{"__ignoreMap":324},[400,7992,7993],{"class":402,"line":403},[400,7994,1058],{"class":406},[400,7996,7997,7999,8001,8003],{"class":402,"line":410},[400,7998,1063],{"class":424},[400,8000,1066],{"class":413},[400,8002,1069],{"class":455},[400,8004,1072],{"class":406},[400,8006,8007,8009,8011,8013],{"class":402,"line":428},[400,8008,1063],{"class":424},[400,8010,1066],{"class":413},[400,8012,1082],{"class":1081},[400,8014,1085],{"class":406},[400,8016,8017,8019,8021,8023],{"class":402,"line":443},[400,8018,1063],{"class":424},[400,8020,1066],{"class":413},[400,8022,1094],{"class":413},[400,8024,1097],{"class":406},[106,8026,8027],{},[16,8028,8029,1105,8031,1108,8033,347,8035,35],{},[28,8030,1104],{},[322,8032,1066],{},[322,8034,1111],{},[322,8036,1114],{},[315,8038,8039],{"className":394,"code":1117,"language":396,"meta":324,"style":324},[322,8040,8041,8045,8065,8069,8073],{"__ignoreMap":324},[400,8042,8043],{"class":402,"line":403},[400,8044,1124],{"class":406},[400,8046,8047,8049,8051,8053,8055,8057,8059,8061,8063],{"class":402,"line":410},[400,8048,1129],{"class":413},[400,8050,1132],{"class":413},[400,8052,1135],{"class":413},[400,8054,1138],{"class":424},[400,8056,1141],{"class":413},[400,8058,1144],{"class":424},[400,8060,1066],{"class":413},[400,8062,1094],{"class":413},[400,8064,1151],{"class":424},[400,8066,8067],{"class":402,"line":428},[400,8068,1157],{"emptyLinePlaceholder":1156},[400,8070,8071],{"class":402,"line":443},[400,8072,1162],{"class":406},[400,8074,8075,8077,8079,8081,8083,8085,8087,8089,8091],{"class":402,"line":462},[400,8076,1129],{"class":413},[400,8078,1132],{"class":413},[400,8080,1135],{"class":413},[400,8082,1138],{"class":424},[400,8084,1141],{"class":413},[400,8086,1144],{"class":424},[400,8088,1179],{"class":413},[400,8090,1094],{"class":413},[400,8092,1151],{"class":424},[119,8094],{},[11,8096,1189],{"id":1188},[16,8098,1192,8099,1017],{},[28,8100,49],{},[135,8102,8103,8115],{},[138,8104,8105],{},[141,8106,8107,8109,8111,8113],{},[144,8108,1203],{},[144,8110,1206],{},[144,8112,1209],{},[144,8114,1212],{},[154,8116,8117,8137,8155,8169,8185],{},[141,8118,8119,8123,8125,8127],{},[159,8120,8121],{},[28,8122,1221],{},[159,8124,1224],{},[159,8126,1227],{},[159,8128,8129,872,8131,872,8133,872,8135],{},[322,8130,414],{},[322,8132,1234],{},[322,8134,1237],{},[322,8136,1240],{},[141,8138,8139,8143,8145,8147],{},[159,8140,8141],{},[28,8142,1247],{},[159,8144,1250],{},[159,8146,1253],{},[159,8148,8149,872,8151,872,8153],{},[322,8150,1258],{},[322,8152,1261],{},[322,8154,1264],{},[141,8156,8157,8161,8163,8165],{},[159,8158,8159],{},[28,8160,1271],{},[159,8162,1274],{},[159,8164,1277],{},[159,8166,8167],{},[322,8168,1129],{},[141,8170,8171,8175,8177,8179],{},[159,8172,8173],{},[28,8174,1288],{},[159,8176,1291],{},[159,8178,1294],{},[159,8180,8181,872,8183],{},[322,8182,1299],{},[322,8184,1302],{},[141,8186,8187,8191,8193,8195],{},[159,8188,8189],{},[28,8190,1309],{},[159,8192,1312],{},[159,8194,1315],{},[159,8196,8197,872,8199,872,8201],{},[322,8198,1320],{},[322,8200,1323],{},[322,8202,1326],{},[52,8204,1330],{"id":1329},[375,8206,1334],{"id":1333},[315,8208,8209],{"className":394,"code":1337,"language":396,"meta":324,"style":324},[322,8210,8211,8221,8233,8249,8257,8279,8291,8303],{"__ignoreMap":324},[400,8212,8213,8215,8217,8219],{"class":402,"line":403},[400,8214,414],{"class":413},[400,8216,417],{"class":413},[400,8218,1348],{"class":420},[400,8220,425],{"class":424},[400,8222,8223,8225,8227,8229,8231],{"class":402,"line":410},[400,8224,1355],{"class":424},[400,8226,1358],{"class":413},[400,8228,437],{"class":413},[400,8230,1363],{"class":424},[400,8232,1366],{"class":406},[400,8234,8235,8237,8239,8241,8243,8245,8247],{"class":402,"line":428},[400,8236,446],{"class":413},[400,8238,1373],{"class":413},[400,8240,452],{"class":424},[400,8242,1378],{"class":455},[400,8244,1381],{"class":424},[400,8246,1384],{"class":413},[400,8248,440],{"class":424},[400,8250,8251,8253,8255],{"class":402,"line":443},[400,8252,1391],{"class":413},[400,8254,1394],{"class":413},[400,8256,440],{"class":424},[400,8258,8259,8261,8263,8265,8267,8269,8271,8273,8275,8277],{"class":402,"line":462},[400,8260,1401],{"class":424},[400,8262,1404],{"class":413},[400,8264,452],{"class":424},[400,8266,1409],{"class":455},[400,8268,872],{"class":424},[400,8270,1414],{"class":455},[400,8272,1381],{"class":424},[400,8274,1384],{"class":413},[400,8276,1421],{"class":424},[400,8278,1424],{"class":406},[400,8280,8281,8283,8285,8287,8289],{"class":402,"line":471},[400,8282,1429],{"class":424},[400,8284,434],{"class":413},[400,8286,1434],{"class":413},[400,8288,1069],{"class":455},[400,8290,440],{"class":424},[400,8292,8293,8295,8297,8299,8301],{"class":402,"line":559},[400,8294,1443],{"class":424},[400,8296,979],{"class":413},[400,8298,1434],{"class":413},[400,8300,1450],{"class":413},[400,8302,1453],{"class":424},[400,8304,8305],{"class":402,"line":1456},[400,8306,474],{"class":424},[375,8308,1462],{"id":1461},[315,8310,8311],{"className":394,"code":1465,"language":396,"meta":324,"style":324},[322,8312,8313,8317,8337,8341,8345,8365,8369,8373,8385,8389,8393],{"__ignoreMap":324},[400,8314,8315],{"class":402,"line":403},[400,8316,1472],{"class":406},[400,8318,8319,8321,8323,8325,8327,8329,8331,8333,8335],{"class":402,"line":410},[400,8320,1234],{"class":413},[400,8322,417],{"class":413},[400,8324,1481],{"class":424},[400,8326,1484],{"class":413},[400,8328,1487],{"class":424},[400,8330,1490],{"class":413},[400,8332,452],{"class":424},[400,8334,456],{"class":455},[400,8336,474],{"class":424},[400,8338,8339],{"class":402,"line":428},[400,8340,1157],{"emptyLinePlaceholder":1156},[400,8342,8343],{"class":402,"line":443},[400,8344,1505],{"class":406},[400,8346,8347,8349,8351,8353,8355,8357,8359,8361,8363],{"class":402,"line":462},[400,8348,1234],{"class":413},[400,8350,417],{"class":413},[400,8352,1481],{"class":424},[400,8354,1234],{"class":413},[400,8356,1518],{"class":424},[400,8358,1521],{"class":413},[400,8360,1524],{"class":413},[400,8362,1527],{"class":413},[400,8364,1151],{"class":424},[400,8366,8367],{"class":402,"line":471},[400,8368,1157],{"emptyLinePlaceholder":1156},[400,8370,8371],{"class":402,"line":559},[400,8372,1538],{"class":406},[400,8374,8375,8377,8379,8381,8383],{"class":402,"line":1456},[400,8376,1234],{"class":413},[400,8378,417],{"class":413},[400,8380,1547],{"class":424},[400,8382,1550],{"class":413},[400,8384,1553],{"class":424},[400,8386,8387],{"class":402,"line":1556},[400,8388,1157],{"emptyLinePlaceholder":1156},[400,8390,8391],{"class":402,"line":1561},[400,8392,1564],{"class":406},[400,8394,8395,8397,8399,8401,8403,8405,8407],{"class":402,"line":1567},[400,8396,1234],{"class":413},[400,8398,417],{"class":413},[400,8400,1481],{"class":424},[400,8402,1237],{"class":413},[400,8404,1518],{"class":424},[400,8406,1580],{"class":413},[400,8408,1151],{"class":424},[375,8410,1586],{"id":1585},[315,8412,8413],{"className":394,"code":1589,"language":396,"meta":324,"style":324},[322,8414,8415,8419,8427,8431,8435],{"__ignoreMap":324},[400,8416,8417],{"class":402,"line":403},[400,8418,1596],{"class":406},[400,8420,8421,8423,8425],{"class":402,"line":410},[400,8422,1237],{"class":413},[400,8424,417],{"class":413},[400,8426,1605],{"class":424},[400,8428,8429],{"class":402,"line":428},[400,8430,1157],{"emptyLinePlaceholder":1156},[400,8432,8433],{"class":402,"line":443},[400,8434,1614],{"class":406},[400,8436,8437,8439,8441],{"class":402,"line":462},[400,8438,1240],{"class":413},[400,8440,417],{"class":413},[400,8442,1605],{"class":424},[106,8444,8445],{},[16,8446,8447,1630,8449,1633,8451,1636],{},[28,8448,1629],{},[322,8450,1237],{},[322,8452,1240],{},[52,8454,1640],{"id":1639},[375,8456,1258],{"id":1643},[315,8458,8459],{"className":394,"code":1646,"language":396,"meta":324,"style":324},[322,8460,8461,8465,8475,8497,8501,8505,8517,8537,8557],{"__ignoreMap":324},[400,8462,8463],{"class":402,"line":403},[400,8464,1653],{"class":406},[400,8466,8467,8469,8471,8473],{"class":402,"line":410},[400,8468,1658],{"class":413},[400,8470,1661],{"class":424},[400,8472,1521],{"class":413},[400,8474,1666],{"class":424},[400,8476,8477,8479,8481,8483,8485,8487,8489,8491,8493,8495],{"class":402,"line":428},[400,8478,1671],{"class":413},[400,8480,1674],{"class":424},[400,8482,1677],{"class":1081},[400,8484,872],{"class":424},[400,8486,1682],{"class":455},[400,8488,35],{"class":424},[400,8490,1687],{"class":455},[400,8492,872],{"class":424},[400,8494,1692],{"class":455},[400,8496,474],{"class":424},[400,8498,8499],{"class":402,"line":443},[400,8500,1157],{"emptyLinePlaceholder":1156},[400,8502,8503],{"class":402,"line":462},[400,8504,1703],{"class":406},[400,8506,8507,8509,8511,8513,8515],{"class":402,"line":471},[400,8508,1658],{"class":413},[400,8510,1661],{"class":424},[400,8512,1521],{"class":413},[400,8514,1714],{"class":424},[400,8516,1717],{"class":413},[400,8518,8519,8521,8523,8525,8527,8529,8531,8533,8535],{"class":402,"line":559},[400,8520,1722],{"class":424},[400,8522,1725],{"class":1081},[400,8524,872],{"class":424},[400,8526,1730],{"class":455},[400,8528,35],{"class":424},[400,8530,1687],{"class":455},[400,8532,872],{"class":424},[400,8534,1739],{"class":455},[400,8536,459],{"class":424},[400,8538,8539,8541,8543,8545,8547,8549,8551,8553,8555],{"class":402,"line":1456},[400,8540,1722],{"class":424},[400,8542,1748],{"class":1081},[400,8544,872],{"class":424},[400,8546,1753],{"class":455},[400,8548,35],{"class":424},[400,8550,1687],{"class":455},[400,8552,872],{"class":424},[400,8554,1762],{"class":455},[400,8556,459],{"class":424},[400,8558,8559,8561,8563,8565,8567,8569,8571,8573,8575],{"class":402,"line":1556},[400,8560,1722],{"class":424},[400,8562,1771],{"class":1081},[400,8564,872],{"class":424},[400,8566,1776],{"class":455},[400,8568,35],{"class":424},[400,8570,1687],{"class":455},[400,8572,872],{"class":424},[400,8574,1785],{"class":455},[400,8576,474],{"class":424},[375,8578,1261],{"id":1790},[315,8580,8581],{"className":394,"code":1793,"language":396,"meta":324,"style":324},[322,8582,8583,8587,8593,8613,8625,8629,8633,8639],{"__ignoreMap":324},[400,8584,8585],{"class":402,"line":403},[400,8586,1800],{"class":406},[400,8588,8589,8591],{"class":402,"line":410},[400,8590,1261],{"class":413},[400,8592,1807],{"class":424},[400,8594,8595,8597,8599,8601,8603,8605,8607,8609,8611],{"class":402,"line":428},[400,8596,1812],{"class":413},[400,8598,1815],{"class":424},[400,8600,1066],{"class":413},[400,8602,1820],{"class":455},[400,8604,35],{"class":424},[400,8606,1687],{"class":455},[400,8608,1827],{"class":424},[400,8610,1066],{"class":413},[400,8612,1832],{"class":455},[400,8614,8615,8617,8619,8621,8623],{"class":402,"line":443},[400,8616,1141],{"class":413},[400,8618,1839],{"class":424},[400,8620,1066],{"class":413},[400,8622,1844],{"class":455},[400,8624,1151],{"class":424},[400,8626,8627],{"class":402,"line":462},[400,8628,1157],{"emptyLinePlaceholder":1156},[400,8630,8631],{"class":402,"line":471},[400,8632,1855],{"class":406},[400,8634,8635,8637],{"class":402,"line":559},[400,8636,1261],{"class":413},[400,8638,1807],{"class":424},[400,8640,8641,8643,8645,8647,8649,8651,8653,8655,8657],{"class":402,"line":1456},[400,8642,1812],{"class":413},[400,8644,1815],{"class":424},[400,8646,1066],{"class":413},[400,8648,1815],{"class":424},[400,8650,1874],{"class":413},[400,8652,1844],{"class":455},[400,8654,35],{"class":424},[400,8656,1409],{"class":455},[400,8658,1151],{"class":424},[375,8660,1264],{"id":1885},[315,8662,8663],{"className":394,"code":1888,"language":396,"meta":324,"style":324},[322,8664,8665,8669,8687,8691,8695],{"__ignoreMap":324},[400,8666,8667],{"class":402,"line":403},[400,8668,1895],{"class":406},[400,8670,8671,8673,8675,8677,8679,8681,8683,8685],{"class":402,"line":410},[400,8672,1264],{"class":413},[400,8674,1135],{"class":413},[400,8676,1481],{"class":424},[400,8678,1141],{"class":413},[400,8680,1839],{"class":424},[400,8682,1066],{"class":413},[400,8684,1912],{"class":455},[400,8686,1151],{"class":424},[400,8688,8689],{"class":402,"line":428},[400,8690,1157],{"emptyLinePlaceholder":1156},[400,8692,8693],{"class":402,"line":443},[400,8694,1923],{"class":406},[400,8696,8697,8699,8701,8703,8705,8707,8709,8711],{"class":402,"line":462},[400,8698,1264],{"class":413},[400,8700,1135],{"class":413},[400,8702,1481],{"class":424},[400,8704,1141],{"class":413},[400,8706,1936],{"class":424},[400,8708,1066],{"class":413},[400,8710,1069],{"class":455},[400,8712,1151],{"class":424},[106,8714,8715],{},[16,8716,8717,1950,8719,1953,8721,347,8723,1958,8725,1961,8727,1965],{},[28,8718,1949],{},[322,8720,1141],{},[322,8722,1261],{},[322,8724,1264],{},[322,8726,1141],{},[20,8728,1964],{},[52,8730,1969],{"id":1968},[16,8732,8733,1974,8735,1978],{},[322,8734,1129],{},[28,8736,1977],{},[315,8738,8739],{"className":394,"code":1981,"language":396,"meta":324,"style":324},[322,8740,8741,8745,8751,8757,8763,8775,8781,8785,8789,8799,8803,8807,8811,8819,8827,8835],{"__ignoreMap":324},[400,8742,8743],{"class":402,"line":403},[400,8744,1988],{"class":406},[400,8746,8747,8749],{"class":402,"line":410},[400,8748,1129],{"class":413},[400,8750,1995],{"class":424},[400,8752,8753,8755],{"class":402,"line":428},[400,8754,2000],{"class":413},[400,8756,2003],{"class":424},[400,8758,8759,8761],{"class":402,"line":443},[400,8760,1141],{"class":413},[400,8762,2010],{"class":424},[400,8764,8765,8767,8769,8771,8773],{"class":402,"line":462},[400,8766,2015],{"class":413},[400,8768,2018],{"class":424},[400,8770,2021],{"class":413},[400,8772,2024],{"class":424},[400,8774,2027],{"class":413},[400,8776,8777,8779],{"class":402,"line":471},[400,8778,2032],{"class":413},[400,8780,2035],{"class":424},[400,8782,8783],{"class":402,"line":559},[400,8784,1157],{"emptyLinePlaceholder":1156},[400,8786,8787],{"class":402,"line":1456},[400,8788,2044],{"class":406},[400,8790,8791,8793,8795,8797],{"class":402,"line":1556},[400,8792,1129],{"class":413},[400,8794,1132],{"class":413},[400,8796,1135],{"class":413},[400,8798,1605],{"class":424},[400,8800,8801],{"class":402,"line":1561},[400,8802,1157],{"emptyLinePlaceholder":1156},[400,8804,8805],{"class":402,"line":1567},[400,8806,2063],{"class":406},[400,8808,8809],{"class":402,"line":2066},[400,8810,2069],{"class":413},[400,8812,8813,8815,8817],{"class":402,"line":2072},[400,8814,446],{"class":413},[400,8816,2077],{"class":413},[400,8818,2080],{"class":424},[400,8820,8821,8823,8825],{"class":402,"line":2083},[400,8822,2086],{"class":424},[400,8824,2089],{"class":413},[400,8826,2092],{"class":424},[400,8828,8829,8831,8833],{"class":402,"line":2095},[400,8830,2098],{"class":424},[400,8832,2089],{"class":413},[400,8834,2103],{"class":424},[400,8836,8837,8839],{"class":402,"line":2106},[400,8838,2000],{"class":413},[400,8840,1605],{"class":424},[52,8842,2114],{"id":2113},[315,8844,8845],{"className":394,"code":2117,"language":396,"meta":324,"style":324},[322,8846,8847,8851,8867,8871,8875,8881,8909,8937,8945,8949,8953],{"__ignoreMap":324},[400,8848,8849],{"class":402,"line":403},[400,8850,2124],{"class":406},[400,8852,8853,8855,8857,8859,8861,8863,8865],{"class":402,"line":410},[400,8854,1299],{"class":413},[400,8856,2131],{"class":413},[400,8858,2134],{"class":413},[400,8860,1481],{"class":424},[400,8862,1550],{"class":413},[400,8864,2141],{"class":1081},[400,8866,1151],{"class":424},[400,8868,8869],{"class":402,"line":428},[400,8870,1157],{"emptyLinePlaceholder":1156},[400,8872,8873],{"class":402,"line":443},[400,8874,2152],{"class":406},[400,8876,8877,8879],{"class":402,"line":462},[400,8878,2157],{"class":413},[400,8880,1151],{"class":424},[400,8882,8883,8885,8887,8889,8891,8893,8895,8897,8899,8901,8903,8905,8907],{"class":402,"line":471},[400,8884,2164],{"class":413},[400,8886,2167],{"class":424},[400,8888,1812],{"class":413},[400,8890,2172],{"class":424},[400,8892,1066],{"class":413},[400,8894,2172],{"class":424},[400,8896,2179],{"class":413},[400,8898,2182],{"class":455},[400,8900,2185],{"class":413},[400,8902,2188],{"class":424},[400,8904,1066],{"class":413},[400,8906,1844],{"class":455},[400,8908,1151],{"class":424},[400,8910,8911,8913,8915,8917,8919,8921,8923,8925,8927,8929,8931,8933,8935],{"class":402,"line":559},[400,8912,2164],{"class":413},[400,8914,2167],{"class":424},[400,8916,1812],{"class":413},[400,8918,2172],{"class":424},[400,8920,1066],{"class":413},[400,8922,2172],{"class":424},[400,8924,2211],{"class":413},[400,8926,2182],{"class":455},[400,8928,2185],{"class":413},[400,8930,2188],{"class":424},[400,8932,1066],{"class":413},[400,8934,2222],{"class":455},[400,8936,1151],{"class":424},[400,8938,8939,8941,8943],{"class":402,"line":1456},[400,8940,1320],{"class":413},[400,8942,2231],{"class":424},[400,8944,2234],{"class":406},[400,8946,8947],{"class":402,"line":1556},[400,8948,1157],{"emptyLinePlaceholder":1156},[400,8950,8951],{"class":402,"line":1561},[400,8952,2243],{"class":406},[400,8954,8955,8957],{"class":402,"line":1567},[400,8956,1323],{"class":413},[400,8958,1151],{"class":424},[119,8960],{},[11,8962,2255],{"id":2254},[52,8964,2259],{"id":2258},[16,8966,354,8967,2265],{},[28,8968,2264],{},[315,8970,8971],{"className":394,"code":2268,"language":396,"meta":324,"style":324},[322,8972,8973,8977,8997,9017,9037,9041,9045,9069,9073,9077,9099,9121,9143,9147,9151,9177,9181,9185,9205,9209,9213,9223,9243,9247,9257,9277,9281,9285],{"__ignoreMap":324},[400,8974,8975],{"class":402,"line":403},[400,8976,2275],{"class":406},[400,8978,8979,8981,8983,8985,8987,8989,8991,8993,8995],{"class":402,"line":410},[400,8980,1129],{"class":413},[400,8982,1132],{"class":413},[400,8984,1135],{"class":413},[400,8986,1481],{"class":424},[400,8988,1141],{"class":413},[400,8990,1815],{"class":424},[400,8992,2292],{"class":413},[400,8994,2295],{"class":455},[400,8996,1151],{"class":424},[400,8998,8999,9001,9003,9005,9007,9009,9011,9013,9015],{"class":402,"line":428},[400,9000,1129],{"class":413},[400,9002,1132],{"class":413},[400,9004,1135],{"class":413},[400,9006,1481],{"class":424},[400,9008,1141],{"class":413},[400,9010,1936],{"class":424},[400,9012,1066],{"class":413},[400,9014,1069],{"class":455},[400,9016,1151],{"class":424},[400,9018,9019,9021,9023,9025,9027,9029,9031,9033,9035],{"class":402,"line":443},[400,9020,1129],{"class":413},[400,9022,1132],{"class":413},[400,9024,1135],{"class":413},[400,9026,1481],{"class":424},[400,9028,1141],{"class":413},[400,9030,2332],{"class":413},[400,9032,2335],{"class":413},[400,9034,2338],{"class":1081},[400,9036,1151],{"class":424},[400,9038,9039],{"class":402,"line":462},[400,9040,1157],{"emptyLinePlaceholder":1156},[400,9042,9043],{"class":402,"line":471},[400,9044,2349],{"class":406},[400,9046,9047,9049,9051,9053,9055,9057,9059,9061,9063,9065,9067],{"class":402,"line":559},[400,9048,1129],{"class":413},[400,9050,1132],{"class":413},[400,9052,1135],{"class":413},[400,9054,1481],{"class":424},[400,9056,1141],{"class":413},[400,9058,1815],{"class":424},[400,9060,2366],{"class":413},[400,9062,2182],{"class":455},[400,9064,2371],{"class":413},[400,9066,2374],{"class":455},[400,9068,1151],{"class":424},[400,9070,9071],{"class":402,"line":1456},[400,9072,1157],{"emptyLinePlaceholder":1156},[400,9074,9075],{"class":402,"line":1556},[400,9076,2385],{"class":406},[400,9078,9079,9081,9083,9085,9087,9089,9091,9093,9095,9097],{"class":402,"line":1561},[400,9080,1129],{"class":413},[400,9082,1132],{"class":413},[400,9084,1135],{"class":413},[400,9086,1481],{"class":424},[400,9088,1141],{"class":413},[400,9090,2332],{"class":413},[400,9092,2402],{"class":413},[400,9094,2405],{"class":1081},[400,9096,2408],{"class":424},[400,9098,2411],{"class":406},[400,9100,9101,9103,9105,9107,9109,9111,9113,9115,9117,9119],{"class":402,"line":1567},[400,9102,1129],{"class":413},[400,9104,1132],{"class":413},[400,9106,1135],{"class":413},[400,9108,1481],{"class":424},[400,9110,1141],{"class":413},[400,9112,2332],{"class":413},[400,9114,2402],{"class":413},[400,9116,2430],{"class":1081},[400,9118,2231],{"class":424},[400,9120,2435],{"class":406},[400,9122,9123,9125,9127,9129,9131,9133,9135,9137,9139,9141],{"class":402,"line":2066},[400,9124,1129],{"class":413},[400,9126,1132],{"class":413},[400,9128,1135],{"class":413},[400,9130,1481],{"class":424},[400,9132,1141],{"class":413},[400,9134,2332],{"class":413},[400,9136,2402],{"class":413},[400,9138,2454],{"class":1081},[400,9140,2408],{"class":424},[400,9142,2459],{"class":406},[400,9144,9145],{"class":402,"line":2072},[400,9146,1157],{"emptyLinePlaceholder":1156},[400,9148,9149],{"class":402,"line":2083},[400,9150,2468],{"class":406},[400,9152,9153,9155,9157,9159,9161,9163,9165,9167,9169,9171,9173,9175],{"class":402,"line":2095},[400,9154,1129],{"class":413},[400,9156,1132],{"class":413},[400,9158,1135],{"class":413},[400,9160,1481],{"class":424},[400,9162,1141],{"class":413},[400,9164,2483],{"class":424},[400,9166,2486],{"class":413},[400,9168,1674],{"class":424},[400,9170,2491],{"class":1081},[400,9172,872],{"class":424},[400,9174,2496],{"class":1081},[400,9176,474],{"class":424},[400,9178,9179],{"class":402,"line":2106},[400,9180,1157],{"emptyLinePlaceholder":1156},[400,9182,9183],{"class":402,"line":2505},[400,9184,2508],{"class":406},[400,9186,9187,9189,9191,9193,9195,9197,9199,9201,9203],{"class":402,"line":2511},[400,9188,1129],{"class":413},[400,9190,1132],{"class":413},[400,9192,1135],{"class":413},[400,9194,1481],{"class":424},[400,9196,1141],{"class":413},[400,9198,2483],{"class":424},[400,9200,1179],{"class":413},[400,9202,1094],{"class":413},[400,9204,1151],{"class":424},[400,9206,9207],{"class":402,"line":2532},[400,9208,1157],{"emptyLinePlaceholder":1156},[400,9210,9211],{"class":402,"line":2537},[400,9212,2540],{"class":406},[400,9214,9215,9217,9219,9221],{"class":402,"line":2543},[400,9216,1129],{"class":413},[400,9218,1132],{"class":413},[400,9220,1135],{"class":413},[400,9222,1807],{"class":424},[400,9224,9225,9227,9229,9231,9233,9235,9237,9239,9241],{"class":402,"line":2554},[400,9226,1141],{"class":413},[400,9228,1815],{"class":424},[400,9230,2561],{"class":413},[400,9232,2374],{"class":455},[400,9234,2371],{"class":413},[400,9236,1936],{"class":424},[400,9238,2292],{"class":413},[400,9240,2572],{"class":455},[400,9242,1151],{"class":424},[400,9244,9245],{"class":402,"line":2577},[400,9246,1157],{"emptyLinePlaceholder":1156},[400,9248,9249,9251,9253,9255],{"class":402,"line":2582},[400,9250,1129],{"class":413},[400,9252,1132],{"class":413},[400,9254,1135],{"class":413},[400,9256,1807],{"class":424},[400,9258,9259,9261,9263,9265,9267,9269,9271,9273,9275],{"class":402,"line":2593},[400,9260,1141],{"class":413},[400,9262,2483],{"class":424},[400,9264,1066],{"class":413},[400,9266,2602],{"class":1081},[400,9268,2605],{"class":413},[400,9270,1815],{"class":424},[400,9272,2561],{"class":413},[400,9274,2182],{"class":455},[400,9276,1151],{"class":424},[400,9278,9279],{"class":402,"line":2616},[400,9280,1157],{"emptyLinePlaceholder":1156},[400,9282,9283],{"class":402,"line":2621},[400,9284,2624],{"class":406},[400,9286,9287,9289,9291,9293,9295,9297,9299,9301,9303,9305],{"class":402,"line":2627},[400,9288,1129],{"class":413},[400,9290,1132],{"class":413},[400,9292,1135],{"class":413},[400,9294,1481],{"class":424},[400,9296,1141],{"class":413},[400,9298,2640],{"class":413},[400,9300,2643],{"class":424},[400,9302,2292],{"class":413},[400,9304,2648],{"class":455},[400,9306,474],{"class":424},[52,9308,2654],{"id":2653},[315,9310,9311],{"className":394,"code":2657,"language":396,"meta":324,"style":324},[322,9312,9313,9317,9335,9339,9343,9361,9365,9369,9391,9395,9399,9421,9425,9429],{"__ignoreMap":324},[400,9314,9315],{"class":402,"line":403},[400,9316,2664],{"class":406},[400,9318,9319,9321,9323,9325,9327,9329,9331,9333],{"class":402,"line":410},[400,9320,1129],{"class":413},[400,9322,1132],{"class":413},[400,9324,1135],{"class":413},[400,9326,1481],{"class":424},[400,9328,2015],{"class":413},[400,9330,1815],{"class":424},[400,9332,2021],{"class":413},[400,9334,1151],{"class":424},[400,9336,9337],{"class":402,"line":428},[400,9338,1157],{"emptyLinePlaceholder":1156},[400,9340,9341],{"class":402,"line":443},[400,9342,2691],{"class":406},[400,9344,9345,9347,9349,9351,9353,9355,9357,9359],{"class":402,"line":462},[400,9346,1129],{"class":413},[400,9348,1132],{"class":413},[400,9350,1135],{"class":413},[400,9352,1481],{"class":424},[400,9354,2015],{"class":413},[400,9356,1815],{"class":424},[400,9358,2708],{"class":413},[400,9360,1151],{"class":424},[400,9362,9363],{"class":402,"line":471},[400,9364,1157],{"emptyLinePlaceholder":1156},[400,9366,9367],{"class":402,"line":559},[400,9368,2719],{"class":406},[400,9370,9371,9373,9375,9377,9379,9381,9383,9385,9387,9389],{"class":402,"line":1456},[400,9372,1129],{"class":413},[400,9374,1132],{"class":413},[400,9376,1135],{"class":413},[400,9378,1481],{"class":424},[400,9380,2015],{"class":413},[400,9382,2483],{"class":424},[400,9384,2021],{"class":413},[400,9386,2738],{"class":424},[400,9388,2708],{"class":413},[400,9390,1151],{"class":424},[400,9392,9393],{"class":402,"line":1556},[400,9394,1157],{"emptyLinePlaceholder":1156},[400,9396,9397],{"class":402,"line":1561},[400,9398,2751],{"class":406},[400,9400,9401,9403,9405,9407,9409,9411,9413,9415,9417,9419],{"class":402,"line":1567},[400,9402,1129],{"class":413},[400,9404,1132],{"class":413},[400,9406,1135],{"class":413},[400,9408,1481],{"class":424},[400,9410,2015],{"class":413},[400,9412,1815],{"class":424},[400,9414,2708],{"class":413},[400,9416,2770],{"class":413},[400,9418,2773],{"class":455},[400,9420,1151],{"class":424},[400,9422,9423],{"class":402,"line":2066},[400,9424,1157],{"emptyLinePlaceholder":1156},[400,9426,9427],{"class":402,"line":2072},[400,9428,2784],{"class":406},[400,9430,9431,9433,9435,9437,9439,9441,9443,9445,9447,9449,9451],{"class":402,"line":2083},[400,9432,1129],{"class":413},[400,9434,1132],{"class":413},[400,9436,1135],{"class":413},[400,9438,1481],{"class":424},[400,9440,2015],{"class":413},[400,9442,1839],{"class":424},[400,9444,2032],{"class":413},[400,9446,2572],{"class":455},[400,9448,2805],{"class":424},[400,9450,1409],{"class":455},[400,9452,1151],{"class":424},[52,9454,2813],{"id":2812},[16,9456,9457,2819,9459,2823],{},[28,9458,2818],{},[20,9460,2822],{},[135,9462,9463,9473],{},[138,9464,9465],{},[141,9466,9467,9469,9471],{},[144,9468,2832],{},[144,9470,2835],{},[144,9472,600],{},[154,9474,9475,9489,9503,9517,9531],{},[141,9476,9477,9481,9483],{},[159,9478,9479],{},[322,9480,2846],{},[159,9482,2849],{},[159,9484,9485,2854,9487],{},[322,9486,2846],{},[322,9488,2857],{},[141,9490,9491,9495,9497],{},[159,9492,9493],{},[322,9494,2864],{},[159,9496,2867],{},[159,9498,9499,2854,9501],{},[322,9500,2872],{},[322,9502,2875],{},[141,9504,9505,9509,9511],{},[159,9506,9507],{},[322,9508,2882],{},[159,9510,2885],{},[159,9512,9513,2854,9515],{},[322,9514,2890],{},[322,9516,2893],{},[141,9518,9519,9523,9525],{},[159,9520,9521],{},[322,9522,2900],{},[159,9524,2903],{},[159,9526,9527,2854,9529],{},[322,9528,2908],{},[322,9530,2911],{},[141,9532,9533,9537,9539],{},[159,9534,9535],{},[322,9536,2918],{},[159,9538,2921],{},[159,9540,9541,2854,9543],{},[322,9542,2926],{},[322,9544,2929],{},[315,9546,9547],{"className":394,"code":2932,"language":396,"meta":324,"style":324},[322,9548,9549,9553,9573,9577,9581,9597,9601,9605,9609,9613,9627,9637,9647,9653],{"__ignoreMap":324},[400,9550,9551],{"class":402,"line":403},[400,9552,2939],{"class":406},[400,9554,9555,9557,9559,9561,9563,9565,9567,9569,9571],{"class":402,"line":410},[400,9556,1129],{"class":413},[400,9558,2946],{"class":455},[400,9560,452],{"class":424},[400,9562,1874],{"class":413},[400,9564,1381],{"class":424},[400,9566,2089],{"class":413},[400,9568,2957],{"class":424},[400,9570,2000],{"class":413},[400,9572,1605],{"class":424},[400,9574,9575],{"class":402,"line":428},[400,9576,1157],{"emptyLinePlaceholder":1156},[400,9578,9579],{"class":402,"line":443},[400,9580,2970],{"class":406},[400,9582,9583,9585,9587,9589,9591,9593,9595],{"class":402,"line":462},[400,9584,1129],{"class":413},[400,9586,2977],{"class":455},[400,9588,2980],{"class":424},[400,9590,2089],{"class":413},[400,9592,2985],{"class":424},[400,9594,2000],{"class":413},[400,9596,1605],{"class":424},[400,9598,9599],{"class":402,"line":471},[400,9600,1157],{"emptyLinePlaceholder":1156},[400,9602,9603],{"class":402,"line":559},[400,9604,2998],{"class":406},[400,9606,9607],{"class":402,"line":1456},[400,9608,2069],{"class":413},[400,9610,9611],{"class":402,"line":1556},[400,9612,3007],{"class":424},[400,9614,9615,9617,9619,9621,9623,9625],{"class":402,"line":1561},[400,9616,3012],{"class":455},[400,9618,452],{"class":424},[400,9620,1874],{"class":413},[400,9622,3019],{"class":424},[400,9624,2089],{"class":413},[400,9626,3024],{"class":424},[400,9628,9629,9631,9633,9635],{"class":402,"line":1567},[400,9630,3029],{"class":455},[400,9632,3032],{"class":424},[400,9634,2089],{"class":413},[400,9636,3037],{"class":424},[400,9638,9639,9641,9643,9645],{"class":402,"line":2066},[400,9640,3042],{"class":455},[400,9642,3045],{"class":424},[400,9644,2089],{"class":413},[400,9646,3050],{"class":424},[400,9648,9649,9651],{"class":402,"line":2072},[400,9650,2000],{"class":413},[400,9652,1807],{"class":424},[400,9654,9655,9657],{"class":402,"line":2083},[400,9656,3061],{"class":413},[400,9658,3064],{"class":424},[16,9660,9661],{},[28,9662,3069],{},[315,9664,9666],{"className":9665,"code":3073,"language":320},[318],[322,9667,3073],{"__ignoreMap":324},[375,9669,3079],{"id":3078},[16,9671,9672,3084,9674,3088,9676,3084,9678,3095,9680,3099],{},[322,9673,1141],{},[20,9675,3087],{},[322,9677,3091],{},[20,9679,3094],{},[28,9681,3098],{},[315,9683,9684],{"className":394,"code":3102,"language":396,"meta":324,"style":324},[322,9685,9686,9690,9708,9714,9720,9738,9742,9746,9760,9766,9772],{"__ignoreMap":324},[400,9687,9688],{"class":402,"line":403},[400,9689,3109],{"class":406},[400,9691,9692,9694,9696,9698,9700,9702,9704,9706],{"class":402,"line":410},[400,9693,1129],{"class":413},[400,9695,3116],{"class":424},[400,9697,3119],{"class":455},[400,9699,452],{"class":424},[400,9701,1874],{"class":413},[400,9703,1381],{"class":424},[400,9705,2089],{"class":413},[400,9707,3130],{"class":424},[400,9709,9710,9712],{"class":402,"line":428},[400,9711,2000],{"class":413},[400,9713,1807],{"class":424},[400,9715,9716,9718],{"class":402,"line":443},[400,9717,3061],{"class":413},[400,9719,3143],{"class":424},[400,9721,9722,9724,9726,9728,9730,9732,9734,9736],{"class":402,"line":462},[400,9723,3091],{"class":413},[400,9725,2946],{"class":455},[400,9727,452],{"class":424},[400,9729,1874],{"class":413},[400,9731,1381],{"class":424},[400,9733,2292],{"class":413},[400,9735,2222],{"class":455},[400,9737,1151],{"class":424},[400,9739,9740],{"class":402,"line":471},[400,9741,1157],{"emptyLinePlaceholder":1156},[400,9743,9744],{"class":402,"line":559},[400,9745,3170],{"class":406},[400,9747,9748,9750,9752,9754,9756,9758],{"class":402,"line":1456},[400,9749,1129],{"class":413},[400,9751,3116],{"class":424},[400,9753,3179],{"class":455},[400,9755,2980],{"class":424},[400,9757,2089],{"class":413},[400,9759,3186],{"class":424},[400,9761,9762,9764],{"class":402,"line":1556},[400,9763,2000],{"class":413},[400,9765,1807],{"class":424},[400,9767,9768,9770],{"class":402,"line":1561},[400,9769,3061],{"class":413},[400,9771,3143],{"class":424},[400,9773,9774,9776,9778,9780,9782,9784],{"class":402,"line":1567},[400,9775,3091],{"class":413},[400,9777,2977],{"class":455},[400,9779,2980],{"class":424},[400,9781,2292],{"class":413},[400,9783,2374],{"class":455},[400,9785,1151],{"class":424},[106,9787,9788],{},[16,9789,9790,1630,9792,3222,9794,3225],{},[28,9791,3219],{},[322,9793,1141],{},[322,9795,3091],{},[375,9797,3229],{"id":3228},[16,9799,3232,9800,3236,9802,3240],{},[20,9801,3235],{},[20,9803,3239],{},[315,9805,9807],{"className":9806,"code":3244,"language":320},[318],[322,9808,3244],{"__ignoreMap":324},[16,9810,3249,9811,3253,9813,3256,9815,3259],{},[20,9812,3252],{},[322,9814,1129],{},[322,9816,1141],{},[52,9818,3263],{"id":3262},[16,9820,9821,3269,9823,3273,9825,3277],{},[28,9822,3268],{},[20,9824,3272],{},[28,9826,3276],{},[16,9828,3280],{},[315,9830,9831],{"className":394,"code":3283,"language":396,"meta":324,"style":324},[322,9832,9833,9837,9841],{"__ignoreMap":324},[400,9834,9835],{"class":402,"line":403},[400,9836,3290],{"class":406},[400,9838,9839],{"class":402,"line":410},[400,9840,3295],{"class":406},[400,9842,9843],{"class":402,"line":428},[400,9844,3300],{"class":406},[16,9846,9847],{},[59,9848],{"alt":3305,"src":3306},[375,9850,3310],{"id":3309},[16,9852,3313,9853,35],{},[28,9854,3316],{},[315,9856,9857],{"className":394,"code":3319,"language":396,"meta":324,"style":324},[322,9858,9859,9863,9875,9887,9897,9905,9911],{"__ignoreMap":324},[400,9860,9861],{"class":402,"line":403},[400,9862,2069],{"class":413},[400,9864,9865,9867,9869,9871,9873],{"class":402,"line":410},[400,9866,3330],{"class":455},[400,9868,35],{"class":424},[400,9870,1521],{"class":455},[400,9872,2077],{"class":413},[400,9874,3339],{"class":424},[400,9876,9877,9879,9881,9883,9885],{"class":402,"line":428},[400,9878,3344],{"class":455},[400,9880,35],{"class":424},[400,9882,3349],{"class":455},[400,9884,3352],{"class":413},[400,9886,3355],{"class":424},[400,9888,9889,9891,9893,9895],{"class":402,"line":443},[400,9890,3344],{"class":455},[400,9892,35],{"class":424},[400,9894,3364],{"class":455},[400,9896,440],{"class":424},[400,9898,9899,9901,9903],{"class":402,"line":462},[400,9900,3344],{"class":455},[400,9902,35],{"class":424},[400,9904,3375],{"class":455},[400,9906,9907,9909],{"class":402,"line":471},[400,9908,2000],{"class":413},[400,9910,3382],{"class":424},[400,9912,9913,9915,9917,9919,9921,9923,9925,9927,9929,9931,9933],{"class":402,"line":559},[400,9914,3310],{"class":413},[400,9916,3389],{"class":424},[400,9918,3392],{"class":413},[400,9920,3395],{"class":455},[400,9922,35],{"class":424},[400,9924,3349],{"class":455},[400,9926,3402],{"class":413},[400,9928,3405],{"class":455},[400,9930,35],{"class":424},[400,9932,3410],{"class":455},[400,9934,1151],{"class":424},[106,9936,9937],{},[16,9938,3417,9939,3421],{},[28,9940,3420],{},[375,9942,3425],{"id":3424},[16,9944,3428,9945,3432],{},[28,9946,3431],{},[315,9948,9949],{"className":394,"code":3435,"language":396,"meta":324,"style":324},[322,9950,9951,9955,9959,9971,9983,9991,9997],{"__ignoreMap":324},[400,9952,9953],{"class":402,"line":403},[400,9954,3442],{"class":406},[400,9956,9957],{"class":402,"line":410},[400,9958,2069],{"class":413},[400,9960,9961,9963,9965,9967,9969],{"class":402,"line":428},[400,9962,3330],{"class":455},[400,9964,35],{"class":424},[400,9966,1521],{"class":455},[400,9968,2077],{"class":413},[400,9970,3339],{"class":424},[400,9972,9973,9975,9977,9979,9981],{"class":402,"line":443},[400,9974,3344],{"class":455},[400,9976,35],{"class":424},[400,9978,3349],{"class":455},[400,9980,3352],{"class":413},[400,9982,3355],{"class":424},[400,9984,9985,9987,9989],{"class":402,"line":462},[400,9986,3344],{"class":455},[400,9988,35],{"class":424},[400,9990,3479],{"class":455},[400,9992,9993,9995],{"class":402,"line":471},[400,9994,2000],{"class":413},[400,9996,3382],{"class":424},[400,9998,9999,10001,10003,10005,10007,10009,10011,10013,10015,10017,10019],{"class":402,"line":559},[400,10000,3490],{"class":413},[400,10002,3389],{"class":424},[400,10004,3392],{"class":413},[400,10006,3395],{"class":455},[400,10008,35],{"class":424},[400,10010,3349],{"class":455},[400,10012,3402],{"class":413},[400,10014,3405],{"class":455},[400,10016,35],{"class":424},[400,10018,3410],{"class":455},[400,10020,1151],{"class":424},[106,10022,10023],{},[16,10024,3515,10025,35],{},[322,10026,3518],{},[375,10028,3522],{"id":3521},[16,10030,3525],{},[375,10032,3529],{"id":3528},[16,10034,3532,10035,3536],{},[28,10036,3535],{},[315,10038,10039],{"className":394,"code":3539,"language":396,"meta":324,"style":324},[322,10040,10041,10063,10069],{"__ignoreMap":324},[400,10042,10043,10045,10047,10049,10051,10053,10055,10057,10059,10061],{"class":402,"line":403},[400,10044,1129],{"class":413},[400,10046,3395],{"class":455},[400,10048,35],{"class":424},[400,10050,1521],{"class":455},[400,10052,872],{"class":424},[400,10054,3556],{"class":455},[400,10056,35],{"class":424},[400,10058,3349],{"class":455},[400,10060,3563],{"class":413},[400,10062,3566],{"class":424},[400,10064,10065,10067],{"class":402,"line":410},[400,10066,2000],{"class":413},[400,10068,3382],{"class":424},[400,10070,10071,10073,10075,10077,10079,10081,10083,10085,10087,10089,10091],{"class":402,"line":428},[400,10072,3529],{"class":413},[400,10074,3389],{"class":424},[400,10076,3392],{"class":413},[400,10078,3395],{"class":455},[400,10080,35],{"class":424},[400,10082,3349],{"class":455},[400,10084,3402],{"class":413},[400,10086,3405],{"class":455},[400,10088,35],{"class":424},[400,10090,3410],{"class":455},[400,10092,1151],{"class":424},[375,10094,3600],{"id":3599},[16,10096,3603,10097,3607],{},[28,10098,3606],{},[315,10100,10101],{"className":394,"code":3610,"language":396,"meta":324,"style":324},[322,10102,10103,10107,10125,10131],{"__ignoreMap":324},[400,10104,10105],{"class":402,"line":403},[400,10106,3617],{"class":406},[400,10108,10109,10111,10113,10115,10117,10119,10121,10123],{"class":402,"line":410},[400,10110,1129],{"class":413},[400,10112,3624],{"class":455},[400,10114,35],{"class":424},[400,10116,1521],{"class":455},[400,10118,872],{"class":424},[400,10120,3633],{"class":455},[400,10122,35],{"class":424},[400,10124,3638],{"class":455},[400,10126,10127,10129],{"class":402,"line":428},[400,10128,2000],{"class":413},[400,10130,3645],{"class":424},[400,10132,10133,10135],{"class":402,"line":443},[400,10134,3600],{"class":413},[400,10136,3652],{"class":424},[375,10138,3656],{"id":3655},[315,10140,10141],{"className":394,"code":3659,"language":396,"meta":324,"style":324},[322,10142,10143,10147,10159,10171,10181,10189,10195,10217,10239,10261],{"__ignoreMap":324},[400,10144,10145],{"class":402,"line":403},[400,10146,2069],{"class":413},[400,10148,10149,10151,10153,10155,10157],{"class":402,"line":410},[400,10150,3330],{"class":455},[400,10152,35],{"class":424},[400,10154,1521],{"class":455},[400,10156,3352],{"class":413},[400,10158,3678],{"class":424},[400,10160,10161,10163,10165,10167,10169],{"class":402,"line":428},[400,10162,3683],{"class":455},[400,10164,35],{"class":424},[400,10166,1521],{"class":455},[400,10168,3352],{"class":413},[400,10170,3692],{"class":424},[400,10172,10173,10175,10177,10179],{"class":402,"line":443},[400,10174,3697],{"class":455},[400,10176,35],{"class":424},[400,10178,3702],{"class":455},[400,10180,440],{"class":424},[400,10182,10183,10185,10187],{"class":402,"line":462},[400,10184,3697],{"class":455},[400,10186,35],{"class":424},[400,10188,3713],{"class":455},[400,10190,10191,10193],{"class":402,"line":471},[400,10192,2000],{"class":413},[400,10194,3382],{"class":424},[400,10196,10197,10199,10201,10203,10205,10207,10209,10211,10213,10215],{"class":402,"line":559},[400,10198,3724],{"class":413},[400,10200,3727],{"class":424},[400,10202,3392],{"class":413},[400,10204,3395],{"class":455},[400,10206,35],{"class":424},[400,10208,3349],{"class":455},[400,10210,3738],{"class":413},[400,10212,3405],{"class":455},[400,10214,35],{"class":424},[400,10216,3745],{"class":455},[400,10218,10219,10221,10223,10225,10227,10229,10231,10233,10235,10237],{"class":402,"line":1456},[400,10220,3724],{"class":413},[400,10222,3752],{"class":424},[400,10224,3392],{"class":413},[400,10226,3405],{"class":455},[400,10228,35],{"class":424},[400,10230,3349],{"class":455},[400,10232,3402],{"class":413},[400,10234,3765],{"class":455},[400,10236,35],{"class":424},[400,10238,3770],{"class":455},[400,10240,10241,10243,10245,10247,10249,10251,10253,10255,10257,10259],{"class":402,"line":1556},[400,10242,3724],{"class":413},[400,10244,3777],{"class":424},[400,10246,3392],{"class":413},[400,10248,3782],{"class":455},[400,10250,35],{"class":424},[400,10252,3349],{"class":455},[400,10254,3789],{"class":413},[400,10256,3765],{"class":455},[400,10258,35],{"class":424},[400,10260,3796],{"class":455},[400,10262,10263,10265,10267,10269,10271,10273,10275],{"class":402,"line":1561},[400,10264,1141],{"class":413},[400,10266,3395],{"class":455},[400,10268,35],{"class":424},[400,10270,3349],{"class":455},[400,10272,3402],{"class":413},[400,10274,2773],{"class":455},[400,10276,1151],{"class":424},[52,10278,3816],{"id":3815},[16,10280,38,10281,3822],{},[28,10282,3821],{},[315,10284,10285],{"className":394,"code":3825,"language":396,"meta":324,"style":324},[322,10286,10287,10291,10301,10311,10321,10325,10329,10333,10345,10355,10367,10371,10375,10379,10385,10391,10405,10411,10417,10425],{"__ignoreMap":324},[400,10288,10289],{"class":402,"line":403},[400,10290,3832],{"class":406},[400,10292,10293,10295,10297,10299],{"class":402,"line":410},[400,10294,1129],{"class":413},[400,10296,2332],{"class":413},[400,10298,1135],{"class":413},[400,10300,3843],{"class":424},[400,10302,10303,10305,10307,10309],{"class":402,"line":428},[400,10304,1141],{"class":413},[400,10306,2188],{"class":424},[400,10308,2486],{"class":413},[400,10310,425],{"class":424},[400,10312,10313,10315,10317,10319],{"class":402,"line":443},[400,10314,3858],{"class":413},[400,10316,3861],{"class":424},[400,10318,2000],{"class":413},[400,10320,3866],{"class":424},[400,10322,10323],{"class":402,"line":462},[400,10324,474],{"class":424},[400,10326,10327],{"class":402,"line":471},[400,10328,1157],{"emptyLinePlaceholder":1156},[400,10330,10331],{"class":402,"line":559},[400,10332,3879],{"class":406},[400,10334,10335,10337,10339,10341,10343],{"class":402,"line":1456},[400,10336,1129],{"class":413},[400,10338,2332],{"class":413},[400,10340,2738],{"class":424},[400,10342,2000],{"class":413},[400,10344,1807],{"class":424},[400,10346,10347,10349,10351,10353],{"class":402,"line":1556},[400,10348,1141],{"class":413},[400,10350,1815],{"class":424},[400,10352,2292],{"class":413},[400,10354,425],{"class":424},[400,10356,10357,10359,10361,10363,10365],{"class":402,"line":1561},[400,10358,3906],{"class":413},[400,10360,2977],{"class":455},[400,10362,2980],{"class":424},[400,10364,2000],{"class":413},[400,10366,1807],{"class":424},[400,10368,10369],{"class":402,"line":1567},[400,10370,474],{"class":424},[400,10372,10373],{"class":402,"line":2066},[400,10374,1157],{"emptyLinePlaceholder":1156},[400,10376,10377],{"class":402,"line":2072},[400,10378,3927],{"class":406},[400,10380,10381,10383],{"class":402,"line":2083},[400,10382,1129],{"class":413},[400,10384,3934],{"class":424},[400,10386,10387,10389],{"class":402,"line":2095},[400,10388,2000],{"class":413},[400,10390,425],{"class":424},[400,10392,10393,10395,10397,10399,10401,10403],{"class":402,"line":2106},[400,10394,3906],{"class":413},[400,10396,3116],{"class":424},[400,10398,3179],{"class":455},[400,10400,2980],{"class":424},[400,10402,2089],{"class":413},[400,10404,3186],{"class":424},[400,10406,10407,10409],{"class":402,"line":2505},[400,10408,3959],{"class":413},[400,10410,1807],{"class":424},[400,10412,10413,10415],{"class":402,"line":2511},[400,10414,3966],{"class":413},[400,10416,3143],{"class":424},[400,10418,10419,10421,10423],{"class":402,"line":2532},[400,10420,1381],{"class":424},[400,10422,2089],{"class":413},[400,10424,3977],{"class":424},[400,10426,10427,10429,10431,10433,10435],{"class":402,"line":2537},[400,10428,1141],{"class":413},[400,10430,2985],{"class":424},[400,10432,2292],{"class":413},[400,10434,3988],{"class":455},[400,10436,1151],{"class":424},[119,10438],{},[11,10440,3996],{"id":3995},[16,10442,10443,4002,10445,4006],{},[28,10444,4001],{},[28,10446,4005],{},[135,10448,10449,10457],{},[138,10450,10451],{},[141,10452,10453,10455],{},[144,10454,4015],{},[144,10456,4018],{},[154,10458,10459,10467,10475,10483,10491,10499],{},[141,10460,10461,10465],{},[159,10462,10463],{},[322,10464,4027],{},[159,10466,4030],{},[141,10468,10469,10473],{},[159,10470,10471],{},[322,10472,4037],{},[159,10474,4040],{},[141,10476,10477,10481],{},[159,10478,10479],{},[322,10480,1384],{},[159,10482,4049],{},[141,10484,10485,10489],{},[159,10486,10487],{},[322,10488,4056],{},[159,10490,4059],{},[141,10492,10493,10497],{},[159,10494,10495],{},[322,10496,4066],{},[159,10498,4069],{},[141,10500,10501,10505],{},[159,10502,10503],{},[322,10504,4076],{},[159,10506,4079],{},[315,10508,10509],{"className":394,"code":4082,"language":396,"meta":324,"style":324},[322,10510,10511,10521,10531,10549,10565,10591,10609,10621],{"__ignoreMap":324},[400,10512,10513,10515,10517,10519],{"class":402,"line":403},[400,10514,414],{"class":413},[400,10516,417],{"class":413},[400,10518,4093],{"class":420},[400,10520,425],{"class":424},[400,10522,10523,10525,10527,10529],{"class":402,"line":410},[400,10524,4100],{"class":424},[400,10526,1358],{"class":413},[400,10528,437],{"class":413},[400,10530,440],{"class":424},[400,10532,10533,10535,10537,10539,10541,10543,10545,10547],{"class":402,"line":428},[400,10534,4111],{"class":424},[400,10536,1490],{"class":413},[400,10538,452],{"class":424},[400,10540,4118],{"class":455},[400,10542,1381],{"class":424},[400,10544,1384],{"class":413},[400,10546,4125],{"class":413},[400,10548,440],{"class":424},[400,10550,10551,10553,10555,10557,10559,10561,10563],{"class":402,"line":443},[400,10552,446],{"class":413},[400,10554,449],{"class":413},[400,10556,452],{"class":424},[400,10558,456],{"class":455},[400,10560,1381],{"class":424},[400,10562,1384],{"class":413},[400,10564,440],{"class":424},[400,10566,10567,10569,10571,10573,10575,10577,10579,10581,10583,10585,10587,10589],{"class":402,"line":462},[400,10568,4148],{"class":424},[400,10570,1404],{"class":413},[400,10572,452],{"class":424},[400,10574,1409],{"class":455},[400,10576,4157],{"class":424},[400,10578,1414],{"class":455},[400,10580,1381],{"class":424},[400,10582,4076],{"class":413},[400,10584,4166],{"class":424},[400,10586,2292],{"class":413},[400,10588,1069],{"class":455},[400,10590,459],{"class":424},[400,10592,10593,10595,10597,10599,10601,10603,10605,10607],{"class":402,"line":471},[400,10594,4177],{"class":424},[400,10596,1490],{"class":413},[400,10598,452],{"class":424},[400,10600,1692],{"class":455},[400,10602,1381],{"class":424},[400,10604,4066],{"class":413},[400,10606,4190],{"class":1081},[400,10608,440],{"class":424},[400,10610,10611,10613,10615,10617,10619],{"class":402,"line":559},[400,10612,4197],{"class":424},[400,10614,434],{"class":413},[400,10616,533],{"class":413},[400,10618,4204],{"class":424},[400,10620,4207],{"class":406},[400,10622,10623],{"class":402,"line":1456},[400,10624,474],{"class":424},[16,10626,10627],{},[28,10628,4216],{},[315,10630,10631],{"className":394,"code":4219,"language":396,"meta":324,"style":324},[322,10632,10633,10637,10647,10665,10669,10679],{"__ignoreMap":324},[400,10634,10635],{"class":402,"line":403},[400,10636,4226],{"class":406},[400,10638,10639,10641,10643,10645],{"class":402,"line":410},[400,10640,1658],{"class":413},[400,10642,4233],{"class":424},[400,10644,1521],{"class":413},[400,10646,4238],{"class":424},[400,10648,10649,10651,10653,10655,10657,10659,10661,10663],{"class":402,"line":428},[400,10650,1671],{"class":413},[400,10652,1674],{"class":424},[400,10654,4247],{"class":1081},[400,10656,872],{"class":424},[400,10658,938],{"class":1081},[400,10660,872],{"class":424},[400,10662,4256],{"class":455},[400,10664,474],{"class":424},[400,10666,10667],{"class":402,"line":443},[400,10668,1157],{"emptyLinePlaceholder":1156},[400,10670,10671,10673,10675,10677],{"class":402,"line":462},[400,10672,1658],{"class":413},[400,10674,4233],{"class":424},[400,10676,1521],{"class":413},[400,10678,4238],{"class":424},[400,10680,10681,10683,10685,10687,10689,10691,10693,10695,10697],{"class":402,"line":471},[400,10682,1671],{"class":413},[400,10684,1674],{"class":424},[400,10686,4247],{"class":1081},[400,10688,872],{"class":424},[400,10690,4285],{"class":1081},[400,10692,872],{"class":424},[400,10694,4290],{"class":455},[400,10696,4293],{"class":424},[400,10698,4296],{"class":406},[16,10700,4299,10701,4303],{},[28,10702,4302],{},[119,10704],{},[11,10706,4309],{"id":4308},[16,10708,10709,4315,10711,4319,10713,4322,10715,35],{},[28,10710,4314],{},[28,10712,4318],{},[28,10714,4005],{},[28,10716,4325],{},[52,10718,4329],{"id":4328},[16,10720,4332],{},[315,10722,10724],{"className":10723,"code":4336,"language":320},[318],[322,10725,4336],{"__ignoreMap":324},[16,10727,10728],{},[28,10729,4343],{},[67,10731,10732,10736,10738],{},[70,10733,4348,10734,4352],{},[20,10735,4351],{},[70,10737,4355],{},[70,10739,4358],{},[52,10741,4362],{"id":4361},[375,10743,4366],{"id":4365},[67,10745,10746,10750],{},[70,10747,4371,10748,4375],{},[28,10749,4374],{},[70,10751,4378],{},[315,10753,10754],{"className":394,"code":4381,"language":396,"meta":324,"style":324},[322,10755,10756,10760,10764,10770,10782,10786,10790,10794,10800,10808,10816],{"__ignoreMap":324},[400,10757,10758],{"class":402,"line":403},[400,10759,4388],{"class":406},[400,10761,10762],{"class":402,"line":410},[400,10763,4393],{"class":424},[400,10765,10766,10768],{"class":402,"line":428},[400,10767,2024],{"class":424},[400,10769,4400],{"class":406},[400,10771,10772,10774,10776,10778,10780],{"class":402,"line":443},[400,10773,4405],{"class":424},[400,10775,883],{"class":455},[400,10777,4410],{"class":424},[400,10779,4413],{"class":1081},[400,10781,4416],{"class":424},[400,10783,10784],{"class":402,"line":462},[400,10785,1157],{"emptyLinePlaceholder":1156},[400,10787,10788],{"class":402,"line":471},[400,10789,4425],{"class":406},[400,10791,10792],{"class":402,"line":559},[400,10793,4430],{"class":424},[400,10795,10796,10798],{"class":402,"line":1456},[400,10797,2024],{"class":424},[400,10799,4437],{"class":406},[400,10801,10802,10804,10806],{"class":402,"line":1556},[400,10803,4405],{"class":424},[400,10805,883],{"class":455},[400,10807,4446],{"class":424},[400,10809,10810,10812,10814],{"class":402,"line":1561},[400,10811,4405],{"class":424},[400,10813,883],{"class":455},[400,10815,4455],{"class":424},[400,10817,10818,10820,10822],{"class":402,"line":1567},[400,10819,4405],{"class":424},[400,10821,883],{"class":455},[400,10823,4464],{"class":424},[375,10825,4468],{"id":4467},[67,10827,10828,10830,10834],{},[70,10829,4473],{},[70,10831,4476,10832,4480],{},[28,10833,4479],{},[70,10835,4483],{},[375,10837,4487],{"id":4486},[67,10839,10840,10842],{},[70,10841,4492],{},[70,10843,4495,10844,4499,10846,4503],{},[28,10845,4498],{},[20,10847,4502],{},[315,10849,10850],{"className":394,"code":4506,"language":396,"meta":324,"style":324},[322,10851,10852,10856,10864,10868,10872,10880],{"__ignoreMap":324},[400,10853,10854],{"class":402,"line":403},[400,10855,4513],{"class":406},[400,10857,10858,10860,10862],{"class":402,"line":410},[400,10859,4518],{"class":424},[400,10861,1521],{"class":413},[400,10863,4523],{"class":424},[400,10865,10866],{"class":402,"line":428},[400,10867,1157],{"emptyLinePlaceholder":1156},[400,10869,10870],{"class":402,"line":443},[400,10871,4532],{"class":406},[400,10873,10874,10876,10878],{"class":402,"line":462},[400,10875,4518],{"class":424},[400,10877,1521],{"class":413},[400,10879,4541],{"class":424},[400,10881,10882],{"class":402,"line":471},[400,10883,4546],{"class":424},[106,10885,10886],{},[16,10887,10888,4554,10890,4558,10892,4562],{},[28,10889,4553],{},[28,10891,4557],{},[20,10893,4561],{},[119,10895],{},[11,10897,4568],{"id":4567},[16,10899,10900,4574,10902,4578,10904,4582],{},[28,10901,4573],{},[28,10903,4577],{},[28,10905,4581],{},[16,10907,4585],{},[315,10909,10910],{"className":394,"code":4588,"language":396,"meta":324,"style":324},[322,10911,10912,10916,10928,10932,10936,10948,10952,10956,10968,10972,10976],{"__ignoreMap":324},[400,10913,10914],{"class":402,"line":403},[400,10915,4595],{"class":406},[400,10917,10918,10920,10922,10924,10926],{"class":402,"line":410},[400,10919,414],{"class":413},[400,10921,4602],{"class":413},[400,10923,4605],{"class":420},[400,10925,2134],{"class":413},[400,10927,4610],{"class":424},[400,10929,10930],{"class":402,"line":428},[400,10931,1157],{"emptyLinePlaceholder":1156},[400,10933,10934],{"class":402,"line":443},[400,10935,4619],{"class":406},[400,10937,10938,10940,10942,10944,10946],{"class":402,"line":462},[400,10939,414],{"class":413},[400,10941,4602],{"class":413},[400,10943,4628],{"class":420},[400,10945,2134],{"class":413},[400,10947,4633],{"class":424},[400,10949,10950],{"class":402,"line":471},[400,10951,1157],{"emptyLinePlaceholder":1156},[400,10953,10954],{"class":402,"line":559},[400,10955,4642],{"class":406},[400,10957,10958,10960,10962,10964,10966],{"class":402,"line":1456},[400,10959,414],{"class":413},[400,10961,4649],{"class":413},[400,10963,4652],{"class":420},[400,10965,2134],{"class":413},[400,10967,4657],{"class":424},[400,10969,10970],{"class":402,"line":1556},[400,10971,1157],{"emptyLinePlaceholder":1156},[400,10973,10974],{"class":402,"line":1561},[400,10975,4666],{"class":406},[400,10977,10978,10980,10982],{"class":402,"line":1567},[400,10979,1237],{"class":413},[400,10981,4602],{"class":413},[400,10983,4675],{"class":424},[16,10985,10986],{},[28,10987,4680],{},[67,10989,10990,10998,11000],{},[70,10991,4685,10992,872,10994,4691,10996,4694],{},[322,10993,1141],{},[322,10995,4690],{},[322,10997,2015],{},[70,10999,4697],{},[70,11001,4700],{},[16,11003,11004],{},[28,11005,4705],{},[67,11007,11008,11010,11012],{},[70,11009,4710],{},[70,11011,4713],{},[70,11013,4716,11014,4719,11016,4719,11018,4724],{},[322,11015,1258],{},[322,11017,1261],{},[322,11019,1264],{},[106,11021,11022],{},[16,11023,11024,4732,11026,347,11028,4739,11030,35],{},[28,11025,4731],{},[322,11027,4735],{},[322,11029,4738],{},[28,11031,4742],{},[119,11033],{},[11,11035,4748],{"id":4747},[16,11037,38,11038,4754,11040,4758],{},[28,11039,4753],{},[28,11041,4757],{},[52,11043,4762],{"id":4761},[315,11045,11046],{"className":394,"code":4765,"language":396,"meta":324,"style":324},[322,11047,11048,11056,11060,11064,11092,11096,11100,11128,11132],{"__ignoreMap":324},[400,11049,11050,11052,11054],{"class":402,"line":403},[400,11051,2157],{"class":413},[400,11053,2231],{"class":424},[400,11055,4776],{"class":406},[400,11057,11058],{"class":402,"line":410},[400,11059,1157],{"emptyLinePlaceholder":1156},[400,11061,11062],{"class":402,"line":428},[400,11063,4785],{"class":406},[400,11065,11066,11068,11070,11072,11074,11076,11078,11080,11082,11084,11086,11088,11090],{"class":402,"line":443},[400,11067,2164],{"class":413},[400,11069,2167],{"class":424},[400,11071,1812],{"class":413},[400,11073,2172],{"class":424},[400,11075,1066],{"class":413},[400,11077,2172],{"class":424},[400,11079,2179],{"class":413},[400,11081,2295],{"class":455},[400,11083,2185],{"class":413},[400,11085,2188],{"class":424},[400,11087,1066],{"class":413},[400,11089,1844],{"class":455},[400,11091,1151],{"class":424},[400,11093,11094],{"class":402,"line":462},[400,11095,1157],{"emptyLinePlaceholder":1156},[400,11097,11098],{"class":402,"line":471},[400,11099,4822],{"class":406},[400,11101,11102,11104,11106,11108,11110,11112,11114,11116,11118,11120,11122,11124,11126],{"class":402,"line":559},[400,11103,2164],{"class":413},[400,11105,2167],{"class":424},[400,11107,1812],{"class":413},[400,11109,2172],{"class":424},[400,11111,1066],{"class":413},[400,11113,2172],{"class":424},[400,11115,2211],{"class":413},[400,11117,2295],{"class":455},[400,11119,2185],{"class":413},[400,11121,2188],{"class":424},[400,11123,1066],{"class":413},[400,11125,2222],{"class":455},[400,11127,1151],{"class":424},[400,11129,11130],{"class":402,"line":1456},[400,11131,1157],{"emptyLinePlaceholder":1156},[400,11133,11134,11136,11138],{"class":402,"line":1556},[400,11135,1320],{"class":413},[400,11137,4861],{"class":424},[400,11139,4864],{"class":406},[16,11141,4867,11142,4870],{},[322,11143,1323],{},[52,11145,4874],{"id":4873},[16,11147,11148,4880],{},[28,11149,4879],{},[135,11151,11152,11162],{},[138,11153,11154],{},[141,11155,11156,11158,11160],{},[144,11157,4889],{},[144,11159,4892],{},[144,11161,4895],{},[154,11163,11164,11174,11184,11194],{},[141,11165,11166,11170,11172],{},[159,11167,11168,4905],{},[28,11169,4904],{},[159,11171,4908],{},[159,11173,4911],{},[141,11175,11176,11180,11182],{},[159,11177,11178,4919],{},[28,11179,4918],{},[159,11181,4922],{},[159,11183,4925],{},[141,11185,11186,11190,11192],{},[159,11187,11188,4933],{},[28,11189,4932],{},[159,11191,4936],{},[159,11193,4939],{},[141,11195,11196,11200,11202],{},[159,11197,11198,4947],{},[28,11199,4946],{},[159,11201,4950],{},[159,11203,4953],{},[315,11205,11206],{"className":394,"code":4956,"language":396,"meta":324,"style":324},[322,11207,11208,11212,11218,11228,11232,11236,11246,11250,11260,11264],{"__ignoreMap":324},[400,11209,11210],{"class":402,"line":403},[400,11211,4963],{"class":406},[400,11213,11214,11216],{"class":402,"line":410},[400,11215,2157],{"class":413},[400,11217,1151],{"class":424},[400,11219,11220,11222,11224,11226],{"class":402,"line":428},[400,11221,4974],{"class":413},[400,11223,4977],{"class":424},[400,11225,1671],{"class":413},[400,11227,4982],{"class":424},[400,11229,11230],{"class":402,"line":443},[400,11231,4987],{"class":424},[400,11233,11234],{"class":402,"line":462},[400,11235,1157],{"emptyLinePlaceholder":1156},[400,11237,11238,11240,11242,11244],{"class":402,"line":471},[400,11239,4974],{"class":413},[400,11241,4998],{"class":424},[400,11243,1671],{"class":413},[400,11245,4982],{"class":424},[400,11247,11248],{"class":402,"line":559},[400,11249,5007],{"class":406},[400,11251,11252,11254,11256,11258],{"class":402,"line":1456},[400,11253,5012],{"class":413},[400,11255,5015],{"class":413},[400,11257,5018],{"class":424},[400,11259,5021],{"class":406},[400,11261,11262],{"class":402,"line":1556},[400,11263,1157],{"emptyLinePlaceholder":1156},[400,11265,11266,11268,11270],{"class":402,"line":1561},[400,11267,1320],{"class":413},[400,11269,2231],{"class":424},[400,11271,5034],{"class":406},[119,11273],{},[11,11275,5040],{"id":5039},[16,11277,38,11278,5046,11280,5050],{},[28,11279,5045],{},[28,11281,5049],{},[315,11283,11284],{"className":394,"code":5053,"language":396,"meta":324,"style":324},[322,11285,11286,11290,11300,11304,11314,11324,11334,11352,11370,11376,11398,11426,11430,11434,11454,11478,11482,11486],{"__ignoreMap":324},[400,11287,11288],{"class":402,"line":403},[400,11289,5060],{"class":406},[400,11291,11292,11294,11296,11298],{"class":402,"line":410},[400,11293,414],{"class":413},[400,11295,5067],{"class":413},[400,11297,5070],{"class":420},[400,11299,5073],{"class":413},[400,11301,11302],{"class":402,"line":428},[400,11303,2069],{"class":413},[400,11305,11306,11308,11310,11312],{"class":402,"line":443},[400,11307,3330],{"class":455},[400,11309,35],{"class":424},[400,11311,3349],{"class":455},[400,11313,440],{"class":424},[400,11315,11316,11318,11320,11322],{"class":402,"line":462},[400,11317,3330],{"class":455},[400,11319,35],{"class":424},[400,11321,1521],{"class":455},[400,11323,440],{"class":424},[400,11325,11326,11328,11330,11332],{"class":402,"line":471},[400,11327,3330],{"class":455},[400,11329,35],{"class":424},[400,11331,621],{"class":455},[400,11333,440],{"class":424},[400,11335,11336,11338,11340,11342,11344,11346,11348,11350],{"class":402,"line":559},[400,11337,3012],{"class":455},[400,11339,452],{"class":424},[400,11341,3556],{"class":455},[400,11343,35],{"class":424},[400,11345,3349],{"class":455},[400,11347,3019],{"class":424},[400,11349,2089],{"class":413},[400,11351,5126],{"class":424},[400,11353,11354,11356,11358,11360,11362,11364,11366,11368],{"class":402,"line":1456},[400,11355,3042],{"class":455},[400,11357,452],{"class":424},[400,11359,3556],{"class":455},[400,11361,35],{"class":424},[400,11363,3364],{"class":455},[400,11365,1381],{"class":424},[400,11367,2089],{"class":413},[400,11369,5145],{"class":424},[400,11371,11372,11374],{"class":402,"line":1556},[400,11373,2000],{"class":413},[400,11375,3382],{"class":424},[400,11377,11378,11380,11382,11384,11386,11388,11390,11392,11394,11396],{"class":402,"line":1561},[400,11379,3490],{"class":413},[400,11381,3389],{"class":424},[400,11383,3392],{"class":413},[400,11385,3395],{"class":455},[400,11387,35],{"class":424},[400,11389,3349],{"class":455},[400,11391,3402],{"class":413},[400,11393,3405],{"class":455},[400,11395,35],{"class":424},[400,11397,3745],{"class":455},[400,11399,11400,11402,11404,11406,11408,11410,11412,11414,11416,11418,11420,11422,11424],{"class":402,"line":1567},[400,11401,3061],{"class":413},[400,11403,3395],{"class":455},[400,11405,35],{"class":424},[400,11407,3349],{"class":455},[400,11409,872],{"class":424},[400,11411,5188],{"class":455},[400,11413,35],{"class":424},[400,11415,1521],{"class":455},[400,11417,872],{"class":424},[400,11419,5188],{"class":455},[400,11421,35],{"class":424},[400,11423,621],{"class":455},[400,11425,1151],{"class":424},[400,11427,11428],{"class":402,"line":2066},[400,11429,1157],{"emptyLinePlaceholder":1156},[400,11431,11432],{"class":402,"line":2072},[400,11433,5211],{"class":406},[400,11435,11436,11438,11440,11442,11444,11446,11448,11450,11452],{"class":402,"line":2083},[400,11437,1129],{"class":413},[400,11439,1132],{"class":413},[400,11441,1135],{"class":413},[400,11443,5222],{"class":424},[400,11445,1141],{"class":413},[400,11447,5227],{"class":424},[400,11449,2292],{"class":413},[400,11451,5232],{"class":455},[400,11453,1151],{"class":424},[400,11455,11456,11458,11460,11462,11464,11466,11468,11470,11472,11474,11476],{"class":402,"line":2095},[400,11457,1129],{"class":413},[400,11459,2332],{"class":413},[400,11461,5243],{"class":424},[400,11463,2000],{"class":413},[400,11465,5222],{"class":424},[400,11467,2015],{"class":413},[400,11469,5252],{"class":424},[400,11471,2708],{"class":413},[400,11473,2770],{"class":413},[400,11475,2572],{"class":455},[400,11477,1151],{"class":424},[400,11479,11480],{"class":402,"line":2106},[400,11481,1157],{"emptyLinePlaceholder":1156},[400,11483,11484],{"class":402,"line":2505},[400,11485,5269],{"class":406},[400,11487,11488,11490,11492],{"class":402,"line":2511},[400,11489,1237],{"class":413},[400,11491,5067],{"class":413},[400,11493,5278],{"class":424},[16,11495,11496],{},[28,11497,5283],{},[67,11499,11500,11504,11508,11512],{},[70,11501,11502,5291],{},[28,11503,5290],{},[70,11505,11506,5297],{},[28,11507,5296],{},[70,11509,11510,5303],{},[28,11511,5302],{},[70,11513,11514,5309],{},[28,11515,5308],{},[119,11517],{},[11,11519,5315],{"id":5314},[16,11521,5318,11522,5321,11524,5325],{},[28,11523,4325],{},[28,11525,5324],{},[52,11527,5329],{"id":5328},[16,11529,11530],{},[59,11531],{"alt":5334,"src":5335},[315,11533,11534],{"className":394,"code":5338,"language":396,"meta":324,"style":324},[322,11535,11536,11540,11550,11560,11576,11588,11604,11608,11612,11616,11626,11636,11652,11664,11680,11688,11700,11720,11724,11728,11732,11742,11752,11768,11786,11796,11806,11810,11814,11818,11828,11838,11850,11862,11874,11884,11890],{"__ignoreMap":324},[400,11537,11538],{"class":402,"line":403},[400,11539,5345],{"class":406},[400,11541,11542,11544,11546,11548],{"class":402,"line":410},[400,11543,414],{"class":413},[400,11545,417],{"class":413},[400,11547,5354],{"class":420},[400,11549,425],{"class":424},[400,11551,11552,11554,11556,11558],{"class":402,"line":428},[400,11553,4100],{"class":424},[400,11555,1358],{"class":413},[400,11557,437],{"class":413},[400,11559,440],{"class":424},[400,11561,11562,11564,11566,11568,11570,11572,11574],{"class":402,"line":443},[400,11563,446],{"class":413},[400,11565,449],{"class":413},[400,11567,452],{"class":424},[400,11569,5377],{"class":455},[400,11571,1381],{"class":424},[400,11573,1384],{"class":413},[400,11575,440],{"class":424},[400,11577,11578,11580,11582,11584,11586],{"class":402,"line":462},[400,11579,5388],{"class":424},[400,11581,1490],{"class":413},[400,11583,452],{"class":424},[400,11585,456],{"class":455},[400,11587,459],{"class":424},[400,11589,11590,11592,11594,11596,11598,11600,11602],{"class":402,"line":471},[400,11591,5401],{"class":424},[400,11593,434],{"class":413},[400,11595,5406],{"class":413},[400,11597,5409],{"class":424},[400,11599,2292],{"class":413},[400,11601,2295],{"class":455},[400,11603,5416],{"class":424},[400,11605,11606],{"class":402,"line":559},[400,11607,474],{"class":424},[400,11609,11610],{"class":402,"line":1456},[400,11611,1157],{"emptyLinePlaceholder":1156},[400,11613,11614],{"class":402,"line":1556},[400,11615,5429],{"class":406},[400,11617,11618,11620,11622,11624],{"class":402,"line":1561},[400,11619,414],{"class":413},[400,11621,417],{"class":413},[400,11623,5438],{"class":420},[400,11625,425],{"class":424},[400,11627,11628,11630,11632,11634],{"class":402,"line":1567},[400,11629,5445],{"class":424},[400,11631,1358],{"class":413},[400,11633,437],{"class":413},[400,11635,440],{"class":424},[400,11637,11638,11640,11642,11644,11646,11648,11650],{"class":402,"line":2066},[400,11639,5456],{"class":424},[400,11641,1490],{"class":413},[400,11643,452],{"class":424},[400,11645,4118],{"class":455},[400,11647,1381],{"class":424},[400,11649,1384],{"class":413},[400,11651,440],{"class":424},[400,11653,11654,11656,11658,11660,11662],{"class":402,"line":2072},[400,11655,5473],{"class":424},[400,11657,434],{"class":413},[400,11659,5478],{"class":413},[400,11661,533],{"class":413},[400,11663,5483],{"class":424},[400,11665,11666,11668,11670,11672,11674,11676,11678],{"class":402,"line":2083},[400,11667,5488],{"class":424},[400,11669,1490],{"class":413},[400,11671,452],{"class":424},[400,11673,5495],{"class":455},[400,11675,1381],{"class":424},[400,11677,4056],{"class":413},[400,11679,440],{"class":424},[400,11681,11682,11684,11686],{"class":402,"line":2095},[400,11683,5506],{"class":424},[400,11685,434],{"class":413},[400,11687,440],{"class":424},[400,11689,11690,11692,11694,11696,11698],{"class":402,"line":2106},[400,11691,5515],{"class":424},[400,11693,1490],{"class":413},[400,11695,452],{"class":424},[400,11697,456],{"class":455},[400,11699,459],{"class":424},[400,11701,11702,11704,11706,11708,11710,11712,11714,11716,11718],{"class":402,"line":2505},[400,11703,5528],{"class":424},[400,11705,434],{"class":413},[400,11707,1434],{"class":413},[400,11709,1844],{"class":455},[400,11711,5406],{"class":413},[400,11713,5539],{"class":424},[400,11715,5542],{"class":413},[400,11717,1069],{"class":455},[400,11719,5416],{"class":424},[400,11721,11722],{"class":402,"line":2511},[400,11723,474],{"class":424},[400,11725,11726],{"class":402,"line":2532},[400,11727,1157],{"emptyLinePlaceholder":1156},[400,11729,11730],{"class":402,"line":2537},[400,11731,5559],{"class":406},[400,11733,11734,11736,11738,11740],{"class":402,"line":2543},[400,11735,414],{"class":413},[400,11737,417],{"class":413},[400,11739,5568],{"class":420},[400,11741,425],{"class":424},[400,11743,11744,11746,11748,11750],{"class":402,"line":2554},[400,11745,5575],{"class":424},[400,11747,1358],{"class":413},[400,11749,437],{"class":413},[400,11751,440],{"class":424},[400,11753,11754,11756,11758,11760,11762,11764,11766],{"class":402,"line":2577},[400,11755,446],{"class":413},[400,11757,1373],{"class":413},[400,11759,452],{"class":424},[400,11761,5377],{"class":455},[400,11763,1381],{"class":424},[400,11765,1384],{"class":413},[400,11767,440],{"class":424},[400,11769,11770,11772,11774,11776,11778,11780,11782,11784],{"class":402,"line":2582},[400,11771,5602],{"class":424},[400,11773,1490],{"class":413},[400,11775,452],{"class":424},[400,11777,4118],{"class":455},[400,11779,1381],{"class":424},[400,11781,1384],{"class":413},[400,11783,4125],{"class":413},[400,11785,440],{"class":424},[400,11787,11788,11790,11792,11794],{"class":402,"line":2593},[400,11789,5621],{"class":424},[400,11791,973],{"class":413},[400,11793,1434],{"class":413},[400,11795,5628],{"class":424},[400,11797,11798,11800,11802,11804],{"class":402,"line":2616},[400,11799,5633],{"class":424},[400,11801,953],{"class":413},[400,11803,1434],{"class":413},[400,11805,5640],{"class":424},[400,11807,11808],{"class":402,"line":2621},[400,11809,474],{"class":424},[400,11811,11812],{"class":402,"line":2627},[400,11813,1157],{"emptyLinePlaceholder":1156},[400,11815,11816],{"class":402,"line":5651},[400,11817,5654],{"class":406},[400,11819,11820,11822,11824,11826],{"class":402,"line":5657},[400,11821,414],{"class":413},[400,11823,417],{"class":413},[400,11825,5664],{"class":420},[400,11827,425],{"class":424},[400,11829,11830,11832,11834,11836],{"class":402,"line":5669},[400,11831,5445],{"class":424},[400,11833,1358],{"class":413},[400,11835,437],{"class":413},[400,11837,440],{"class":424},[400,11839,11840,11842,11844,11846,11848],{"class":402,"line":5680},[400,11841,5683],{"class":424},[400,11843,434],{"class":413},[400,11845,5478],{"class":413},[400,11847,533],{"class":413},[400,11849,5692],{"class":424},[400,11851,11852,11854,11856,11858,11860],{"class":402,"line":5695},[400,11853,5698],{"class":424},[400,11855,434],{"class":413},[400,11857,5478],{"class":413},[400,11859,533],{"class":413},[400,11861,5707],{"class":424},[400,11863,11864,11866,11868,11870,11872],{"class":402,"line":5710},[400,11865,5713],{"class":424},[400,11867,973],{"class":413},[400,11869,5478],{"class":413},[400,11871,1434],{"class":413},[400,11873,5628],{"class":424},[400,11875,11876,11878,11880,11882],{"class":402,"line":5724},[400,11877,5727],{"class":424},[400,11879,973],{"class":413},[400,11881,5478],{"class":413},[400,11883,440],{"class":424},[400,11885,11886,11888],{"class":402,"line":5736},[400,11887,5739],{"class":424},[400,11889,556],{"class":413},[400,11891,11892],{"class":402,"line":5744},[400,11893,474],{"class":424},[52,11895,5750],{"id":5749},[315,11897,11898],{"className":394,"code":5753,"language":396,"meta":324,"style":324},[322,11899,11900,11912,11928,11944,11960,11964,11972,12000,12028,12056,12084,12088,12100,12112,12124,12136,12140,12148,12174,12200],{"__ignoreMap":324},[400,11901,11902,11904,11906,11908,11910],{"class":402,"line":403},[400,11903,1658],{"class":413},[400,11905,5762],{"class":424},[400,11907,1521],{"class":413},[400,11909,5767],{"class":424},[400,11911,1717],{"class":413},[400,11913,11914,11916,11918,11920,11922,11924,11926],{"class":402,"line":410},[400,11915,1722],{"class":424},[400,11917,5776],{"class":1081},[400,11919,872],{"class":424},[400,11921,5781],{"class":1081},[400,11923,872],{"class":424},[400,11925,5786],{"class":455},[400,11927,459],{"class":424},[400,11929,11930,11932,11934,11936,11938,11940,11942],{"class":402,"line":428},[400,11931,1722],{"class":424},[400,11933,5795],{"class":1081},[400,11935,872],{"class":424},[400,11937,5800],{"class":1081},[400,11939,872],{"class":424},[400,11941,5805],{"class":455},[400,11943,459],{"class":424},[400,11945,11946,11948,11950,11952,11954,11956,11958],{"class":402,"line":443},[400,11947,1722],{"class":424},[400,11949,5814],{"class":1081},[400,11951,872],{"class":424},[400,11953,5819],{"class":1081},[400,11955,872],{"class":424},[400,11957,5824],{"class":455},[400,11959,474],{"class":424},[400,11961,11962],{"class":402,"line":462},[400,11963,1157],{"emptyLinePlaceholder":1156},[400,11965,11966,11968,11970],{"class":402,"line":471},[400,11967,1658],{"class":413},[400,11969,5837],{"class":424},[400,11971,1717],{"class":413},[400,11973,11974,11976,11978,11980,11982,11984,11986,11988,11990,11992,11994,11996,11998],{"class":402,"line":559},[400,11975,1722],{"class":424},[400,11977,5846],{"class":1081},[400,11979,5849],{"class":424},[400,11981,883],{"class":455},[400,11983,872],{"class":424},[400,11985,5856],{"class":1081},[400,11987,872],{"class":424},[400,11989,5861],{"class":455},[400,11991,872],{"class":424},[400,11993,5866],{"class":1081},[400,11995,872],{"class":424},[400,11997,5871],{"class":455},[400,11999,459],{"class":424},[400,12001,12002,12004,12006,12008,12010,12012,12014,12016,12018,12020,12022,12024,12026],{"class":402,"line":1456},[400,12003,1722],{"class":424},[400,12005,5880],{"class":1081},[400,12007,5883],{"class":424},[400,12009,883],{"class":455},[400,12011,872],{"class":424},[400,12013,5890],{"class":1081},[400,12015,872],{"class":424},[400,12017,5895],{"class":455},[400,12019,872],{"class":424},[400,12021,5900],{"class":1081},[400,12023,5903],{"class":424},[400,12025,5906],{"class":455},[400,12027,459],{"class":424},[400,12029,12030,12032,12034,12036,12038,12040,12042,12044,12046,12048,12050,12052,12054],{"class":402,"line":1556},[400,12031,1722],{"class":424},[400,12033,5915],{"class":1081},[400,12035,5918],{"class":424},[400,12037,1414],{"class":455},[400,12039,872],{"class":424},[400,12041,5925],{"class":1081},[400,12043,872],{"class":424},[400,12045,5930],{"class":455},[400,12047,872],{"class":424},[400,12049,5935],{"class":1081},[400,12051,872],{"class":424},[400,12053,2857],{"class":455},[400,12055,459],{"class":424},[400,12057,12058,12060,12062,12064,12066,12068,12070,12072,12074,12076,12078,12080,12082],{"class":402,"line":1561},[400,12059,1722],{"class":424},[400,12061,5948],{"class":1081},[400,12063,5951],{"class":424},[400,12065,5906],{"class":455},[400,12067,872],{"class":424},[400,12069,5958],{"class":1081},[400,12071,872],{"class":424},[400,12073,5963],{"class":455},[400,12075,872],{"class":424},[400,12077,5968],{"class":1081},[400,12079,872],{"class":424},[400,12081,1414],{"class":455},[400,12083,474],{"class":424},[400,12085,12086],{"class":402,"line":1567},[400,12087,1157],{"emptyLinePlaceholder":1156},[400,12089,12090,12092,12094,12096,12098],{"class":402,"line":2066},[400,12091,1658],{"class":413},[400,12093,5985],{"class":424},[400,12095,1521],{"class":413},[400,12097,5990],{"class":424},[400,12099,1717],{"class":413},[400,12101,12102,12104,12106,12108,12110],{"class":402,"line":2072},[400,12103,1722],{"class":424},[400,12105,5999],{"class":1081},[400,12107,872],{"class":424},[400,12109,6004],{"class":1081},[400,12111,459],{"class":424},[400,12113,12114,12116,12118,12120,12122],{"class":402,"line":2083},[400,12115,1722],{"class":424},[400,12117,6013],{"class":1081},[400,12119,5903],{"class":424},[400,12121,6018],{"class":1081},[400,12123,459],{"class":424},[400,12125,12126,12128,12130,12132,12134],{"class":402,"line":2095},[400,12127,1722],{"class":424},[400,12129,6027],{"class":1081},[400,12131,6030],{"class":424},[400,12133,6033],{"class":1081},[400,12135,474],{"class":424},[400,12137,12138],{"class":402,"line":2106},[400,12139,1157],{"emptyLinePlaceholder":1156},[400,12141,12142,12144,12146],{"class":402,"line":2505},[400,12143,1658],{"class":413},[400,12145,6046],{"class":424},[400,12147,1717],{"class":413},[400,12149,12150,12152,12154,12156,12158,12160,12162,12164,12166,12168,12170,12172],{"class":402,"line":2511},[400,12151,1722],{"class":424},[400,12153,883],{"class":455},[400,12155,872],{"class":424},[400,12157,883],{"class":455},[400,12159,872],{"class":424},[400,12161,6063],{"class":1081},[400,12163,872],{"class":424},[400,12165,6068],{"class":1081},[400,12167,872],{"class":424},[400,12169,6073],{"class":1081},[400,12171,6076],{"class":424},[400,12173,6079],{"class":406},[400,12175,12176,12178,12180,12182,12184,12186,12188,12190,12192,12194,12196,12198],{"class":402,"line":2532},[400,12177,1722],{"class":424},[400,12179,5906],{"class":455},[400,12181,872],{"class":424},[400,12183,1414],{"class":455},[400,12185,872],{"class":424},[400,12187,6094],{"class":1081},[400,12189,872],{"class":424},[400,12191,6099],{"class":1081},[400,12193,872],{"class":424},[400,12195,1033],{"class":413},[400,12197,6106],{"class":424},[400,12199,6109],{"class":406},[400,12201,12202,12204,12206,12208,12210,12212,12214,12216,12218,12220,12222,12224],{"class":402,"line":2537},[400,12203,1722],{"class":424},[400,12205,883],{"class":455},[400,12207,872],{"class":424},[400,12209,5906],{"class":455},[400,12211,872],{"class":424},[400,12213,6124],{"class":1081},[400,12215,872],{"class":424},[400,12217,6129],{"class":1081},[400,12219,872],{"class":424},[400,12221,1033],{"class":413},[400,12223,6136],{"class":424},[400,12225,6109],{"class":406},[52,12227,6142],{"id":6141},[315,12229,12230],{"className":394,"code":6145,"language":396,"meta":324,"style":324},[322,12231,12232,12236,12272,12278,12300,12314,12318,12322,12326,12338,12350,12360,12370,12386,12392,12414,12436,12452,12456,12460,12478,12484,12506,12522,12526,12530,12554,12560,12582,12592,12600,12608,12612,12616,12626,12630,12640,12650,12662,12672,12716,12722,12744,12766,12802,12806],{"__ignoreMap":324},[400,12233,12234],{"class":402,"line":403},[400,12235,6152],{"class":406},[400,12237,12238,12240,12242,12244,12246,12248,12250,12252,12254,12256,12258,12260,12262,12264,12266,12268,12270],{"class":402,"line":410},[400,12239,1129],{"class":413},[400,12241,6159],{"class":455},[400,12243,35],{"class":424},[400,12245,6164],{"class":455},[400,12247,872],{"class":424},[400,12249,6169],{"class":455},[400,12251,35],{"class":424},[400,12253,1521],{"class":455},[400,12255,3563],{"class":413},[400,12257,6178],{"class":424},[400,12259,6181],{"class":455},[400,12261,35],{"class":424},[400,12263,6186],{"class":455},[400,12265,872],{"class":424},[400,12267,6181],{"class":455},[400,12269,35],{"class":424},[400,12271,6195],{"class":455},[400,12273,12274,12276],{"class":402,"line":428},[400,12275,2000],{"class":413},[400,12277,6202],{"class":424},[400,12279,12280,12282,12284,12286,12288,12290,12292,12294,12296,12298],{"class":402,"line":443},[400,12281,3724],{"class":413},[400,12283,6209],{"class":424},[400,12285,3392],{"class":413},[400,12287,6159],{"class":455},[400,12289,35],{"class":424},[400,12291,6218],{"class":455},[400,12293,3402],{"class":413},[400,12295,6223],{"class":455},[400,12297,35],{"class":424},[400,12299,6228],{"class":455},[400,12301,12302,12304,12306,12308,12310,12312],{"class":402,"line":462},[400,12303,2015],{"class":413},[400,12305,6159],{"class":455},[400,12307,35],{"class":424},[400,12309,6239],{"class":455},[400,12311,6242],{"class":413},[400,12313,1151],{"class":424},[400,12315,12316],{"class":402,"line":471},[400,12317,1157],{"emptyLinePlaceholder":1156},[400,12319,12320],{"class":402,"line":559},[400,12321,6253],{"class":406},[400,12323,12324],{"class":402,"line":1456},[400,12325,2069],{"class":413},[400,12327,12328,12330,12332,12334,12336],{"class":402,"line":1556},[400,12329,6262],{"class":455},[400,12331,35],{"class":424},[400,12333,1521],{"class":455},[400,12335,6269],{"class":413},[400,12337,6272],{"class":424},[400,12339,12340,12342,12344,12346,12348],{"class":402,"line":1561},[400,12341,6277],{"class":455},[400,12343,35],{"class":424},[400,12345,6164],{"class":455},[400,12347,6284],{"class":413},[400,12349,6287],{"class":424},[400,12351,12352,12354,12356,12358],{"class":402,"line":1567},[400,12353,6292],{"class":455},[400,12355,35],{"class":424},[400,12357,6297],{"class":455},[400,12359,440],{"class":424},[400,12361,12362,12364,12366,12368],{"class":402,"line":2066},[400,12363,6292],{"class":455},[400,12365,35],{"class":424},[400,12367,6308],{"class":455},[400,12369,440],{"class":424},[400,12371,12372,12374,12376,12378,12380,12382,12384],{"class":402,"line":2072},[400,12373,6315],{"class":424},[400,12375,2179],{"class":413},[400,12377,6320],{"class":455},[400,12379,35],{"class":424},[400,12381,6308],{"class":455},[400,12383,3563],{"class":413},[400,12385,6329],{"class":424},[400,12387,12388,12390],{"class":402,"line":2083},[400,12389,2000],{"class":413},[400,12391,6336],{"class":424},[400,12393,12394,12396,12398,12400,12402,12404,12406,12408,12410,12412],{"class":402,"line":2095},[400,12395,3724],{"class":413},[400,12397,6343],{"class":424},[400,12399,3392],{"class":413},[400,12401,6320],{"class":455},[400,12403,35],{"class":424},[400,12405,6352],{"class":455},[400,12407,3402],{"class":413},[400,12409,6357],{"class":455},[400,12411,35],{"class":424},[400,12413,6228],{"class":455},[400,12415,12416,12418,12420,12422,12424,12426,12428,12430,12432,12434],{"class":402,"line":2106},[400,12417,3724],{"class":413},[400,12419,6368],{"class":424},[400,12421,3392],{"class":413},[400,12423,6320],{"class":455},[400,12425,35],{"class":424},[400,12427,6377],{"class":455},[400,12429,3789],{"class":413},[400,12431,6159],{"class":455},[400,12433,35],{"class":424},[400,12435,6228],{"class":455},[400,12437,12438,12440,12442,12444,12446,12448,12450],{"class":402,"line":2505},[400,12439,1141],{"class":413},[400,12441,6320],{"class":455},[400,12443,35],{"class":424},[400,12445,6396],{"class":455},[400,12447,6399],{"class":413},[400,12449,1094],{"class":413},[400,12451,1151],{"class":424},[400,12453,12454],{"class":402,"line":2511},[400,12455,1157],{"emptyLinePlaceholder":1156},[400,12457,12458],{"class":402,"line":2532},[400,12459,6412],{"class":406},[400,12461,12462,12464,12466,12468,12470,12472,12474,12476],{"class":402,"line":2537},[400,12463,1129],{"class":413},[400,12465,6357],{"class":455},[400,12467,35],{"class":424},[400,12469,1521],{"class":455},[400,12471,872],{"class":424},[400,12473,6427],{"class":455},[400,12475,35],{"class":424},[400,12477,6432],{"class":455},[400,12479,12480,12482],{"class":402,"line":2543},[400,12481,2000],{"class":413},[400,12483,6439],{"class":424},[400,12485,12486,12488,12490,12492,12494,12496,12498,12500,12502,12504],{"class":402,"line":2554},[400,12487,3490],{"class":413},[400,12489,6446],{"class":424},[400,12491,3392],{"class":413},[400,12493,6357],{"class":455},[400,12495,35],{"class":424},[400,12497,3349],{"class":455},[400,12499,3402],{"class":413},[400,12501,6320],{"class":455},[400,12503,35],{"class":424},[400,12505,6463],{"class":455},[400,12507,12508,12510,12512,12514,12516,12518,12520],{"class":402,"line":2577},[400,12509,1141],{"class":413},[400,12511,6320],{"class":455},[400,12513,35],{"class":424},[400,12515,3349],{"class":455},[400,12517,6399],{"class":413},[400,12519,1094],{"class":413},[400,12521,1151],{"class":424},[400,12523,12524],{"class":402,"line":2582},[400,12525,1157],{"emptyLinePlaceholder":1156},[400,12527,12528],{"class":402,"line":2593},[400,12529,6488],{"class":406},[400,12531,12532,12534,12536,12538,12540,12542,12544,12546,12548,12550,12552],{"class":402,"line":2616},[400,12533,1129],{"class":413},[400,12535,6159],{"class":455},[400,12537,35],{"class":424},[400,12539,6164],{"class":455},[400,12541,872],{"class":424},[400,12543,3119],{"class":455},[400,12545,452],{"class":424},[400,12547,1874],{"class":413},[400,12549,1381],{"class":424},[400,12551,2089],{"class":413},[400,12553,6513],{"class":424},[400,12555,12556,12558],{"class":402,"line":2621},[400,12557,2000],{"class":413},[400,12559,6336],{"class":424},[400,12561,12562,12564,12566,12568,12570,12572,12574,12576,12578,12580],{"class":402,"line":2627},[400,12563,3724],{"class":413},[400,12565,6526],{"class":424},[400,12567,3392],{"class":413},[400,12569,6320],{"class":455},[400,12571,35],{"class":424},[400,12573,6377],{"class":455},[400,12575,3402],{"class":413},[400,12577,6159],{"class":455},[400,12579,35],{"class":424},[400,12581,6228],{"class":455},[400,12583,12584,12586,12588,12590],{"class":402,"line":5651},[400,12585,3061],{"class":413},[400,12587,6159],{"class":455},[400,12589,35],{"class":424},[400,12591,6553],{"class":455},[400,12593,12594,12596,12598],{"class":402,"line":5657},[400,12595,2015],{"class":413},[400,12597,6560],{"class":424},[400,12599,2027],{"class":413},[400,12601,12602,12604,12606],{"class":402,"line":5669},[400,12603,2032],{"class":413},[400,12605,1912],{"class":455},[400,12607,1151],{"class":424},[400,12609,12610],{"class":402,"line":5680},[400,12611,1157],{"emptyLinePlaceholder":1156},[400,12613,12614],{"class":402,"line":5695},[400,12615,6579],{"class":406},[400,12617,12618,12620,12622,12624],{"class":402,"line":5710},[400,12619,414],{"class":413},[400,12621,5067],{"class":413},[400,12623,6588],{"class":420},[400,12625,5073],{"class":413},[400,12627,12628],{"class":402,"line":5724},[400,12629,2069],{"class":413},[400,12631,12632,12634,12636,12638],{"class":402,"line":5736},[400,12633,6277],{"class":455},[400,12635,35],{"class":424},[400,12637,3349],{"class":455},[400,12639,440],{"class":424},[400,12641,12642,12644,12646,12648],{"class":402,"line":5744},[400,12643,6277],{"class":455},[400,12645,35],{"class":424},[400,12647,6164],{"class":455},[400,12649,440],{"class":424},[400,12651,12652,12654,12656,12658,12660],{"class":402,"line":6617},[400,12653,6620],{"class":455},[400,12655,35],{"class":424},[400,12657,1521],{"class":455},[400,12659,3563],{"class":413},[400,12661,6629],{"class":424},[400,12663,12664,12666,12668,12670],{"class":402,"line":6632},[400,12665,6277],{"class":455},[400,12667,35],{"class":424},[400,12669,6639],{"class":455},[400,12671,440],{"class":424},[400,12673,12674,12676,12678,12680,12682,12684,12686,12688,12690,12692,12694,12696,12698,12700,12702,12704,12706,12708,12710,12712,12714],{"class":402,"line":6644},[400,12675,6277],{"class":455},[400,12677,35],{"class":424},[400,12679,6639],{"class":455},[400,12681,6653],{"class":413},[400,12683,2946],{"class":455},[400,12685,452],{"class":424},[400,12687,6660],{"class":455},[400,12689,35],{"class":424},[400,12691,3349],{"class":455},[400,12693,1381],{"class":424},[400,12695,6669],{"class":413},[400,12697,1674],{"class":424},[400,12699,1141],{"class":413},[400,12701,6320],{"class":455},[400,12703,35],{"class":424},[400,12705,6396],{"class":455},[400,12707,6399],{"class":413},[400,12709,1094],{"class":413},[400,12711,1381],{"class":424},[400,12713,2089],{"class":413},[400,12715,6690],{"class":424},[400,12717,12718,12720],{"class":402,"line":6693},[400,12719,2000],{"class":413},[400,12721,6202],{"class":424},[400,12723,12724,12726,12728,12730,12732,12734,12736,12738,12740,12742],{"class":402,"line":6700},[400,12725,3724],{"class":413},[400,12727,6209],{"class":424},[400,12729,3392],{"class":413},[400,12731,6159],{"class":455},[400,12733,35],{"class":424},[400,12735,6218],{"class":455},[400,12737,3402],{"class":413},[400,12739,6223],{"class":455},[400,12741,35],{"class":424},[400,12743,6228],{"class":455},[400,12745,12746,12748,12750,12752,12754,12756,12758,12760,12762,12764],{"class":402,"line":6723},[400,12747,3490],{"class":413},[400,12749,6446],{"class":424},[400,12751,3392],{"class":413},[400,12753,6159],{"class":455},[400,12755,35],{"class":424},[400,12757,3349],{"class":455},[400,12759,3402],{"class":413},[400,12761,6320],{"class":455},[400,12763,35],{"class":424},[400,12765,6744],{"class":455},[400,12767,12768,12770,12772,12774,12776,12778,12780,12782,12784,12786,12788,12790,12792,12794,12796,12798,12800],{"class":402,"line":6747},[400,12769,3061],{"class":413},[400,12771,6159],{"class":455},[400,12773,35],{"class":424},[400,12775,3349],{"class":455},[400,12777,872],{"class":424},[400,12779,6181],{"class":455},[400,12781,35],{"class":424},[400,12783,6164],{"class":455},[400,12785,872],{"class":424},[400,12787,6169],{"class":455},[400,12789,35],{"class":424},[400,12791,1521],{"class":455},[400,12793,872],{"class":424},[400,12795,6181],{"class":455},[400,12797,35],{"class":424},[400,12799,6639],{"class":455},[400,12801,1151],{"class":424},[400,12803,12804],{"class":402,"line":6784},[400,12805,1157],{"emptyLinePlaceholder":1156},[400,12807,12808,12810,12812,12814],{"class":402,"line":6789},[400,12809,1129],{"class":413},[400,12811,1132],{"class":413},[400,12813,1135],{"class":413},[400,12815,6798],{"class":424},[119,12817],{},[11,12819,6804],{"id":6803},[16,12821,6807,12822,6811],{},[28,12823,6810],{},[135,12825,12826,12836],{},[138,12827,12828],{},[141,12829,12830,12832,12834],{},[144,12831,6820],{},[144,12833,6823],{},[144,12835,6826],{},[154,12837,12838,12854,12870,12890,12900,12910,12918,12926],{},[141,12839,12840,12846,12850],{},[159,12841,12842,6836,12844],{},[322,12843,6835],{},[322,12845,1141],{},[159,12847,6841,12848,6844],{},[28,12849,4351],{},[159,12851,6847,12852,6850],{},[322,12853,1141],{},[141,12855,12856,12862,12866],{},[159,12857,12858,6836,12860],{},[322,12859,6857],{},[322,12861,1141],{},[159,12863,6862,12864,6866],{},[28,12865,6865],{},[159,12867,6847,12868],{},[322,12869,1141],{},[141,12871,12872,12876,12884],{},[159,12873,6875,12874],{},[322,12875,1066],{},[159,12877,12878,6883,12880,6887,12882],{},[322,12879,6882],{},[322,12881,6886],{},[322,12883,958],{},[159,12885,6892,12886,6895,12888],{},[322,12887,1111],{},[322,12889,1114],{},[141,12891,12892,12896,12898],{},[159,12893,12894,6905],{},[322,12895,6904],{},[159,12897,6908],{},[159,12899,6911],{},[141,12901,12902,12904,12906],{},[159,12903,6916],{},[159,12905,6919],{},[159,12907,6922,12908],{},[322,12909,6925],{},[141,12911,12912,12914,12916],{},[159,12913,6930],{},[159,12915,6933],{},[159,12917,6936],{},[141,12919,12920,12922,12924],{},[159,12921,6941],{},[159,12923,6944],{},[159,12925,6947],{},[141,12927,12928,12932,12936],{},[159,12929,6952,12930,6955],{},[322,12931,907],{},[159,12933,6958,12934],{},[322,12935,6961],{},[159,12937,6892,12938,6967],{},[322,12939,6966],{},[119,12941],{},[11,12943,6973],{"id":6972},[52,12945,6977],{"id":6976},[135,12947,12948,12956],{},[138,12949,12950],{},[141,12951,12952,12954],{},[144,12953,6986],{},[144,12955,6989],{},[154,12957,12958,12964,12970,12976,12982,12988,12994,13000,13006,13012,13018,13024],{},[141,12959,12960,12962],{},[159,12961,210],{},[159,12963,6998],{},[141,12965,12966,12968],{},[159,12967,7003],{},[159,12969,7006],{},[141,12971,12972,12974],{},[159,12973,7011],{},[159,12975,7014],{},[141,12977,12978,12980],{},[159,12979,7019],{},[159,12981,7022],{},[141,12983,12984,12986],{},[159,12985,7027],{},[159,12987,7030],{},[141,12989,12990,12992],{},[159,12991,7035],{},[159,12993,7038],{},[141,12995,12996,12998],{},[159,12997,7043],{},[159,12999,7046],{},[141,13001,13002,13004],{},[159,13003,7051],{},[159,13005,7054],{},[141,13007,13008,13010],{},[159,13009,7059],{},[159,13011,7062],{},[141,13013,13014,13016],{},[159,13015,7067],{},[159,13017,7070],{},[141,13019,13020,13022],{},[159,13021,7075],{},[159,13023,7078],{},[141,13025,13026,13028],{},[159,13027,7083],{},[159,13029,7086],{},[52,13031,7090],{"id":7089},[7092,13033,13034,13046,13052,13056,13060,13066,13070],{},[70,13035,13036,7099,13038,872,13040,872,13042,872,13044,7112],{},[28,13037,7098],{},[322,13039,7102],{},[322,13041,7105],{},[322,13043,7108],{},[322,13045,7111],{},[70,13047,13048,7099,13050,7120],{},[28,13049,7117],{},[322,13051,4738],{},[70,13053,13054,7126],{},[28,13055,7125],{},[70,13057,13058,7132],{},[28,13059,7131],{},[70,13061,13062,7138,13064,35],{},[28,13063,7137],{},[322,13065,7141],{},[70,13067,13068,7147],{},[28,13069,7146],{},[70,13071,13072,7153],{},[28,13073,7152],{},[52,13075,7157],{"id":7156},[67,13077,13078,13082,13086,13090],{},[70,13079,13080,7164],{},[28,13081,270],{},[70,13083,13084,7170],{},[28,13085,7169],{},[70,13087,13088,7176],{},[28,13089,7175],{},[70,13091,13092,7182],{},[28,13093,7181],{},[119,13095],{},[106,13097,13098],{},[16,13099,13100,7192],{},[20,13101,7191],{},[16,13103,7195],{},[16,13105,7198],{},[7200,13107,7202],{},{"title":324,"searchDepth":410,"depth":410,"links":13109},[13110,13113,13122,13128,13135,13136,13140,13141,13145,13146,13151,13152],{"id":13,"depth":410,"text":14,"children":13111},[13112],{"id":54,"depth":428,"text":55},{"id":123,"depth":410,"text":124,"children":13114},[13115,13116,13117,13118,13119,13120,13121],{"id":127,"depth":428,"text":128},{"id":203,"depth":428,"text":204},{"id":307,"depth":428,"text":308},{"id":365,"depth":428,"text":366},{"id":673,"depth":428,"text":674},{"id":831,"depth":428,"text":832},{"id":1027,"depth":428,"text":1028},{"id":1188,"depth":410,"text":1189,"children":13123},[13124,13125,13126,13127],{"id":1329,"depth":428,"text":1330},{"id":1639,"depth":428,"text":1640},{"id":1968,"depth":428,"text":1969},{"id":2113,"depth":428,"text":2114},{"id":2254,"depth":410,"text":2255,"children":13129},[13130,13131,13132,13133,13134],{"id":2258,"depth":428,"text":2259},{"id":2653,"depth":428,"text":2654},{"id":2812,"depth":428,"text":2813},{"id":3262,"depth":428,"text":3263},{"id":3815,"depth":428,"text":3816},{"id":3995,"depth":410,"text":3996},{"id":4308,"depth":410,"text":4309,"children":13137},[13138,13139],{"id":4328,"depth":428,"text":4329},{"id":4361,"depth":428,"text":4362},{"id":4567,"depth":410,"text":4568},{"id":4747,"depth":410,"text":4748,"children":13142},[13143,13144],{"id":4761,"depth":428,"text":4762},{"id":4873,"depth":428,"text":4874},{"id":5039,"depth":410,"text":5040},{"id":5314,"depth":410,"text":5315,"children":13147},[13148,13149,13150],{"id":5328,"depth":428,"text":5329},{"id":5749,"depth":428,"text":5750},{"id":6141,"depth":428,"text":6142},{"id":6803,"depth":410,"text":6804},{"id":6972,"depth":410,"text":6973,"children":13153},[13154,13155,13156],{"id":6976,"depth":428,"text":6977},{"id":7089,"depth":428,"text":7090},{"id":7156,"depth":428,"text":7157},{},{"title":5,"description":7253},[7263,210,167,7264],{"id":13161,"title":13162,"author":6,"body":13163,"date":14509,"description":14510,"draft":7254,"extension":7255,"guide":7256,"image":14511,"meta":14512,"navigation":1156,"path":14513,"seo":14514,"stem":14515,"tags":14516,"__hash__":14521},"blog/Backend/1.everything-about-json-web-tokens-explained.md","Everything You Actually Need to Know About JWT (Without the Fluff)",{"type":8,"value":13164,"toc":14483},[13165,13168,13172,13182,13189,13194,13198,13205,13217,13221,13228,13231,13273,13276,13280,13290,13296,13300,13315,13360,13379,13383,13394,13483,13492,13496,13503,13596,13603,13607,13613,13616,13620,13623,13729,13733,13743,13747,13759,13764,13768,13771,13775,13782,13785,13789,13800,13803,13812,13816,13819,13891,13896,13933,13938,14160,14164,14167,14172,14186,14191,14214,14223,14227,14230,14235,14252,14257,14273,14277,14284,14287,14326,14330,14333,14401,14406,14470,14474,14480],[16,13166,13167],{},"Welcome, engineers! Today, we’re going to demystify JSON Web Tokens (JWT). By the end of this article, you’ll understand what JWTs are, why they’re used everywhere, and how they work under the hood—all with simple analogies and practical examples.",[11,13169,13171],{"id":13170},"what-is-jwt-and-why-does-it-matter","What is JWT and Why Does it Matter?",[16,13173,13174,13177,13178,13181],{},[28,13175,13176],{},"JSON Web Token (JWT)"," is an open internet standard defined in ",[28,13179,13180],{},"RFC 7519",". At its core, it is a compact, URL-safe string that encodes a set of claims — verifiable facts about a user or session — as a JSON object, and then digitally signs them so the receiver can trust what they read.",[16,13183,13184,13185,13188],{},"Think of a JWT the way you think of a ",[28,13186,13187],{},"government-issued ID card",". The card contains your name, date of birth, and a photo. Anyone who sees it can read the information. But crucially, it carries an official seal or hologram that only the government can produce — so you can't just forge one at home. JWT works on exactly the same principle: the token carries readable data, but it is cryptographically sealed so nobody can tamper with it.",[106,13190,13191],{},[16,13192,13193],{},"Imagine you log into your company's internal dashboard. The server creates a little \"badge\" for you that says: \"This person is X, their role is admin, and this badge is valid until 5 PM.\" The badge is stamped with the server's private seal. Every time you visit a protected page, you flash this badge at the door. The door doesn't need to call HR — it can verify the stamp itself, instantly.",[11,13195,13197],{"id":13196},"a-real-world-example","A Real-World Example",[16,13199,13200,13201,13204],{},"You open your favourite music streaming app. You type your email and password and hit \"Log In\". The app's server checks your credentials and, upon success, generates a JWT that encodes your user ID, subscription tier, and an expiration time of one hour. It sends this token back to your browser. For the rest of the session, every API request your browser makes — \"fetch my playlists,\" \"play this song,\" \"update my preferences\" — attaches this JWT in the ",[322,13202,13203],{},"Authorization"," header. The API server reads and verifies the token and immediately knows who you are and what you're allowed to do, without a single database lookup.",[106,13206,13207],{},[16,13208,13209,13210,1633,13213,13216],{},"Why this matters\nIn a world of microservices, mobile apps, and third-party APIs, passing session cookies between services is cumbersome and fragile. JWTs are ",[28,13211,13212],{},"stateless",[28,13214,13215],{},"self-contained"," — any service that knows the signing key can independently verify a token with zero coordination.",[11,13218,13220],{"id":13219},"the-problem-jwt-solves","The Problem JWT Solves",[16,13222,13223,13224,13227],{},"Before JWTs, the dominant approach was ",[28,13225,13226],{},"server-side sessions",". When you logged in, the server would create a session record in a database or in memory and hand you a random session ID (typically stored in a cookie). On every request, the server would look up that session ID to figure out who you were.",[16,13229,13230],{},"This worked fine for small, single-server applications. But it had serious problems at scale:",[67,13232,13233,13241,13249,13265],{},[70,13234,13235,13238,13240],{},[28,13236,13237],{},"Stickiness problem",[6660,13239],{},"If you have 10 servers behind a load balancer, the server that created your session must also be the one that receives future requests — otherwise it won't find your session in memory.",[70,13242,13243,13246,13248],{},[28,13244,13245],{},"Database bottleneck",[6660,13247],{},"Every protected API call requires a database query to validate the session. Under heavy traffic, this becomes a significant overhead.",[70,13250,13251,13254,13256,13257,13260,13261,13264],{},[28,13252,13253],{},"Cross-domain friction",[6660,13255],{},"Cookies work poorly across different domains. If your frontend is on ",[322,13258,13259],{},"app.example.com"," and your API is on ",[322,13262,13263],{},"api.other.com",", sharing session cookies requires careful and fragile CORS configuration.",[70,13266,13267,13270,13272],{},[28,13268,13269],{},"Microservices mismatch",[6660,13271],{},"In a microservices architecture, each service would need to either share a session store or call a central auth service on every request. Both options add latency and coupling.",[16,13274,13275],{},"JWTs eliminate these problems. The token itself is the session — it carries all the information needed for verification. No shared state. No database lookup. No sticky sessions.",[11,13277,13279],{"id":13278},"structure-of-a-jwt-three-parts-separated-by-dots","Structure of a JWT: Three Parts, Separated by Dots",[16,13281,13282,13283,13286,13287,13289],{},"A JWT looks intimidating at first glance — just a long blob of characters. But it has a very precise structure: ",[28,13284,13285],{},"three Base64URL-encoded sections",", separated by dots (",[322,13288,35],{},").",[16,13291,13292],{},[59,13293],{"alt":13294,"src":13295},"Structure of JWT","/post-images/everything-about-json-web-tokens-explained/structure-of-jwt.png",[52,13297,13299],{"id":13298},"part-1-the-header","Part 1 — The Header",[16,13301,13302,13303,13306,13307,13310,13311,13314],{},"The header is a ",[28,13304,13305],{},"JSON object"," that declares the ",[28,13308,13309],{},"token type"," and the ",[28,13312,13313],{},"signing algorithm",". It's Base64URL encoded and placed as the first segment.",[315,13316,13320],{"className":13317,"code":13318,"language":13319,"meta":324,"style":324},"language-json shiki shiki-themes github-dark","{\n  \"alg\": \"HS256\",   // Algorithm: HMAC + SHA-256\n  \"typ\": \"JWT\"    // Token type: JSON Web Token\n}\n","json",[322,13321,13322,13327,13342,13355],{"__ignoreMap":324},[400,13323,13324],{"class":402,"line":403},[400,13325,13326],{"class":424},"{\n",[400,13328,13329,13332,13334,13337,13339],{"class":402,"line":410},[400,13330,13331],{"class":455},"  \"alg\"",[400,13333,7099],{"class":424},[400,13335,13336],{"class":1081},"\"HS256\"",[400,13338,6030],{"class":424},[400,13340,13341],{"class":406},"// Algorithm: HMAC + SHA-256\n",[400,13343,13344,13347,13349,13352],{"class":402,"line":428},[400,13345,13346],{"class":455},"  \"typ\"",[400,13348,7099],{"class":424},[400,13350,13351],{"class":1081},"\"JWT\"",[400,13353,13354],{"class":406},"    // Token type: JSON Web Token\n",[400,13356,13357],{"class":402,"line":443},[400,13358,13359],{"class":424},"}\n",[16,13361,13362,13363,13366,13367,13370,13371,13374,13375,13378],{},"Common values for ",[322,13364,13365],{},"alg"," include ",[322,13368,13369],{},"HS256"," (symmetric key, shared secret), ",[322,13372,13373],{},"RS256"," (RSA asymmetric key pair), and ",[322,13376,13377],{},"ES256"," (Elliptic Curve). The choice of algorithm has significant security implications, which we'll cover in the Signing section.",[52,13380,13382],{"id":13381},"part-2-the-payload","Part 2 — The Payload",[16,13384,13385,13386,13389,13390,13393],{},"The payload is the ",[28,13387,13388],{},"actual data"," — a JSON object of key-value pairs called ",[28,13391,13392],{},"claims",". Claims describe the user or session and carry any additional information the application needs.",[315,13395,13397],{"className":13317,"code":13396,"language":13319,"meta":324,"style":324},"{\n  \"sub\":  \"user_123\",       // Subject: who this token is about\n  \"name\": \"Kashyap\",        // Custom claim: user's display name\n  \"role\": \"admin\",         // Custom claim: access role\n  \"iat\":  1716239022,      // Issued At (Unix timestamp)\n  \"exp\":  1716242622       // Expires At (iat + 1 hour)\n}\n",[322,13398,13399,13403,13419,13435,13450,13466,13479],{"__ignoreMap":324},[400,13400,13401],{"class":402,"line":403},[400,13402,13326],{"class":424},[400,13404,13405,13408,13411,13414,13416],{"class":402,"line":410},[400,13406,13407],{"class":455},"  \"sub\"",[400,13409,13410],{"class":424},":  ",[400,13412,13413],{"class":1081},"\"user_123\"",[400,13415,1363],{"class":424},[400,13417,13418],{"class":406},"// Subject: who this token is about\n",[400,13420,13421,13424,13426,13429,13432],{"class":402,"line":428},[400,13422,13423],{"class":455},"  \"name\"",[400,13425,7099],{"class":424},[400,13427,13428],{"class":1081},"\"Kashyap\"",[400,13430,13431],{"class":424},",        ",[400,13433,13434],{"class":406},"// Custom claim: user's display name\n",[400,13436,13437,13440,13442,13445,13447],{"class":402,"line":443},[400,13438,13439],{"class":455},"  \"role\"",[400,13441,7099],{"class":424},[400,13443,13444],{"class":1081},"\"admin\"",[400,13446,5883],{"class":424},[400,13448,13449],{"class":406},"// Custom claim: access role\n",[400,13451,13452,13455,13457,13460,13463],{"class":402,"line":462},[400,13453,13454],{"class":455},"  \"iat\"",[400,13456,13410],{"class":424},[400,13458,13459],{"class":455},"1716239022",[400,13461,13462],{"class":424},",      ",[400,13464,13465],{"class":406},"// Issued At (Unix timestamp)\n",[400,13467,13468,13471,13473,13476],{"class":402,"line":471},[400,13469,13470],{"class":455},"  \"exp\"",[400,13472,13410],{"class":424},[400,13474,13475],{"class":455},"1716242622",[400,13477,13478],{"class":406},"       // Expires At (iat + 1 hour)\n",[400,13480,13481],{"class":402,"line":559},[400,13482,13359],{"class":424},[106,13484,13485],{},[16,13486,13487,13488,13491],{},"The Payload is NOT Secret\nThe payload is base64‑encoded, not encrypted. Base64URL encoding is ",[28,13489,13490],{},"not encryption",". Anyone who has the token can decode and read the payload. Never put passwords, credit card numbers, or anything sensitive in the payload. JWTs are designed to be tamper-proof, not confidential.",[52,13493,13495],{"id":13494},"part-3-the-signature","Part 3 — The Signature",[16,13497,13498,13499,13502],{},"The signature is the cryptographic stamp that proves the token has not been altered. The signature is created by combining the encoded header, encoded payload, a ",[28,13500,13501],{},"secret"," (or private key), and the algorithm specified in the header.",[315,13504,13508],{"className":13505,"code":13506,"language":13507,"meta":324,"style":324},"language-js shiki shiki-themes github-dark","// Pseudocode\nconst data = base64url(header) + \".\" + base64url(payload);\n\n// For HS256 (symmetric)\nsignature = HMAC_SHA256(data, SECRET_KEY);\n\n// For RS256 (asymmetric)\nsignature = RSA_SHA256_SIGN(data, PRIVATE_KEY);\n","js",[322,13509,13510,13515,13544,13548,13553,13571,13575,13580],{"__ignoreMap":324},[400,13511,13512],{"class":402,"line":403},[400,13513,13514],{"class":406},"// Pseudocode\n",[400,13516,13517,13520,13523,13525,13528,13531,13533,13536,13539,13541],{"class":402,"line":410},[400,13518,13519],{"class":413},"const",[400,13521,13522],{"class":455}," data",[400,13524,3402],{"class":413},[400,13526,13527],{"class":420}," base64url",[400,13529,13530],{"class":424},"(header) ",[400,13532,2211],{"class":413},[400,13534,13535],{"class":1081}," \".\"",[400,13537,13538],{"class":413}," +",[400,13540,13527],{"class":420},[400,13542,13543],{"class":424},"(payload);\n",[400,13545,13546],{"class":402,"line":428},[400,13547,1157],{"emptyLinePlaceholder":1156},[400,13549,13550],{"class":402,"line":443},[400,13551,13552],{"class":406},"// For HS256 (symmetric)\n",[400,13554,13555,13558,13560,13563,13566,13569],{"class":402,"line":462},[400,13556,13557],{"class":424},"signature ",[400,13559,1066],{"class":413},[400,13561,13562],{"class":420}," HMAC_SHA256",[400,13564,13565],{"class":424},"(data, ",[400,13567,13568],{"class":455},"SECRET_KEY",[400,13570,474],{"class":424},[400,13572,13573],{"class":402,"line":471},[400,13574,1157],{"emptyLinePlaceholder":1156},[400,13576,13577],{"class":402,"line":559},[400,13578,13579],{"class":406},"// For RS256 (asymmetric)\n",[400,13581,13582,13584,13586,13589,13591,13594],{"class":402,"line":1456},[400,13583,13557],{"class":424},[400,13585,1066],{"class":413},[400,13587,13588],{"class":420}," RSA_SHA256_SIGN",[400,13590,13565],{"class":424},[400,13592,13593],{"class":455},"PRIVATE_KEY",[400,13595,474],{"class":424},[16,13597,13598,13599,13602],{},"The final JWT is just these three parts concatenated with dots: ",[322,13600,13601],{},"header.payload.signature",". If anyone changes even a single character in the payload, the signature will no longer match — and the server will reject the token.",[11,13604,13606],{"id":13605},"claims-the-heart-of-the-payload","Claims — The Heart of the Payload",[16,13608,38,13609,13612],{},[28,13610,13611],{},"claim"," is simply a key-value pair inside the payload. The word \"claim\" reflects the fact that the token is asserting something about a subject — \"I claim that this user is an admin\" — and the signature is what makes that assertion trustworthy.",[16,13614,13615],{},"Claims are categorised into three types:",[52,13617,13619],{"id":13618},"registered-claims-standardised","Registered Claims (Standardised)",[16,13621,13622],{},"These are defined in RFC 7519. They are not mandatory but are strongly recommended because they are understood by all JWT libraries. They are intentionally short (3 characters) to keep tokens compact.",[135,13624,13625,13636],{},[138,13626,13627],{},[141,13628,13629,13632,13634],{},[144,13630,13631],{},"Claim",[144,13633,1206],{},[144,13635,2835],{},[154,13637,13638,13651,13664,13677,13690,13703,13716],{},[141,13639,13640,13645,13648],{},[159,13641,13642],{},[322,13643,13644],{},"iss",[159,13646,13647],{},"Issuer",[159,13649,13650],{},"Who created and signed the token (e.g., \"auth.myapp.com\")",[141,13652,13653,13658,13661],{},[159,13654,13655],{},[322,13656,13657],{},"sub",[159,13659,13660],{},"Subject",[159,13662,13663],{},"Who the token is about (e.g., a user ID)",[141,13665,13666,13671,13674],{},[159,13667,13668],{},[322,13669,13670],{},"aud",[159,13672,13673],{},"Audience",[159,13675,13676],{},"Who the token is intended for (e.g., \"api.myapp.com\")",[141,13678,13679,13684,13687],{},[159,13680,13681],{},[322,13682,13683],{},"exp",[159,13685,13686],{},"Expiration",[159,13688,13689],{},"Unix timestamp after which the token must be rejected",[141,13691,13692,13697,13700],{},[159,13693,13694],{},[322,13695,13696],{},"nbf",[159,13698,13699],{},"Not Before",[159,13701,13702],{},"Token is invalid before this Unix timestamp",[141,13704,13705,13710,13713],{},[159,13706,13707],{},[322,13708,13709],{},"iat",[159,13711,13712],{},"Issued At",[159,13714,13715],{},"Unix timestamp when the token was created",[141,13717,13718,13723,13726],{},[159,13719,13720],{},[322,13721,13722],{},"jti",[159,13724,13725],{},"JWT ID",[159,13727,13728],{},"A unique ID for this token — useful for preventing replay attacks",[52,13730,13732],{"id":13731},"public-claims","Public Claims",[16,13734,13735,13736,13739,13740,13289],{},"These are custom claims that you define yourself. To avoid conflicts with other applications, they should either be registered in the ",[28,13737,13738],{},"IANA JWT Registry"," or use a collision-resistant name such as a URI (e.g., ",[322,13741,13742],{},"\"https://myapp.com/claims/role\"",[52,13744,13746],{"id":13745},"private-claims","Private Claims",[16,13748,13749,13750,872,13753,872,13756,35],{},"These are custom claims agreed upon between the specific issuer and consumer of the token — your backend and your frontend, for example. Since they're not shared with anyone else, collision resistance doesn't matter here. Examples: ",[322,13751,13752],{},"\"role\"",[322,13754,13755],{},"\"plan\"",[322,13757,13758],{},"\"teamId\"",[106,13760,13761],{},[16,13762,13763],{},"Practical tip\nKeep your payload small. Every API call transmits the entire token. Include only what the server actually needs to make an authorization decision — typically user ID, role, and expiration. Avoid embedding profile data that can be fetched on demand.",[11,13765,13767],{"id":13766},"signing-algorithms","Signing Algorithms",[16,13769,13770],{},"JWT supports two families of signing algorithms. Choosing the right one depends on your architecture.",[52,13772,13774],{"id":13773},"symmetric-hmac-hs256-hs384-hs512","Symmetric — HMAC (HS256, HS384, HS512)",[16,13776,13777,13778,13781],{},"Both the issuer and the verifier use the ",[28,13779,13780],{},"same secret key"," to sign and verify. This is simple and fast, but requires all verifying services to share the secret — meaning if any one of them is compromised, an attacker can forge tokens.",[16,13783,13784],{},"Best for: single-service architectures or cases where you fully control all verifying parties.",[52,13786,13788],{"id":13787},"asymmetric-rsa-ecdsa-rs256-es256","Asymmetric — RSA / ECDSA (RS256, ES256)",[16,13790,13791,13792,13795,13796,13799],{},"The issuing server signs tokens with a ",[28,13793,13794],{},"private key",". Verifying services only need the corresponding ",[28,13797,13798],{},"public key",". Sharing a public key is safe — it cannot be used to forge tokens, only to verify them.",[16,13801,13802],{},"Best for: microservices, multi-tenant systems, and any architecture where tokens are verified by parties you don't fully control (e.g., third-party services).",[106,13804,13805],{},[16,13806,13807,13808,13811],{},"Never Use ",[322,13809,13810],{},"\"alg\": \"none\"","\nThe JWT specification technically allows a \"none\" algorithm meaning no signature at all. Some early libraries trusted this — and attackers exploited it to forge arbitrary tokens. Any production-grade library rejects unsigned tokens by default. Always verify that your library is configured to require a valid algorithm.",[11,13813,13815],{"id":13814},"the-jwt-authentication-flow","The JWT Authentication Flow",[16,13817,13818],{},"Here is the complete end-to-end flow of JWT-based authentication — from login to accessing a protected resource.",[7092,13820,13821,13833,13841,13849,13861,13876],{},[70,13822,13823,13826,13828,13829,13832],{},[28,13824,13825],{},"User submits credentials",[6660,13827],{},"\nThe client sends a ",[322,13830,13831],{},"POST /login"," request with username and password over HTTPS.",[70,13834,13835,13838,13840],{},[28,13836,13837],{},"Server authenticates",[6660,13839],{},"\nThe auth server validates the credentials against the database. If correct, it proceeds to generate a token.",[70,13842,13843,13846,13848],{},[28,13844,13845],{},"Server issues a JWT",[6660,13847],{},"\nThe server builds a payload with the user's ID, role, and expiration time, signs it with the secret key, and returns the full token to the client.",[70,13850,13851,13854,13856,13857,13860],{},[28,13852,13853],{},"Client stores the token",[6660,13855],{},"\nThe client stores the JWT — ideally in an ",[322,13858,13859],{},"HttpOnly"," cookie to prevent JavaScript access (XSS protection). Local storage is convenient but less secure.",[70,13862,13863,13866,13868,13869,13871,13872,13875],{},[28,13864,13865],{},"Client sends the token on every request",[6660,13867],{},"\nFor each API call to a protected endpoint, the client attaches the token in the ",[322,13870,13203],{}," header using the ",[322,13873,13874],{},"Bearer"," schema:",[70,13877,13878,13881,13883,13884,872,13886,872,13888,13890],{},[28,13879,13880],{},"Server verifies and responds",[6660,13882],{},"\nThe API server re-computes the signature and checks the claims (",[322,13885,13683],{},[322,13887,13644],{},[322,13889,13670],{},"). If everything checks out, access is granted. No database call needed.",[16,13892,13893],{},[20,13894,13895],{},"Step 5 — Authorization Header Format",[315,13897,13901],{"className":13898,"code":13899,"language":13900,"meta":324,"style":324},"language-bash shiki shiki-themes github-dark","GET /api/playlists HTTP/1.1\nHost: api.musicapp.com\nAuthorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdW...\n","bash",[322,13902,13903,13914,13922],{"__ignoreMap":324},[400,13904,13905,13908,13911],{"class":402,"line":403},[400,13906,13907],{"class":420},"GET",[400,13909,13910],{"class":1081}," /api/playlists",[400,13912,13913],{"class":1081}," HTTP/1.1\n",[400,13915,13916,13919],{"class":402,"line":410},[400,13917,13918],{"class":420},"Host:",[400,13920,13921],{"class":1081}," api.musicapp.com\n",[400,13923,13924,13927,13930],{"class":402,"line":428},[400,13925,13926],{"class":420},"Authorization:",[400,13928,13929],{"class":1081}," Bearer",[400,13931,13932],{"class":1081}," eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdW...\n",[16,13934,13935],{},[20,13936,13937],{},"Step 3 + 6 — Node.js Example (jsonwebtoken library)",[315,13939,13941],{"className":13505,"code":13940,"language":13507,"meta":324,"style":324},"const jwt = require('jsonwebtoken');\nconst SECRET = process.env.JWT_SECRET;\n\n// On login: issue a token\nfunction issueToken(user) {\n  return jwt.sign(\n    { sub: user.id, role: user.role },\n    SECRET,\n    { expiresIn: '1h', issuer: 'auth.myapp.com' }\n  );\n}\n\n// On every protected request: verify the token\nfunction verifyToken(token) {\n  try {\n    return jwt.verify(token, SECRET, {\n      issuer: 'auth.myapp.com'\n    }); // Returns decoded payload if valid\n  } catch (err) {\n    throw new Error('Invalid or expired token');\n  }\n}\n",[322,13942,13943,13962,13979,13983,13988,14004,14018,14023,14030,14047,14052,14056,14060,14065,14079,14087,14106,14114,14122,14133,14151,14156],{"__ignoreMap":324},[400,13944,13945,13947,13950,13952,13955,13957,13960],{"class":402,"line":403},[400,13946,13519],{"class":413},[400,13948,13949],{"class":455}," jwt",[400,13951,3402],{"class":413},[400,13953,13954],{"class":420}," require",[400,13956,452],{"class":424},[400,13958,13959],{"class":1081},"'jsonwebtoken'",[400,13961,474],{"class":424},[400,13963,13964,13966,13969,13971,13974,13977],{"class":402,"line":410},[400,13965,13519],{"class":413},[400,13967,13968],{"class":455}," SECRET",[400,13970,3402],{"class":413},[400,13972,13973],{"class":424}," process.env.",[400,13975,13976],{"class":455},"JWT_SECRET",[400,13978,1151],{"class":424},[400,13980,13981],{"class":402,"line":428},[400,13982,1157],{"emptyLinePlaceholder":1156},[400,13984,13985],{"class":402,"line":443},[400,13986,13987],{"class":406},"// On login: issue a token\n",[400,13989,13990,13993,13996,13998,14001],{"class":402,"line":462},[400,13991,13992],{"class":413},"function",[400,13994,13995],{"class":420}," issueToken",[400,13997,452],{"class":424},[400,13999,707],{"class":14000},"s9osk",[400,14002,14003],{"class":424},") {\n",[400,14005,14006,14009,14012,14015],{"class":402,"line":471},[400,14007,14008],{"class":413},"  return",[400,14010,14011],{"class":424}," jwt.",[400,14013,14014],{"class":420},"sign",[400,14016,14017],{"class":424},"(\n",[400,14019,14020],{"class":402,"line":559},[400,14021,14022],{"class":424},"    { sub: user.id, role: user.role },\n",[400,14024,14025,14028],{"class":402,"line":1456},[400,14026,14027],{"class":455},"    SECRET",[400,14029,440],{"class":424},[400,14031,14032,14035,14038,14041,14044],{"class":402,"line":1556},[400,14033,14034],{"class":424},"    { expiresIn: ",[400,14036,14037],{"class":1081},"'1h'",[400,14039,14040],{"class":424},", issuer: ",[400,14042,14043],{"class":1081},"'auth.myapp.com'",[400,14045,14046],{"class":424}," }\n",[400,14048,14049],{"class":402,"line":1561},[400,14050,14051],{"class":424},"  );\n",[400,14053,14054],{"class":402,"line":1567},[400,14055,13359],{"class":424},[400,14057,14058],{"class":402,"line":2066},[400,14059,1157],{"emptyLinePlaceholder":1156},[400,14061,14062],{"class":402,"line":2072},[400,14063,14064],{"class":406},"// On every protected request: verify the token\n",[400,14066,14067,14069,14072,14074,14077],{"class":402,"line":2083},[400,14068,13992],{"class":413},[400,14070,14071],{"class":420}," verifyToken",[400,14073,452],{"class":424},[400,14075,14076],{"class":14000},"token",[400,14078,14003],{"class":424},[400,14080,14081,14084],{"class":402,"line":2095},[400,14082,14083],{"class":413},"  try",[400,14085,14086],{"class":424}," {\n",[400,14088,14089,14092,14094,14097,14100,14103],{"class":402,"line":2106},[400,14090,14091],{"class":413},"    return",[400,14093,14011],{"class":424},[400,14095,14096],{"class":420},"verify",[400,14098,14099],{"class":424},"(token, ",[400,14101,14102],{"class":455},"SECRET",[400,14104,14105],{"class":424},", {\n",[400,14107,14108,14111],{"class":402,"line":2505},[400,14109,14110],{"class":424},"      issuer: ",[400,14112,14113],{"class":1081},"'auth.myapp.com'\n",[400,14115,14116,14119],{"class":402,"line":2511},[400,14117,14118],{"class":424},"    }); ",[400,14120,14121],{"class":406},"// Returns decoded payload if valid\n",[400,14123,14124,14127,14130],{"class":402,"line":2532},[400,14125,14126],{"class":424},"  } ",[400,14128,14129],{"class":413},"catch",[400,14131,14132],{"class":424}," (err) {\n",[400,14134,14135,14138,14141,14144,14146,14149],{"class":402,"line":2537},[400,14136,14137],{"class":413},"    throw",[400,14139,14140],{"class":413}," new",[400,14142,14143],{"class":420}," Error",[400,14145,452],{"class":424},[400,14147,14148],{"class":1081},"'Invalid or expired token'",[400,14150,474],{"class":424},[400,14152,14153],{"class":402,"line":2543},[400,14154,14155],{"class":424},"  }\n",[400,14157,14158],{"class":402,"line":2554},[400,14159,13359],{"class":424},[11,14161,14163],{"id":14162},"validation-vs-verification","Validation vs. Verification",[16,14165,14166],{},"These two terms are often used interchangeably, but they mean different things and both are necessary.",[16,14168,14169],{},[28,14170,14171],{},"Verification (Cryptographic)",[67,14173,14174,14177,14180,14183],{},[70,14175,14176],{},"Re-computes the signature using the secret/public key",[70,14178,14179],{},"Confirms the token was issued by a trusted party",[70,14181,14182],{},"Confirms the header and payload have not been altered",[70,14184,14185],{},"A single failed bit in the signature rejects the token",[16,14187,14188],{},[28,14189,14190],{},"Validation (Claims-based)",[67,14192,14193,14199,14204,14209],{},[70,14194,14195,14196,14198],{},"Checks ",[322,14197,13683],{},": is the token still valid?",[70,14200,14195,14201,14203],{},[322,14202,13696],{},": is it too early to use?",[70,14205,14195,14206,14208],{},[322,14207,13644],{},": is the issuer expected?",[70,14210,14195,14211,14213],{},[322,14212,13670],{},": is this token meant for us?",[16,14215,14216,14217,14219,14220,35],{},"A token can pass cryptographic verification but still be invalid — for example, if it was issued yesterday and its ",[322,14218,13683],{}," claim has passed. Your server must ",[28,14221,14222],{},"always do both",[11,14224,14226],{"id":14225},"trade-offs-and-limitations","Trade-offs and Limitations",[16,14228,14229],{},"JWTs are powerful but not a silver bullet. Understanding their limitations will save you from real production incidents.",[16,14231,14232],{},[28,14233,14234],{},"Strengths",[67,14236,14237,14240,14243,14246,14249],{},[70,14238,14239],{},"Stateless — no server memory or session store required",[70,14241,14242],{},"Self-contained — all info is in the token itself",[70,14244,14245],{},"Cross-domain — works across microservices and domains",[70,14247,14248],{},"Language-agnostic — libraries exist for every platform",[70,14250,14251],{},"Performance — eliminates per-request database lookups",[16,14253,14254],{},[28,14255,14256],{},"Weaknesses",[67,14258,14259,14264,14267,14270],{},[70,14260,14261,14262],{},"Hard to revoke — a valid token stays valid until ",[322,14263,13683],{},[70,14265,14266],{},"Size — larger than an opaque session ID cookie",[70,14268,14269],{},"Key leak — a leaked secret allows unlimited token forgery",[70,14271,14272],{},"Complexity — more moving parts than a simple session cookie",[52,14274,14276],{"id":14275},"the-revocation-problem-in-detail","The Revocation Problem in Detail",[16,14278,14279,14280,14283],{},"This is the most common gotcha for beginners. Because JWTs are stateless, the server has no record of which tokens it issued. If a user logs out or you need to ban an account, you ",[28,14281,14282],{},"cannot invalidate a JWT that is already out in the wild"," — at least not without extra infrastructure.",[16,14285,14286],{},"The standard solutions are:",[7092,14288,14289,14304,14318],{},[70,14290,14291,14294,14296,14297,14299,14300,14303],{},[28,14292,14293],{},"Short expiration times",[6660,14295],{},"\nSet ",[322,14298,13683],{}," to a short window (5–15 minutes). Pair with a longer-lived ",[28,14301,14302],{},"refresh token"," to silently obtain a new access token. This limits the blast radius of any stolen token.",[70,14305,14306,14309,14311,14312,14314,14315,14317],{},[28,14307,14308],{},"Token blocklist (denylist)",[6660,14310],{},"\nStore revoked ",[322,14313,13722],{}," (JWT ID) values in a fast store like Redis. On every request, check if the token's ",[322,14316,13722],{}," is on the blocklist. This reintroduces some state but only for the invalidated tokens.",[70,14319,14320,14323,14325],{},[28,14321,14322],{},"Key rotation",[6660,14324],{},"\nRotating the signing key instantly invalidates all existing tokens — a useful \"nuclear option\" in a security incident.",[11,14327,14329],{"id":14328},"best-practices","Best Practices",[16,14331,14332],{},"Security is not accidental. Here are some rules that matter most when implementing JWTs in production.",[7092,14334,14335,14343,14361,14369,14377,14393],{},[70,14336,14337,14340,14342],{},[28,14338,14339],{},"Always Use HTTPS",[6660,14341],{},"\nA JWT transmitted over plain HTTP can be intercepted. Always enforce TLS. There are no exceptions to this rule.",[70,14344,14345,14348,14350,14351,347,14354,14357,14358,14360],{},[28,14346,14347],{},"Store Tokens in HttpOnly Cookies",[6660,14349],{},"\nStoring JWTs in ",[322,14352,14353],{},"localStorage",[322,14355,14356],{},"sessionStorage"," makes them accessible to any JavaScript running on the page — including malicious scripts injected via XSS attacks. An ",[322,14359,13859],{}," cookie is inaccessible to JavaScript by design.",[70,14362,14363,14366,14368],{},[28,14364,14365],{},"Keep Expiration Times Short",[6660,14367],{},"\nAccess tokens should expire in minutes or at most an hour. Use a separate, longer-lived refresh token to renew them silently. This way, even a stolen access token is only useful for a short window.",[70,14370,14371,14374,14376],{},[28,14372,14373],{},"Never Store Sensitive Data in the Payload",[6660,14375],{},"\nThe payload is only Base64URL encoded — not encrypted. Anyone who intercepts the token (even over HTTPS, if they have access to the client device) can decode it. Store only non-sensitive identifiers like user ID and role.",[70,14378,14379,14382,14384,14385,872,14387,14389,14390,14392],{},[28,14380,14381],{},"Validate All Registered Claims",[6660,14383],{},"\nDo not assume your library validates everything by default. Explicitly check ",[322,14386,13683],{},[322,14388,13644],{},", and ",[322,14391,13670],{},". The few lines of code required here prevent entire categories of attacks.",[70,14394,14395,14398,14400],{},[28,14396,14397],{},"Prefer RS256 / ES256 for Distributed Systems",[6660,14399],{},"\nIn any system where multiple services verify tokens, use an asymmetric algorithm. Each service only needs the public key — sharing a private key across services is a security liability.",[16,14402,14403],{},[20,14404,14405],{},"Verification with explicit claim checks:",[315,14407,14409],{"className":13505,"code":14408,"language":13507,"meta":324,"style":324},"// Always pass verification options explicitly\njwt.verify(token, publicKey, {\n  algorithms: ['RS256'],      // Never allow 'none'\n  issuer:     'auth.example.com',\n  audience:   'api.example.com',\n  // 'exp' is checked automatically by the library\n});\n",[322,14410,14411,14416,14426,14440,14450,14460,14465],{"__ignoreMap":324},[400,14412,14413],{"class":402,"line":403},[400,14414,14415],{"class":406},"// Always pass verification options explicitly\n",[400,14417,14418,14421,14423],{"class":402,"line":410},[400,14419,14420],{"class":424},"jwt.",[400,14422,14096],{"class":420},[400,14424,14425],{"class":424},"(token, publicKey, {\n",[400,14427,14428,14431,14434,14437],{"class":402,"line":428},[400,14429,14430],{"class":424},"  algorithms: [",[400,14432,14433],{"class":1081},"'RS256'",[400,14435,14436],{"class":424},"],      ",[400,14438,14439],{"class":406},"// Never allow 'none'\n",[400,14441,14442,14445,14448],{"class":402,"line":443},[400,14443,14444],{"class":424},"  issuer:     ",[400,14446,14447],{"class":1081},"'auth.example.com'",[400,14449,440],{"class":424},[400,14451,14452,14455,14458],{"class":402,"line":462},[400,14453,14454],{"class":424},"  audience:   ",[400,14456,14457],{"class":1081},"'api.example.com'",[400,14459,440],{"class":424},[400,14461,14462],{"class":402,"line":471},[400,14463,14464],{"class":406},"  // 'exp' is checked automatically by the library\n",[400,14466,14467],{"class":402,"line":559},[400,14468,14469],{"class":424},"});\n",[11,14471,14473],{"id":14472},"summary","Summary",[16,14475,14476,14477,14479],{},"Use JWTs for stateless, cross-service authorization. Keep them short-lived. Transmit only over HTTPS. Store in ",[322,14478,13859],{}," cookies. Never put secrets in the payload. Always verify the signature and all critical claims. For multi-service architectures, use RS256 so only one service ever touches the private key.",[7200,14481,14482],{},"html pre.shiki code .s95oV, html code.shiki .s95oV{--shiki-default:#E1E4E8}html pre.shiki code .sDLfK, html code.shiki .sDLfK{--shiki-default:#79B8FF}html pre.shiki code .sU2Wk, html code.shiki .sU2Wk{--shiki-default:#9ECBFF}html pre.shiki code .sAwPA, html code.shiki .sAwPA{--shiki-default:#6A737D}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html pre.shiki code .snl16, html code.shiki .snl16{--shiki-default:#F97583}html pre.shiki code .svObZ, html code.shiki .svObZ{--shiki-default:#B392F0}html pre.shiki code .s9osk, html code.shiki .s9osk{--shiki-default:#FFAB70}",{"title":324,"searchDepth":410,"depth":410,"links":14484},[14485,14486,14487,14488,14493,14498,14502,14503,14504,14507,14508],{"id":13170,"depth":410,"text":13171},{"id":13196,"depth":410,"text":13197},{"id":13219,"depth":410,"text":13220},{"id":13278,"depth":410,"text":13279,"children":14489},[14490,14491,14492],{"id":13298,"depth":428,"text":13299},{"id":13381,"depth":428,"text":13382},{"id":13494,"depth":428,"text":13495},{"id":13605,"depth":410,"text":13606,"children":14494},[14495,14496,14497],{"id":13618,"depth":428,"text":13619},{"id":13731,"depth":428,"text":13732},{"id":13745,"depth":428,"text":13746},{"id":13766,"depth":410,"text":13767,"children":14499},[14500,14501],{"id":13773,"depth":428,"text":13774},{"id":13787,"depth":428,"text":13788},{"id":13814,"depth":410,"text":13815},{"id":14162,"depth":410,"text":14163},{"id":14225,"depth":410,"text":14226,"children":14505},[14506],{"id":14275,"depth":428,"text":14276},{"id":14328,"depth":410,"text":14329},{"id":14472,"depth":410,"text":14473},"2026-04-04","A comprehensive guide to JSON Web Tokens (JWT) that cuts through the jargon and gets straight to the point. Learn what JWTs are, how JWT works, and how to use JWTs effectively in your applications.","everything-about-json-web-tokens-explained.png",{},"/backend/everything-about-json-web-tokens-explained",{"title":13162,"description":14510},"Backend/1.everything-about-json-web-tokens-explained",[14517,14518,14519,14520],"JWT","JSON Web Tokens","Authentication","Security","mjEU-xXBmUUlUL8Tkj6ZQsPFjWEDC3Np3qY8tTa6zgo",{"id":14523,"title":14524,"author":6,"body":14525,"date":15126,"description":15127,"draft":7254,"extension":7255,"guide":7256,"image":15128,"meta":15129,"navigation":1156,"path":15130,"seo":15131,"stem":15132,"tags":15133,"__hash__":15136},"blog/How-To/1.git-commit-to-wrong-branch-fix.md","How to Fix a Git Commit to Wrong Branch: A Step-by-Step Guide",{"type":8,"value":14526,"toc":15114},[14527,14545,14548,14552,14560,14563,14577,14580,14584,14587,14614,14626,14630,14639,14642,14664,14667,14687,14738,14747,14751,14754,14763,14768,14772,14775,14793,14797,14804,14807,14831,14878,14886,14897,14901,14906,14909,14923,14926,14944,14947,14974,15024,15029,15033,15036,15056,15060,15067,15099,15103,15106,15109,15111],[16,14528,14529,14530,14533,14534,14537,14538,347,14541,14544],{},"I know you’ve been there. You are deep in the \"flow,\" writing code, and hitting ",[322,14531,14532],{},"git commit"," with confidence. Then, you look at your terminal and realize the mistake: you just made a ",[28,14535,14536],{},"git commit to wrong branch",". Specifically, you’ve pushed feature code directly onto the ",[322,14539,14540],{},"main",[322,14542,14543],{},"master"," branch.",[16,14546,14547],{},"Don't panic. This is a rite of passage for every developer. Whether you forgot to switch branches or your IDE defaulted to master, it is easily fixable. In this guide, I shall show you how to safely move those commits to a feature branch and restore order to your repository.",[11,14549,14551],{"id":14550},"the-common-git-mistake-developers-make","The Common Git Mistake Developers Make",[16,14553,14554,14555,347,14557,14559],{},"Git is a powerful version control system, but its flexibility means it doesn't always stop us from making mistakes. Most junior developers start their work in the ",[322,14556,14543],{},[322,14558,14540],{}," branch because it’s the default state of a new repository.",[16,14561,14562],{},"Accidentally committing to the wrong branch usually happens because:",[67,14564,14565,14571,14574],{},[70,14566,14567,14568,35],{},"You forgot to run ",[322,14569,14570],{},"git checkout -b \u003Cbranch-name>",[70,14572,14573],{},"You switched tasks quickly and didn't check your current branch status.",[70,14575,14576],{},"You assumed you were on a feature branch when you were actually on the primary production branch.",[16,14578,14579],{},"Whatever the reason, the result is the same: your feature code is now part of the main branch history, which can lead to issues in production and complicate collaboration with other developers.",[11,14581,14583],{"id":14582},"example-scenario-real-situation","Example Scenario (Real Situation)",[16,14585,14586],{},"Let's look at a common scenario. Imagine you are building a website:",[7092,14588,14589,14601,14604,14611],{},[70,14590,14591,14592,14595,14596,347,14598,14600],{},"You initialize a Git repository and commit your ",[322,14593,14594],{},"index.html"," to ",[322,14597,14543],{},[322,14599,14540],{},". This is correct.",[70,14602,14603],{},"You start working on a \"Login\" feature.",[70,14605,14606,14607,14610],{},"Without switching branches, you create ",[322,14608,14609],{},"login.html",", write the API integration.",[70,14612,14613],{},"You made two commits: \"add login.html\" and \"add authentication\".",[16,14615,14616,14617,14619,14620,14623,14624,35],{},"Now, your production-ready ",[322,14618,14543],{}," branch contains experimental, unreviewed feature code. You need to move those \"Login\" commits to a branch called ",[322,14621,14622],{},"feature-login"," and remove them from ",[322,14625,14543],{},[11,14627,14629],{"id":14628},"step-1-identify-the-mistake-using-git-logs","Step 1 – Identify the Mistake Using Git Logs",[16,14631,14632,14633],{},"Before you move anything, you need to see exactly what happened. We use the log command to visualize the commit history. ",[20,14634,14635,14636,14638],{},"(You're in ",[322,14637,14543],{}," branch yet)",[16,14640,14641],{},"Run the following command:",[315,14643,14645],{"className":13898,"code":14644,"language":13900,"meta":324,"style":324},"git log --oneline --all --graph\n",[322,14646,14647],{"__ignoreMap":324},[400,14648,14649,14652,14655,14658,14661],{"class":402,"line":403},[400,14650,14651],{"class":420},"git",[400,14653,14654],{"class":1081}," log",[400,14656,14657],{"class":455}," --oneline",[400,14659,14660],{"class":455}," --all",[400,14662,14663],{"class":455}," --graph\n",[16,14665,14666],{},"What this does:",[67,14668,14669,14675,14681],{},[70,14670,14671,14674],{},[322,14672,14673],{},"--oneline",": Condenses the output so each commit is one line.",[70,14676,14677,14680],{},[322,14678,14679],{},"--all",": Shows all branches, not just the one you are on.",[70,14682,14683,14686],{},[322,14684,14685],{},"--graph",": Draws a text-based graphical representation of the branch history.",[315,14688,14690],{"className":13898,"code":14689,"language":13900,"meta":324,"style":324},"# example output of the above command:\n* a781459 (HEAD -> main) add authentication\n* c00ffa3 add login.html\n* a6567f9 update index.html\n* 4f1c99f add index.html\n",[322,14691,14692,14697,14717,14724,14731],{"__ignoreMap":324},[400,14693,14694],{"class":402,"line":403},[400,14695,14696],{"class":406},"# example output of the above command:\n",[400,14698,14699,14701,14704,14707,14709,14711,14714],{"class":402,"line":410},[400,14700,1874],{"class":413},[400,14702,14703],{"class":424}," a781459 (",[400,14705,14706],{"class":420},"HEAD",[400,14708,6653],{"class":424},[400,14710,2292],{"class":413},[400,14712,14713],{"class":1081}," main",[400,14715,14716],{"class":424},") add authentication\n",[400,14718,14719,14721],{"class":402,"line":428},[400,14720,1874],{"class":413},[400,14722,14723],{"class":424}," c00ffa3 add login.html\n",[400,14725,14726,14728],{"class":402,"line":443},[400,14727,1874],{"class":413},[400,14729,14730],{"class":424}," a6567f9 update index.html\n",[400,14732,14733,14735],{"class":402,"line":462},[400,14734,1874],{"class":413},[400,14736,14737],{"class":424}," 4f1c99f add index.html\n",[16,14739,14740,14741,14743,14744,35],{},"Look for the most recent commits on ",[322,14742,14543],{},". You will see the \"add authentication\" commit at the top. Note that each commit has a unique 7-character ID (the \"hash\"), such as ",[322,14745,14746],{},"a1b2c3d",[11,14748,14750],{"id":14749},"step-2-copy-the-commit-ids","Step 2 – Copy the Commit IDs",[16,14752,14753],{},"To move your work to the correct feature branch, Git needs to know exactly which commits you are talking about. Identify the hashes of the commits that belong in the feature branch.",[16,14755,14756,14757,1633,14760,35],{},"If you made three commits to the wrong branch, you need the hashes for all three. In our scenario, the hashes for \"add login\" and \"add authentication\" are ",[322,14758,14759],{},"c00ffa3",[322,14761,14762],{},"a781459",[106,14764,14765],{},[16,14766,14767],{},"Tip: Always copy the hashes into a notepad or keep your terminal window open so you don't lose them!",[11,14769,14771],{"id":14770},"step-3-switch-to-the-correct-feature-branch","Step 3 – Switch to the Correct Feature Branch",[16,14773,14774],{},"Now, you need to go where the code should have gone. If the branch doesn't exist yet, create it and switch to it.",[315,14776,14778],{"className":13898,"code":14777,"language":13900,"meta":324,"style":324},"git checkout -b feature-login\n",[322,14779,14780],{"__ignoreMap":324},[400,14781,14782,14784,14787,14790],{"class":402,"line":403},[400,14783,14651],{"class":420},[400,14785,14786],{"class":1081}," checkout",[400,14788,14789],{"class":455}," -b",[400,14791,14792],{"class":1081}," feature-login\n",[11,14794,14796],{"id":14795},"step-4-move-commits-using-git-cherry-pick","Step 4 – Move Commits Using git cherry-pick",[16,14798,14799,14800,14803],{},"The \"magic\" command here is ",[322,14801,14802],{},"git cherry-pick",". This command takes a commit from one place and applies it to another.",[16,14805,14806],{},"Run the command using the hash you identified in Step 2:",[315,14808,14810],{"className":13898,"code":14809,"language":13900,"meta":324,"style":324},"git cherry-pick c00ffa3\ngit cherry-pick a781459\n",[322,14811,14812,14822],{"__ignoreMap":324},[400,14813,14814,14816,14819],{"class":402,"line":403},[400,14815,14651],{"class":420},[400,14817,14818],{"class":1081}," cherry-pick",[400,14820,14821],{"class":1081}," c00ffa3\n",[400,14823,14824,14826,14828],{"class":402,"line":410},[400,14825,14651],{"class":420},[400,14827,14818],{"class":1081},[400,14829,14830],{"class":1081}," a781459\n",[315,14832,14834],{"className":13898,"code":14833,"language":13900,"meta":324,"style":324},"# After cherry-picking\n* a781459 (HEAD -> feature-login, main) add authentication\n* c00ffa3 add login.html\n* a6567f9 update index.html\n* 4f1c99f add index.html\n",[322,14835,14836,14841,14860,14866,14872],{"__ignoreMap":324},[400,14837,14838],{"class":402,"line":403},[400,14839,14840],{"class":406},"# After cherry-picking\n",[400,14842,14843,14845,14847,14849,14851,14853,14856,14858],{"class":402,"line":410},[400,14844,1874],{"class":413},[400,14846,14703],{"class":424},[400,14848,14706],{"class":420},[400,14850,6653],{"class":424},[400,14852,2292],{"class":413},[400,14854,14855],{"class":1081}," feature-login,",[400,14857,14713],{"class":1081},[400,14859,14716],{"class":424},[400,14861,14862,14864],{"class":402,"line":428},[400,14863,1874],{"class":413},[400,14865,14723],{"class":424},[400,14867,14868,14870],{"class":402,"line":443},[400,14869,1874],{"class":413},[400,14871,14730],{"class":424},[400,14873,14874,14876],{"class":402,"line":462},[400,14875,1874],{"class":413},[400,14877,14737],{"class":424},[106,14879,14880],{},[16,14881,14882,14885],{},[28,14883,14884],{},"Important Note:"," If you have multiple commits to move, apply them in chronological order (oldest first). This prevents merge conflicts and keeps your history logical.",[16,14887,14888,14890,14891,14893,14894,14896],{},[322,14889,14802],{}," essentially \"copies\" the changes. Your \"Login\" code is now safely on the ",[322,14892,14622],{}," branch. However, a copy still exists on ",[322,14895,14543],{},". We need to fix that next.",[11,14898,14900],{"id":14899},"step-5-clean-the-master-branch","Step 5 – Clean the Master Branch",[16,14902,14903,14904,14544],{},"Now that your work is safe on the correct branch, we must remove the accidental commits from the ",[322,14905,14543],{},[16,14907,14908],{},"First, switch back to master:",[315,14910,14912],{"className":13898,"code":14911,"language":13900,"meta":324,"style":324},"git checkout master\n",[322,14913,14914],{"__ignoreMap":324},[400,14915,14916,14918,14920],{"class":402,"line":403},[400,14917,14651],{"class":420},[400,14919,14786],{"class":1081},[400,14921,14922],{"class":1081}," master\n",[16,14924,14925],{},"Then, use the reset command to roll back the branch to its state before the mistake:",[315,14927,14929],{"className":13898,"code":14928,"language":13900,"meta":324,"style":324},"git reset --hard HEAD~2\n",[322,14930,14931],{"__ignoreMap":324},[400,14932,14933,14935,14938,14941],{"class":402,"line":403},[400,14934,14651],{"class":420},[400,14936,14937],{"class":1081}," reset",[400,14939,14940],{"class":455}," --hard",[400,14942,14943],{"class":1081}," HEAD~2\n",[16,14945,14946],{},"What this command does:",[67,14948,14949,14955,14961],{},[70,14950,14951,14954],{},[322,14952,14953],{},"git reset",": Moves the current branch pointer to a previous state.",[70,14956,14957,14960],{},[322,14958,14959],{},"--hard",": This tells Git to discard all changes in the working directory. It makes master look exactly like it did before you made that mistake.",[70,14962,14963,14966,14967,14970,14971,35],{},[322,14964,14965],{},"HEAD~2",": This tells Git to go back exactly ",[28,14968,14969],{},"two"," commits. If you made three accidental commits, you would use ",[322,14972,14973],{},"HEAD~3",[315,14975,14977],{"className":13898,"code":14976,"language":13900,"meta":324,"style":324},"# After reset\n* a781459 (feature-login) add authentication\n* c00ffa3 add login.html\n* a6567f9 (HEAD -> main) update index.html\n* 4f1c99f add index.html\n",[322,14978,14979,14984,14994,15000,15018],{"__ignoreMap":324},[400,14980,14981],{"class":402,"line":403},[400,14982,14983],{"class":406},"# After reset\n",[400,14985,14986,14988,14990,14992],{"class":402,"line":410},[400,14987,1874],{"class":413},[400,14989,14703],{"class":424},[400,14991,14622],{"class":420},[400,14993,14716],{"class":424},[400,14995,14996,14998],{"class":402,"line":428},[400,14997,1874],{"class":413},[400,14999,14723],{"class":424},[400,15001,15002,15004,15007,15009,15011,15013,15015],{"class":402,"line":443},[400,15003,1874],{"class":413},[400,15005,15006],{"class":424}," a6567f9 (",[400,15008,14706],{"class":420},[400,15010,6653],{"class":424},[400,15012,2292],{"class":413},[400,15014,14713],{"class":1081},[400,15016,15017],{"class":424},") update index.html\n",[400,15019,15020,15022],{"class":402,"line":462},[400,15021,1874],{"class":413},[400,15023,14737],{"class":424},[106,15025,15026],{},[16,15027,15028],{},"Use --hard with caution. Any uncommitted work in your directory will be permanently deleted. Always ensure your git status is clean before running this.",[11,15030,15032],{"id":15031},"when-should-you-use-git-cherry-pick","When Should You Use git cherry-pick?",[16,15034,15035],{},"Beyond fixing mistakes, git cherry-pick is useful in several real-world situations:",[67,15037,15038,15044,15050],{},[70,15039,15040,15043],{},[28,15041,15042],{},"Hotfixes:"," When a bug is fixed on a development branch but needs to be applied to the production branch immediately.",[70,15045,15046,15049],{},[28,15047,15048],{},"Undoing a Revert:"," If a feature was reverted but you want to bring back specific parts of it.",[70,15051,15052,15055],{},[28,15053,15054],{},"Collaborative Work:"," If a teammate wrote a helper function on their branch that you need on yours.",[11,15057,15059],{"id":15058},"quick-summary","Quick Summary",[16,15061,15062,15063,15066],{},"Need to ",[28,15064,15065],{},"fix a git commit to wrong branch"," in 30 seconds? I know you don't have time. Here is the cheat sheet:",[7092,15068,15069,15075,15081,15087,15093],{},[70,15070,15071,15072],{},"Find the commit hash: ",[322,15073,15074],{},"git log --oneline",[70,15076,15077,15078],{},"Go to the right branch: ",[322,15079,15080],{},"git checkout feature-branch",[70,15082,15083,15084],{},"Copy the work over: ",[322,15085,15086],{},"git cherry-pick \u003Ccommit-hash>",[70,15088,15089,15090],{},"Go back to master: ",[322,15091,15092],{},"git checkout master",[70,15094,15095,15096],{},"Erase the mistake: ",[322,15097,15098],{},"git reset --hard HEAD~1",[11,15100,15102],{"id":15101},"conclusion","Conclusion",[16,15104,15105],{},"Fixing a git commit to wrong branch is a foundational skill that transforms you from a panicked beginner into a confident developer.",[16,15107,15108],{},"The next time you realize you're on the wrong branch, don't delete your folder and start over. Use the steps above to move your code like a pro.",[16,15110,7198],{},[7200,15112,15113],{},"html pre.shiki code .svObZ, html code.shiki .svObZ{--shiki-default:#B392F0}html pre.shiki code .sU2Wk, html code.shiki .sU2Wk{--shiki-default:#9ECBFF}html pre.shiki code .sDLfK, html code.shiki .sDLfK{--shiki-default:#79B8FF}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html pre.shiki code .sAwPA, html code.shiki .sAwPA{--shiki-default:#6A737D}html pre.shiki code .snl16, html code.shiki .snl16{--shiki-default:#F97583}html pre.shiki code .s95oV, html code.shiki .s95oV{--shiki-default:#E1E4E8}",{"title":324,"searchDepth":410,"depth":410,"links":15115},[15116,15117,15118,15119,15120,15121,15122,15123,15124,15125],{"id":14550,"depth":410,"text":14551},{"id":14582,"depth":410,"text":14583},{"id":14628,"depth":410,"text":14629},{"id":14749,"depth":410,"text":14750},{"id":14770,"depth":410,"text":14771},{"id":14795,"depth":410,"text":14796},{"id":14899,"depth":410,"text":14900},{"id":15031,"depth":410,"text":15032},{"id":15058,"depth":410,"text":15059},{"id":15101,"depth":410,"text":15102},"2026-03-06","Accidentally made a git commit to wrong branch? Learn how to move commits to a feature branch and clean up master using git cherry-pick and reset.","git-commit-to-wrong-branch-fix.png",{},"/how-to/git-commit-to-wrong-branch-fix",{"title":14524,"description":15127},"How-To/1.git-commit-to-wrong-branch-fix",[14651,15134,15135],"version control","cherry-pick","n8isUYA0g4UX-h0sD-YAESjnQ7-UuIHQEF_OxEKfHs8",1776275227648]