Basics of My SQL:

SQL is mainly used for storing and retrieving data from databases, but it can do much more than that. Anything you need to do with a database, you can do with SQL. It’s flexible, powerful, and quick while being accessible and affordable for most businesses.

Basic steps:

Open My SQL Workbench.

Create Database:

A database is an organized collection of structured information, or data, typically stored electronically in a computer system. A database is usually controlled by a database management system (DBMS).

  • First create new Database eg:(learning).
  • next step use database learning

Create table:

Create table inside the (Learning)database

  • Table name (movies)
  • using Data type (varchar(20))
create table movies(movie_name varchar(20),actor varchar(20),release_year int,director varchar(20),production varchar(20));
movie_nameactorrelease_yearDirectorproduction

Insert value inside the table:

insert into movies value("jilla","vijay",1998,"sk","sunpictures");
insert into movies value("Kathi","vijay",2000,"sk",sunpictures");
insert into movies value("theri","vijay",2001,"sk","sunpictures");
insert into movies value("villu","vijay",2002,"sk","sunpictures");

movie_nameactorrelease_yeardirectorproduction
jillavijay1998sksunpictures
kathivijay2000sksunpictures
therivijay2001sksunpictures
villuvijay2002sksunpictures

If you Want to delete particular database:

delete from movies where movie_name=""kathi";
movie_nameactorrelease_yeardirectorproduction
jillavijay1998sksunpictures
therivijay2001sksunpictures
villuvijay2002sksunpictures

If you Want to update the table:

update movies set movie_name="beast" where release_year=1998;
movie_nameactorrelease_yeardirectorproduction
beastvijay1998sksunpictures
therivijay2001sksunpictures
villuvijay2002sksunpictures

If you Want to insert the another values in table:

insert into movies value("billa","ajith",2020,"null","sunpictures);
movie_nameactorrelease_yeardirection production
beastvijay1998sksunpictures
therivijay2001sksunpictures
villuvijay2002sksunpictures
billaajith2020sunpictures

If youWant count the table how many Rows:

select count(*) from movies;

4 rows in a table

If you want to select particular name from table:

select * from movies where movie_name<="theri";
movie_nameactorrelease_yeardirectionproduction
therivijay2001sksunpictures

My output:

Leave a Comment