MySql

MySQL DELETE data from table

In this post we will look into MySQL delete command. This lets you delete records from table. Syntax You have to specify table name along with where condition. Do use this command with caution as it can delete all the data if where condition is not supplied. Example Here we have deleted record with user_id …

MySQL DELETE data from table Read More »

MySQL UPDATE data in Table

In this post we will look into update command in MySQL. This command lets you update data of record. Syntax This command lets to set multiple fields in once. Here you also need to provide WHERE condition else it will update all the records present in that table. Example Here we have updated first_name and …

MySQL UPDATE data in Table Read More »

MySQL INSERT data in Table

In this post we will explore INSERT command to insert data into MySQL table. This command lets you to insert single as well as multiple records into table. Syntax Example – Multiple record with mapping Here we are adding 2 records to table. values should be in same order as keys. You can find output …

MySQL INSERT data in Table Read More »

MySQL DROP Table

We will explore DROP table command in this post. This command let you delete table along with all the data. Syntax Example This will delete the users table along with all of its data. Do use this command with caution as this will remove schema info of table.

MySQL TRUNCATE Table

In this post we will explore MySQL TRUNCATE command. This command lets you delete data from you database without deleting table schema. So when to delete whole data from MySQL table then just use this command. Syntax Example This will delete all the records present in users table. Output mysql> SELECT * FROM users; +———+————+———–+ …

MySQL TRUNCATE Table Read More »

MySQL ALTER Table

In this post we will look into ALTER table command. This command lets you make schema changes in existing table. This Command lets you add new column, modify existing column, rename existing column, rename the table. We will be altering users table which we in our last post. Table of Content Add new column in …

MySQL ALTER Table Read More »

MySQL CREATE Table

In this post we will learn how to create a table in MySQL. In last posts we learned how to create,use and drop a database. Now we will start learning operations for table. Syntax To create MySQL table we will need following information. Table name Column name Column destinations/types Example In this example we have …

MySQL CREATE Table Read More »

MySQL DELETE Database

In this post we will learn how to delete a database in MySQL. Some time we need to delete a database so we need to use this command. Syntax Example This command will delete the user_service database from your MySQL server. All the data and tables will be deleted and this cannot be recovered. So …

MySQL DELETE Database Read More »

MySQL SELECT Database

In this blog post we will learn how to select a database from list of databases to work on it. So to run command on database first you have to select that database on you MySQL server. Syntax Example This command will select user_service database. Now we can do operations on that database. To select …

MySQL SELECT Database Read More »