Information_schema is a meta-database that holds information about your current database. information_schema has multiple tables you can query with the known SELECT * FROM syntax:
tables: information about all tables in your current database
columns: information about all columns in all of the tables in your current database
-
cd command to change the directory
cd../..
cd xampp/mysql/bin
mysql -u root -p -h localhost
show databases;
create database youtubestu;
DROP database youtubestu;
use youtubestu;
select database();
create table students
-> (
-> name varchar(55),
-> age int
-> );
desc students
show columns from studentsdemo;
drop table studentsdemo;
show tables;
insert into studentdiff
-> (id, name, class)
-> values(1, 'vinod' , 5);
select * from studentdiff;
NULLmeans that the value is not known of a field
create table stunull
-> (
-> id int not null,
-> name varchar(55) not null
-> );
create table studef
-> (
-> id int not null default 0,
-> name varchar(55) not null default 'unnamed'
-> );
insert into studef() values (); Query OK, 1 row affected (0.045 sec)
alter table studef ADD class int;
CREATE TABLE stud_unique
-> (
-> stud_id INT NOT NULL,
-> name VARCHAR(55),
-> age INT,
-> PRIMARY KEY (stud_id)
-> );
CREATE TABLE stud_auto_
-> (
-> stud_id INT NOT NULL AUTO_INCREMENT,
-> name VARC(100),
-> age INT,
-> PRIMARY KEY (stud_id)
-> );