🚀 DevOps & SRE Certification Program 📅 Starting: 1st of Every Month 🤝 +91 8409492687 🔍 Contact@DevOpsSchool.com

Upgrade & Secure Your Future with DevOps, SRE, DevSecOps, MLOps!

We spend hours on Instagram and YouTube and waste money on coffee and fast food, but won’t spend 30 minutes a day learning skills to boost our careers.
Master in DevOps, SRE, DevSecOps & MLOps!

Learn from Guru Rajesh Kumar and double your salary in just one year.


Get Started Now!

How to Read Data from Database in Tinker.

To read data from the database, we use the below commands:-

1. DB::table(“Table_name“)->get() :- It returns all the data present in the given table of database. See below:-

2. DB::table(“table_name”)->where(“key1″,”key1_value”)->first() :- It returns all data of the row in which key value found. See below:-

3. DB::table(“table_name”)->pluck(“column_name”); :- It returns all the data stored in the given column from database.

Pluck :- pluck is a method in laravel which is used when we have to fetch a particular column from database.

4. DB::table(“Table_name”)->select(“column1”, “column2”, “column3”)->get() :- It is used to return the given data of the row. Means, if we call name and E-mail column then it returns the both with row-wise. See below how it works:-

5. DB::table(“Table_name”)->count() :- It returns the no. of rows. See below:-

There are 5 rows in my database so it returns 5.

6. DB::table(“Table_name”)->max(“ Column_name “) :- It returns the maximum id no. of your data from database. See below:-

See the Database Below:-

7. DB::table(“Table_name”)->min(“ Column_name “) :- It returns the minimum id no. of your data from database. See below:-

See the Database Below:-

8. DB::table(“Table_name”)->min(“Column_name”) :- It returns the average value of the given column.

Suppose I want the average value of the id column. See below:-

Certification Courses

DevOpsSchool has introduced a series of professional certification courses designed to enhance your skills and expertise in cutting-edge technologies and methodologies. Whether you are aiming to excel in development, security, or operations, these certifications provide a comprehensive learning experience. Explore the following programs:

DevOps Certification, SRE Certification, and DevSecOps Certification by DevOpsSchool

Explore our DevOps Certification, SRE Certification, and DevSecOps Certification programs at DevOpsSchool. Gain the expertise needed to excel in your career with hands-on training and globally recognized certifications.