SQL with MySQL
A screen can say "Order placed" while the database holds a different total, a missing row, or a duplicate. SQL lets a tester look behind the app. This page teaches the queries a tester runs on MySQL, the traps of NULL and counting, and how to change test data safely.
7 min read7 মিনিটে পড়া যায় · 7 sections7টি সেকশন · 16 sources16টি সোর্স · updated Nov 2026আপডেট: Nov 2026
NULL, LEFT JOIN, and COUNTNULL, LEFT JOIN আর COUNT
See a LEFT JOIN make a NULL row, then see why = NULL finds nothing and COUNT(*) differs from COUNT(column).দেখুন LEFT JOIN কীভাবে NULL row বানায়, আর কেন = NULL কিছু পায় না এবং COUNT(*) আর COUNT(column) আলাদা হয়।
You’ll learnআপনি শিখবেন
- What a LEFT JOIN does to a row with no matchমিলহীন row-র সাথে LEFT JOIN কী করে
- How IS NULL finds rows with no partnerIS NULL কীভাবে জোড়াহীন row খোঁজে
- Why = NULL never matchesকেন = NULL কখনো মেলে না
- How COUNT(*) and COUNT(column) differCOUNT(*) আর COUNT(column)-এর পার্থক্য
What it is
MySQL is a database management system, and its databases are relational Source 16সোর্স 16. A relational database stores data in separate tables Source 16সোর্স 16. SQL is the most common standardized language used to access databases Source 16সোর্স 16.
SELECT retrieves rows from one or more tables Source 1সোর্স 1. INSERT adds new rows to a table Source 5সোর্স 5. UPDATE modifies rows Source 6সোর্স 6, and DELETE removes them Source 7সোর্স 7.
The command-line client is mysql, a simple SQL shell that you can use interactively or from a script Source 15সোর্স 15. You connect with mysql --user=user_name --password db_name, and it asks for the password Source 15সোর্স 15.
Databases and DBMS explains what a database server does for an app, and Indexes explains why some queries are fast. This page is about writing the queries.
সহজ English
MySQL is a database system. It keeps data in separate tables Source 16সোর্স 16. SQL is the most common standard language for working with a database Source 16সোর্স 16.
SELECT reads rows Source 1সোর্স 1. INSERT adds rows Source 5সোর্স 5. UPDATE changes rows Source 6সোর্স 6. DELETE removes rows Source 7সোর্স 7.
You type SQL into mysql, a simple SQL shell Source 15সোর্স 15. You start it with mysql --user=user_name --password db_name, and then type your password Source 15সোর্স 15.
Databases and DBMS explains what a database server does for an app, and Indexes explains why some queries are fast. This page is about writing the queries.
বাংলা ব্যাখ্যা
MySQL একটা database management system, আর এর database-গুলো relational Source 16সোর্স 16। Relational database ডেটা আলাদা আলাদা table-এ রাখে Source 16সোর্স 16। SQL হলো database access করার সবচেয়ে প্রচলিত standard language Source 16সোর্স 16।
SELECT এক বা একাধিক table থেকে row আনে Source 1সোর্স 1। INSERT table-এ নতুন row যোগ করে Source 5সোর্স 5। UPDATE row বদলায় Source 6সোর্স 6, আর DELETE row মুছে দেয় Source 7সোর্স 7।
Command-line client হলো mysql, একটা সহজ SQL shell, যেটা হাতে বা script থেকে ব্যবহার করা যায় Source 15সোর্স 15। mysql --user=user_name --password db_name দিয়ে connect করলে এটা password চায় Source 15সোর্স 15।
একটা app-এর জন্য database server কী করে, তা Databases and DBMS-এ আছে, আর কিছু query কেন দ্রুত, তা Indexes-এ। এই পেজ query লেখা নিয়ে।
How it works
- Filtering and limits.
WHEREgives the conditions that a row must satisfy to be selected Source 1সোর্স 1.LIMITconstrains the number of rows that come back Source 1সোর্স 1. - Joins.
ONsays how to join two tables, andWHEREsays which rows to keep Source 2সোর্স 2. In aLEFT JOIN, a left row with no match gets a right-side row with every column set toNULLSource 2সোর্স 2. That is how you find rows with no counterpart in another table Source 2সোর্স 2. NULL.NULLmeans a missing, unknown value Source 3সোর্স 3, and it is not an empty string Source 10সোর্স 10. Test for it withIS NULLandIS NOT NULLSource 3সোর্স 3. You cannot test for it with=,<, or<>Source 3সোর্স 3: a comparison withNULLgivesNULLSource 3সোর্স 3.- Counting.
COUNT(expr)counts the non-NULLvalues of the expression Source 4সোর্স 4.COUNT(*)counts the rows, whether they containNULLvalues or not Source 4সোর্স 4.GROUP BYgroups the rows for each value, so a count per customer is one query Source 12সোর্স 12. - Patterns. In a
LIKEpattern,_matches one character and%matches any number of characters Source 14সোর্স 14. Patterns are case-insensitive by default Source 14সোর্স 14. - Keys. A primary key is the column or columns of your most vital queries, and it cannot include
NULLSource 13সোর্স 13. A foreign key links a child table to the values of a parent table Source 9সোর্স 9. By default, MySQL rejects a delete of a parent row that a child row still references Source 9সোর্স 9. - Transactions.
START TRANSACTIONstarts a transaction.COMMITmakes its changes permanent, andROLLBACKcancels them Source 8সোর্স 8. Autocommit is on by default, so outside a transaction each statement is committed at once and you cannot roll it back Source 8সোর্স 8.
সহজ English
- Picking rows.
WHEREsays which rows you want Source 1সোর্স 1.LIMITsays how many to show Source 1সোর্স 1. - Joining tables.
ONsays how two tables match Source 2সোর্স 2. In aLEFT JOIN, a left row with no match gets a right side filled withNULLSource 2সোর্স 2. That is how you find rows that have no partner Source 2সোর্স 2. NULL.NULLmeans "unknown" Source 3সোর্স 3, and it is not the same as empty text Source 10সোর্স 10. Check it withIS NULLSource 3সোর্স 3.= NULLnever works, because any comparison withNULLisNULLSource 3সোর্স 3.- Counting.
COUNT(column)skipsNULLvalues Source 4সোর্স 4.COUNT(*)counts every row Source 4সোর্স 4.GROUP BYgroups the rows, so one query can give a count for each group Source 12সোর্স 12. - Patterns. In
LIKE,%is any text and_is one character Source 14সোর্স 14. Capital letters do not matter by default Source 14সোর্স 14. - Keys. A primary key is the column or columns of your most vital queries, and it can never hold
NULLSource 13সোর্স 13. A foreign key links a child table to the values of a parent table Source 9সোর্স 9. By default, MySQL stops you from deleting a parent that still has children Source 9সোর্স 9. - Transactions. Start with
START TRANSACTION.COMMITkeeps the changes, andROLLBACKthrows them away Source 8সোর্স 8. Autocommit is on by default, so without a transaction each statement is saved at once and cannot be undone Source 8সোর্স 8.
বাংলা ব্যাখ্যা
- Filter আর limit। একটা row বাছাই হতে হলে কোন শর্ত মানতে হবে, তা বলে
WHERESource 1সোর্স 1। কতগুলো row ফেরত আসবে, তা সীমিত করেLIMITSource 1সোর্স 1। - Join। দুটো table কীভাবে join হবে তা বলে
ON, আর কোন row রাখা হবে তা বলেWHERESource 2সোর্স 2।LEFT JOIN-এ বাঁ দিকের কোনো row-এর মিল না থাকলে ডান দিকে এমন একটা row বসে, যার সব columnNULLSource 2সোর্স 2। এভাবেই খুঁজে পাওয়া যায় কোন row-এর অন্য table-এ কোনো জোড়া নেই Source 2সোর্স 2। NULL।NULLমানে হারানো, অজানা একটা value Source 3সোর্স 3, আর এটা empty string নয় Source 10সোর্স 10। এটা চেক করুনIS NULLআরIS NOT NULLদিয়ে Source 3সোর্স 3।=,<বা<>দিয়ে এটা চেক করা যায় না Source 3সোর্স 3:NULL-এর সাথে যেকোনো তুলনার ফলNULLSource 3সোর্স 3।- গণনা।
COUNT(expr)expression-এর non-NULLvalue গোনে Source 4সোর্স 4।COUNT(*)row গোনে, তাতেNULLথাকুক বা না থাকুক Source 4সোর্স 4।GROUP BYপ্রতিটা value-এর জন্য row-গুলোকে group করে, তাই প্রতি customer-এর গণনা একটা query-তেই হয় Source 12সোর্স 12। - Pattern।
LIKEpattern-এ_একটা character-এর সাথে মেলে, আর%যেকোনো সংখ্যক character-এর সাথে Source 14সোর্স 14। ডিফল্টভাবে pattern case-insensitive Source 14সোর্স 14। - Key। Primary key হলো সবচেয়ে জরুরি query-গুলোর column বা column-গুলো, আর এতে
NULLথাকতে পারে না Source 13সোর্স 13। Foreign key একটা child table-কে parent table-এর value-র সাথে যুক্ত করে Source 9সোর্স 9। ডিফল্টভাবে, কোনো child row এখনো যে parent row-কে refer করে, MySQL সেটা মুছতে দেয় না Source 9সোর্স 9। - Transaction।
START TRANSACTIONএকটা transaction শুরু করে।COMMITতার পরিবর্তন স্থায়ী করে, আরROLLBACKবাতিল করে Source 8সোর্স 8। Autocommit ডিফল্টভাবে চালু, তাই transaction-এর বাইরে প্রতিটা statement সঙ্গে সঙ্গে commit হয়, আর সেটা rollback করা যায় না Source 8সোর্স 8।
Try it
You need a MySQL 8.4 server on which you may create a database: a local install or a throwaway container. Connect with the mysql client and create two tables:
CREATE TABLE customers (
id INT PRIMARY KEY,
name VARCHAR(50) NOT NULL,
phone VARCHAR(20)
);
CREATE TABLE orders (
id INT PRIMARY KEY,
customer_id INT NOT NULL,
total DECIMAL(8,2) NOT NULL,
status VARCHAR(20) NOT NULL,
FOREIGN KEY (customer_id) REFERENCES customers (id)
);
INSERT INTO customers (id, name, phone) VALUES
(1, 'Asha', '01711000000'),
(2, 'Rafi', NULL),
(3, 'Mina', '');
INSERT INTO orders (id, customer_id, total, status) VALUES
(10, 1, 1200.00, 'paid'),
(11, 1, 450.50, 'pending'),
(12, 2, 999.00, 'paid');Now count the orders of each customer:
SELECT customers.name, COUNT(orders.id) AS order_count
FROM customers
LEFT JOIN orders ON orders.customer_id = customers.id
GROUP BY customers.id, customers.name
ORDER BY customers.id;In interactive use, mysql shows the result as a table Source 15সোর্স 15: Asha 2, Rafi 1, Mina 0. Then try these, and predict each answer first:
- Change
COUNT(orders.id)toCOUNT(*). Mina now has 1: theLEFT JOINmade a row for her withNULLon the right side Source 2সোর্স 2, andCOUNT(*)counts rows whether or not they containNULLvalues Source 4সোর্স 4. - Find the customers with no orders. Keep the
LEFT JOIN, select only the name, and keep the rows where the right side isNULLSource 2সোর্স 2:SELECT customers.name FROM customers LEFT JOIN orders ON orders.customer_id = customers.id WHERE orders.id IS NULL;Only Mina comes back. - Run
WHERE phone IS NULL, thenWHERE phone = '', thenWHERE phone = NULL. You get Rafi, then Mina, then no rows Source 3সোর্স 3. - Run
START TRANSACTION;, thenDELETE FROM orders WHERE status = 'pending';.SELECT COUNT(*) FROM orders;gives 2. RunROLLBACK;and count again: 3 Source 8সোর্স 8. - Run
DELETE FROM customers WHERE id = 1;. MySQL answersERROR 1451 (23000): Cannot delete or update a parent row: a foreign key constraint fails (...), where the server fills in the table and constraint names. It refuses because orders still reference Asha and, with noON DELETEclause, the default is RESTRICT, which rejects the parent delete Source 9সোর্স 9.
সহজ English
You need a MySQL 8.4 server where you may make a database: a local install or a throwaway container. Open the mysql client and create two tables:
CREATE TABLE customers (
id INT PRIMARY KEY,
name VARCHAR(50) NOT NULL,
phone VARCHAR(20)
);
CREATE TABLE orders (
id INT PRIMARY KEY,
customer_id INT NOT NULL,
total DECIMAL(8,2) NOT NULL,
status VARCHAR(20) NOT NULL,
FOREIGN KEY (customer_id) REFERENCES customers (id)
);
INSERT INTO customers (id, name, phone) VALUES
(1, 'Asha', '01711000000'),
(2, 'Rafi', NULL),
(3, 'Mina', '');
INSERT INTO orders (id, customer_id, total, status) VALUES
(10, 1, 1200.00, 'paid'),
(11, 1, 450.50, 'pending'),
(12, 2, 999.00, 'paid');Now count each customer's orders:
SELECT customers.name, COUNT(orders.id) AS order_count
FROM customers
LEFT JOIN orders ON orders.customer_id = customers.id
GROUP BY customers.id, customers.name
ORDER BY customers.id;Used interactively, mysql shows a table Source 15সোর্স 15: Asha 2, Rafi 1, Mina 0. Now guess, then try:
- Use
COUNT(*)instead. Mina gets 1: theLEFT JOINgave her a row withNULLon the right Source 2সোর্স 2, andCOUNT(*)counts rows even when they holdNULLSource 4সোর্স 4. - Find customers with no orders Source 2সোর্স 2:
SELECT customers.name FROM customers LEFT JOIN orders ON orders.customer_id = customers.id WHERE orders.id IS NULL;Only Mina. - Try
phone IS NULL,phone = '', andphone = NULL. You get Rafi, Mina, and nothing Source 3সোর্স 3. - Run
START TRANSACTION;and delete the pending order.SELECT COUNT(*) FROM orders;gives 2. RunROLLBACK;and count again: 3 Source 8সোর্স 8. - Try to delete Asha. MySQL refuses with error 1451, because her orders still point to her. With no
ON DELETEclause, the default is RESTRICT, which rejects the delete Source 9সোর্স 9.
বাংলা ব্যাখ্যা
একটা MySQL 8.4 server লাগবে, যেখানে আপনি database বানাতে পারেন: local install বা একটা ফেলে দেওয়া যায় এমন container। mysql client দিয়ে connect করে দুটো table বানান:
CREATE TABLE customers (
id INT PRIMARY KEY,
name VARCHAR(50) NOT NULL,
phone VARCHAR(20)
);
CREATE TABLE orders (
id INT PRIMARY KEY,
customer_id INT NOT NULL,
total DECIMAL(8,2) NOT NULL,
status VARCHAR(20) NOT NULL,
FOREIGN KEY (customer_id) REFERENCES customers (id)
);
INSERT INTO customers (id, name, phone) VALUES
(1, 'Asha', '01711000000'),
(2, 'Rafi', NULL),
(3, 'Mina', '');
INSERT INTO orders (id, customer_id, total, status) VALUES
(10, 1, 1200.00, 'paid'),
(11, 1, 450.50, 'pending'),
(12, 2, 999.00, 'paid');এবার প্রতিটা customer-এর order গুনুন:
SELECT customers.name, COUNT(orders.id) AS order_count
FROM customers
LEFT JOIN orders ON orders.customer_id = customers.id
GROUP BY customers.id, customers.name
ORDER BY customers.id;হাতে চালালে mysql ফলাফল table আকারে দেখায় Source 15সোর্স 15: Asha 2, Rafi 1, Mina 0। এবার এগুলো চালান, প্রতিটার উত্তর আগে আন্দাজ করে:
COUNT(orders.id)বদলেCOUNT(*)লিখুন। Mina এবার 1 পায়:LEFT JOINতার জন্য ডান দিকেNULL-সহ একটা row বানিয়েছে Source 2সোর্স 2, আরCOUNT(*)row গোনে, তাতেNULLথাকুক বা না থাকুক Source 4সোর্স 4।- যাদের কোনো order নেই, সেই customer খুঁজুন।
LEFT JOINরেখে শুধু নাম select করুন, আর সেই row-গুলো রাখুন, যেখানে ডান দিকNULLSource 2সোর্স 2:SELECT customers.name FROM customers LEFT JOIN orders ON orders.customer_id = customers.id WHERE orders.id IS NULL;শুধু Mina আসে। WHERE phone IS NULL, তারপরWHERE phone = '', তারপরWHERE phone = NULLচালান। আসবে Rafi, তারপর Mina, তারপর কোনো row নয় Source 3সোর্স 3।START TRANSACTION;চালিয়েDELETE FROM orders WHERE status = 'pending';দিন।SELECT COUNT(*) FROM orders;দিলে 2।ROLLBACK;দিয়ে আবার গুনুন: 3 Source 8সোর্স 8।DELETE FROM customers WHERE id = 1;চালান। MySQL উত্তর দেয়ERROR 1451 (23000): Cannot delete or update a parent row: a foreign key constraint fails (...)(server এখানে table ও constraint-এর নাম বসায়)। কারণ order-গুলো এখনো Asha-কে refer করে, আরON DELETEনা দিলে ডিফল্ট RESTRICT, যা parent delete প্রত্যাখ্যান করে Source 9সোর্স 9।
How a tester uses it
- Check what the app saved. After a test places an order through the UI or the API, retrieve its row with a
SELECTand aWHEREon the order's id Source 1সোর্স 1. Compare the stored total and status with what the screen said. - Find orphans. A
LEFT JOINwithWHERE ... IS NULLfinds rows with no counterpart, such as orders whose customer is missing Source 2সোর্স 2. - Count by group.
COUNT()withGROUP BYcounts the rows of each group in one query, like the count per customer in Try it Source 12সোর্স 12. - Set up and clean up data.
INSERTbuilds the rows a test needs Source 5সোর্স 5. Inside a transaction,ROLLBACKcancels the changes when the check is done Source 8সোর্স 8. - Test the rules of the data. Try to insert a row that breaks a key, or delete a parent that has children. A foreign key constraint rejects the parent delete Source 9সোর্স 9, and the app must show a clear message, not a crash.
- Test for SQL injection. When an app builds a query by joining strings, an attacker can put SQL into the input, and the database runs it Source 11সোর্স 11. The fix is to define the SQL structure apart from its data values, then bind the values through the database API: a parameterized query, with
?as the placeholder for each value Source 11সোর্স 11. Web Application Security shows how to test for it.
সহজ English
- Check what was saved. After a test places an order, get its row with a
SELECTand aWHEREon its id Source 1সোর্স 1. Does it match the screen? - Find orphans. A
LEFT JOINwithIS NULLfinds rows with no partner, like orders whose customer is gone Source 2সোর্স 2. - Count by group.
COUNT()withGROUP BYgives a count for each group in one query Source 12সোর্স 12. - Make and clean test data.
INSERTadds the rows you need Source 5সোর্স 5. In a transaction,ROLLBACKremoves the changes afterwards Source 8সোর্স 8. - Test the data rules. Try to delete a parent that still has children. The foreign key refuses Source 9সোর্স 9, and the app must show a clear message.
- Test for SQL injection. If an app glues your input into a query, an attacker can sneak SQL in and the database runs it Source 11সোর্স 11. The fix is a parameterized query: the SQL structure is kept apart from the values, with
?where each value goes, and the values are bound in separately Source 11সোর্স 11. See Web Application Security.
বাংলা ব্যাখ্যা
- App কী সেভ করেছে, তা চেক করুন। UI বা API দিয়ে টেস্ট একটা order দেওয়ার পর order-এর id-এর ওপর
WHERE-সহ একটাSELECTদিয়ে তার row আনুন Source 1সোর্স 1। জমা হওয়া total আর status স্ক্রিনের কথার সাথে মিলিয়ে দেখুন। - অনাথ row খুঁজুন।
WHERE ... IS NULL-সহLEFT JOINএমন row খুঁজে দেয়, যার কোনো জোড়া নেই, যেমন এমন order, যার customer নেই Source 2সোর্স 2। - Group ধরে গুনুন।
GROUP BY-সহCOUNT()একটা query-তেই প্রতিটা group-এর row গোনে, যেমন Try it-এ প্রতি customer-এর গণনা Source 12সোর্স 12। - ডেটা তৈরি আর পরিষ্কার। টেস্টের দরকারি row
INSERTদিয়ে বানানো যায় Source 5সোর্স 5। Transaction-এর ভেতরে থাকলে চেক শেষেROLLBACKপরিবর্তনগুলো বাতিল করে Source 8সোর্স 8। - ডেটার নিয়ম টেস্ট করুন। Key ভাঙে এমন row insert করার চেষ্টা করুন, বা child আছে এমন parent মুছুন। Foreign key constraint parent মোছা বাতিল করে Source 9সোর্স 9, আর app-কে crash নয়, একটা পরিষ্কার message দেখাতে হবে।
- SQL injection টেস্ট করুন। App যখন string জোড়া দিয়ে query বানায়, তখন attacker input-এ SQL ঢোকাতে পারে, আর database সেটা চালায় Source 11সোর্স 11। সমাধান হলো parameterized query: SQL-এর কাঠামো data value থেকে আলাদা করে লেখা হয়, প্রতিটা value-র জায়গায় থাকে
?, আর value-গুলো পরে database API দিয়ে bind করা হয় Source 11সোর্স 11। কীভাবে টেস্ট করবেন, তা Web Application Security-এ আছে।
Common mistakes
= NULLin a check. Any comparison withNULLgivesNULLSource 3সোর্স 3, andexpr = NULLis never true, soWHERE phone = NULLreturns no rows Source 10সোর্স 10. UseIS NULL.- Treating
NULLas empty.NULLis not the same thing as an empty string''Source 10সোর্স 10. A test for "no phone" must say which of the two it means. COUNT(*)after aLEFT JOIN.COUNT(*)counts rows whether or not they containNULLvalues Source 4সোর্স 4, so it also counts theNULLrow of an unmatchedLEFT JOINSource 2সোর্স 2. Count a column of the right table instead.UPDATEorDELETEwith noWHERE. WithoutWHERE,UPDATEchanges all the rows Source 6সোর্স 6, andDELETEremoves all the rows Source 7সোর্স 7. Run the sameWHEREin aSELECTfirst.- Expecting
ROLLBACKto undo anything. With autocommit on, a statement outside a transaction is committed at once, andROLLBACKcannot undo it Source 8সোর্স 8. =with a pattern. Do not use=or<>with SQL patterns; useLIKEorNOT LIKESource 14সোর্স 14.
সহজ English
= NULLin a check. Comparing withNULLgivesNULLSource 3সোর্স 3, and= NULLis never true, so it matches no rows Source 10সোর্স 10. UseIS NULL.- Treating
NULLas empty.NULLand''are different Source 10সোর্স 10. Say which one the test means. COUNT(*)after aLEFT JOIN. It counts rows even when they holdNULLSource 4সোর্স 4, so it also counts the empty row of an unmatched join Source 2সোর্স 2. Count a column of the right table.UPDATEorDELETEwith noWHERE. It changes or deletes every row Source 6সোর্স 6 Source 7সোর্স 7. Run theWHEREas aSELECTfirst.- Thinking
ROLLBACKalways works. With autocommit on, a statement outside a transaction is saved at once and cannot be undone Source 8সোর্স 8. =with a pattern. Do not use=with a pattern; useLIKEorNOT LIKESource 14সোর্স 14.
বাংলা ব্যাখ্যা
- চেকে
= NULL।NULL-এর সাথে যেকোনো তুলনার ফলNULLSource 3সোর্স 3, আরexpr = NULLকখনো সত্য হয় না, তাইWHERE phone = NULLকোনো row দেয় না Source 10সোর্স 10।IS NULLব্যবহার করুন। NULL-কে খালি ধরা।NULLআর empty string''এক জিনিস নয় Source 10সোর্স 10। "Phone নেই"-এর টেস্টকে বলতে হবে, দুটোর কোনটা বোঝানো হচ্ছে।LEFT JOIN-এর পরেCOUNT(*)।COUNT(*)row গোনে, তাতেNULLথাকুক বা না থাকুক Source 4সোর্স 4, তাই মিল না পাওয়াLEFT JOIN-এরNULLrow-ও গোনে Source 2সোর্স 2। তার বদলে ডান দিকের table-এর একটা column গুনুন।WHEREছাড়াUPDATEবাDELETE।WHEREছাড়াUPDATEসব row বদলে দেয় Source 6সোর্স 6, আরDELETEসব row মুছে দেয় Source 7সোর্স 7। আগে একইWHEREদিয়ে একটাSELECTচালান।- ভাবা যে
ROLLBACKসবকিছু ফেরাতে পারে। Autocommit চালু থাকলে transaction-এর বাইরের statement সঙ্গে সঙ্গে commit হয়, আরROLLBACKসেটা ফেরাতে পারে না Source 8সোর্স 8। - Pattern-এর সাথে
=। SQL pattern-এর সাথে=বা<>ব্যবহার করবেন না;LIKEবাNOT LIKEব্যবহার করুন Source 14সোর্স 14।
What a tester can check
Tutorial advice
This list is the tutorial's own advice, not a fact from a source.
- Saved values. After each important action, does the stored row match what the screen and the API said?
- Orphans and duplicates. Are there child rows with no parent, or two rows where there should be one?
NULLand empty. Does the app store "unknown" and "none" the way the requirement says?- Counts. Do the totals per group in the database match the totals in the reports?
- Safe access. Do the tests use a database account with only the rights they need, never production data?
- Clean-up. Does every test remove or roll back the data that it made?
সহজ English
Tutorial advice
This list is the tutorial's own advice, not a fact from a source.
- Saved values. Does the stored row match the screen and the API?
- Orphans and duplicates. Any rows with no parent, or two rows where there should be one?
NULLand empty. Does the app store "unknown" and "none" the way the requirement says?- Counts. Do the database totals match the reports?
- Safe access. Do tests use an account with only the rights they need, and never production data?
- Clean-up. Does each test remove the data it made?
বাংলা ব্যাখ্যা
Tutorial advice
এই তালিকা টিউটোরিয়ালের নিজের পরামর্শ, কোনো source থেকে নেওয়া তথ্য নয়।
- জমা হওয়া value। প্রতিটা জরুরি কাজের পর জমা হওয়া row কি স্ক্রিন আর API-র কথার সাথে মেলে?
- অনাথ আর duplicate row। Parent ছাড়া কোনো child row আছে কি, বা যেখানে একটা row থাকার কথা, সেখানে দুটো?
NULLআর খালি। App কি "অজানা" আর "নেই" requirement যেভাবে বলে, সেভাবে জমা রাখে?- গণনা। Database-এর প্রতি group-এর মোট কি report-এর মোটের সাথে মেলে?
- নিরাপদ access। টেস্ট কি শুধু দরকারি অধিকারওয়ালা database account ব্যবহার করে, আর কখনো production data নয়?
- পরিষ্কার করা। প্রতিটা টেস্ট কি নিজের বানানো ডেটা মুছে দেয় বা rollback করে?
Key words
| Term | Meaning |
|---|---|
| SQL | The most common standardized language used to access databases. |
SELECT | Reads rows; WHERE filters them and LIMIT caps how many come back. |
LEFT JOIN | A join in which a left row with no match gets a right-side row of NULLs. |
NULL | A missing, unknown value; not an empty string. Test it with IS NULL. |
COUNT(expr) / COUNT(*) | Counts non-NULL values / counts every row. |
GROUP BY | Groups the rows for each value, for one count per group. |
| Primary key | The column or columns of the most vital queries; it cannot include NULL. |
| Foreign key | Links a child table to the values of a parent table. |
| Transaction | Statements that COMMIT makes permanent or ROLLBACK cancels. |
| Autocommit | The default mode: each statement outside a transaction is committed at once. |
LIKE | Pattern matching: % is any text, _ is one character. |
| Parameterized query | A query whose SQL is defined apart from its values, with ? placeholders that the values are bound to; the fix for SQL injection. |