33
loading...
This website collects cookies to deliver better user experience
/* to retrieve all date in a table: */
SELECT * FROM TABLE_NAME;
/* we can filter the data using constraints (WHERE).
If we have a PERSON table with attributes such as Name and Age we can filter the results depending on conditions */
SELECT Name FROM PERSON
WHERE Age > 18;
// writing the same queries above, now using MongoDB
// .find() with a {} (empty document) inside , retrieves all the data within the collection
db.collection.find({});
// This query will retrieve all individuals over 18 years old
db.person.find({ age: {$gt: 18}});