import the data in your mysql using phpmyadmin:

-- phpMyAdmin SQL Dump
-- version 5.0.4
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Feb 09, 2021 at 10:04 AM
-- Server version: 10.4.17-MariaDB
-- PHP Version: 7.4.14

SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";


/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;

--
-- Database: `mysql-tutorial`
--

-- --------------------------------------------------------

--
-- Table structure for table `users`
--

CREATE TABLE `users` (
  `id` int(11) NOT NULL,
  `name` varchar(150) NOT NULL,
  `country` varchar(100) NOT NULL,
  `city` varchar(100) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `users`
--

INSERT INTO `users` (`id`, `name`, `country`, `city`) VALUES
(3, 'gopal yadav', 'India', 'Kolkata'),
(4, 'Asif1 Gilani', 'United States', 'Irvington'),
(9, 'chaitanya krishna', 'India', 'Bangalore'),
(11, 'Akash Gupta', 'Germany', ''),
(12, 'hardeep singh', 'India', 'Nagar'),
(13, 'Pusendra Chaudhary', 'Nepal', 'Kathmandu'),
(14, 'Serikbayev Yerkebulan', 'Kazakhstan', 'Almaty'),
(15, 'Katta Mani Prajwal', 'India', 'Hyderabad'),
(16, 'erezerez bbanaianai', 'Thailand', 'Bangkok'),
(17, 'venukishore Doodi', 'India', 'Hyderabad'),
(18, 'Acvin Gonsalves', 'India', ''),
(19, 'JVIVEK RAJPUT', 'India', 'Hasanpur'),
(20, 'jothi baskar', 'India', 'Chennai'),
(21, 'annu121 mehla', 'India', ''),
(22, 'Harpreet Singh', 'India', ''),
(23, 'annu1 mehla', 'India', ''),
(24, 'Shiv Kumar Singh', 'India', 'Patna'),
(25, 'sasaaasasasa adsdsss', 'Egypt', ''),
(26, 'omkar Utkur', 'India', 'Pune'),
(27, 'pooja kadam', 'India', 'Mumbai'),
(28, 'mohinder singh', 'India', 'Ludhiana'),
(29, 'TUMU Venkata reddy', 'India', 'Hyderabad'),
(30, 'Priyanka Rathod', 'India', 'Ahmedabad'),
(31, 'arushi singh', 'India', 'Pune'),
(32, 'Sheikh Ikramuddin', 'India', ''),
(33, 'Neilfred Aguilar', 'Philippines', 'Agus'),
(34, 'Trilok Kumar', 'India', 'Gurgaon'),
(35, 'Pisey Langa', 'Cambodia', 'Phnom Penh'),
(36, 'JOHAN OSORIO', 'Colombia', 'Medellín'),
(37, 'Wilson Cantillo', 'Panama', 'Panama City'),
(38, 'chinto priya', 'India', 'Chennai'),
(39, 'Tylerpoutt Tylerpoutt', 'Norway', 'Oslo'),
(40, 'seeed74 hadab', 'Sudan', ''),
(41, 'TOUMZINE RACHID', 'Morocco', 'Beni Mellal'),
(42, 'StephenDap StephenDap', 'Spain', 'Madrid'),
(43, 'pircher pircher', 'Luxembourg', ''),
(44, 'NelsonEraps NelsonEraps', 'Poland', 'Warsaw'),
(45, 'StevenMayot StevenMayot', 'Republic of Lithuania', ''),
(46, 'Michaelfuh Michaelfuh', 'Slovakia', 'Bratislava'),
(47, 'Suneesh Sukumaran', 'India', 'Thiruvananthapuram'),
(48, 'Joshuaflula Joshuaflula', 'Norway', 'Oslo'),
(49, 'pinyo younes', 'Morocco', ''),
(50, 'ClaudiuElamb ClaudiuElambJL', 'Germany', 'Berlin'),
(51, 'EnriqueLiany EnriqueLiany', 'Latvia', ''),
(52, 'Jefffff Bluuuu', 'United States', 'New Albany'),
(53, 'Jeffisawesome Blubaugh', 'United States', 'New Albany'),
(54, 'JamesNew JamesNew', 'Serbia', 'Belgrade'),
(55, 'MYUNG MYUNG', 'Republic of Moldova', 'Chisinau'),
(56, 'CarlosJem CarlosJem', 'Belarus', ''),
(57, 'Robertphymn Robertphymn', 'Republic of Lithuania', ''),
(58, 'YOGESH TJORAT', 'India', ''),
(59, 'Irojah Olumeyan', 'Nigeria', 'Ilorin'),
(61, 'KevinZob KevinZob', 'Slovakia', 'Bratislava'),
(62, 'KevinDem KevinDemDL', 'Netherlands', ''),
(63, 'ms.renu shukla', 'India', 'Bhopal'),
(64, 'Nnamani Tochukwu', 'Nigeria', 'Lagos'),
(65, 'Sovan Biswas', 'India', 'Kolkata'),
(66, 'ahmed albaghdadi', 'Iraq', 'Baghdad'),
(67, 'bhaiya kisan kanahya', 'India', 'Kanpur'),
(68, 'Aminu Garba Ahmad', 'Nigeria', 'Suleja'),
(69, 'surajit bhadra', 'United Kingdom', 'London'),
(70, 'muscab mahad', 'Djibouti', ''),
(71, 'RonaldSumma RonaldSummaIY', 'Spain', 'Madrid'),
(74, 'Jhone Smith', 'Spain', 'Barcelona'),
(75, 'Jhone Smith', 'Spain', 'Barcelona'),
(79, 'Richard Jensen', 'United States', 'Ashburn'),
(133, 'Mike Davis', 'United Kingdom', 'London'),
(134, 'cheap sildenafil', 'Russia', ''),
(135, 'Jenniferhib', 'Brazil', 'Porto Alegre');

--
-- Indexes for dumped tables
--

--
-- Indexes for table `users`
--
ALTER TABLE `users`
  ADD PRIMARY KEY (`id`);

--
-- AUTO_INCREMENT for dumped tables
--

--
-- AUTO_INCREMENT for table `users`
--
ALTER TABLE `users`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=136;
COMMIT;

/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;



In this tutorial, We will learn some basic select queries in MySQL.


syntax:

SELECT select_list
FROM table_name;


Example

select * from users;

+----+-----------------------+---------------+-----------+
| id | name                  | country       | city      |
+----+-----------------------+---------------+-----------+
|  3 | gopal yadav           | India         | Kolkata   |
|  4 | Asif1 Gilani          | United States | Irvington |
|  9 | chaitanya krishna     | India         | Bangalore |
| 11 | Akash Gupta           | Germany       |           |
| 12 | hardeep singh         | India         | Nagar     |
| 13 | Pusendra Chaudhary    | Nepal         | Kathmandu |
| 14 | Serikbayev Yerkebulan | Kazakhstan    | Almaty    |
| 15 | Katta Mani Prajwal    | India         | Hyderabad |
| 16 | erezerez bbanaianai   | Thailand      | Bangkok   |
| 17 | venukishore Doodi     | India         | Hyderabad |
+----+-----------------------+---------------+-----------+


Select only name field

mysql>select name from users

+-----------------------+
| name                  |
+-----------------------+
| gopal yadav           |
| Asif1 Gilani          |
| chaitanya krishna     |
| Akash Gupta           |
| hardeep singh         |
| Pusendra Chaudhary    |
| Serikbayev Yerkebulan |
| Katta Mani Prajwal    |
| erezerez bbanaianai   |
| venukishore Doodi     |
+-----------------------+


select name and city:

 mysql>select name,city from users;
+-----------------------+-----------+
| name                  | city      |
+-----------------------+-----------+
| gopal yadav           | Kolkata   |
| Asif1 Gilani          | Irvington |
| chaitanya krishna     | Bangalore |
| Akash Gupta           |           |
| hardeep singh         | Nagar     |
| Pusendra Chaudhary    | Kathmandu |
| Serikbayev Yerkebulan | Almaty    |
| Katta Mani Prajwal    | Hyderabad |
| erezerez bbanaianai   | Bangkok   |
| venukishore Doodi     | Hyderabad |
+-----------------------+-----------+

Thanks it will help you.





Are you facing problems in understanding this article?
You can watch the video. Watch it now