SQI - it is called structured query language
A language which is used to access and manipulate data from the database
It is used by many databases such as MySQL
,ORACLE etc.
Installation of MtSQL - It is open a source RDBMS software It can be download from https://dev.mysql.com/downloads
SQL is case insensitive
Always end statement with semicolon (;)
Data types in SQL -
Int - specifies an integer value.
float - holds numbers with decimal points .
date - it is used for dates in YYYY-MM-DD format
varchar (n) - specifies character type data of length
Write query to create table and insert data in it (table name - student
roll_no. same. dob. Percentage
101. Tanya. 2004-11-01. 96.2
102. Sunil. 2006-01-07. 78.5
103. Laxmi. 2005-07-22. 55.8
104. Abhishek. 2005-12-11. 88.9
(1) Query to create database -
create database database_ name;
Ex- create database st;
(2) Query to use current database -
Ex- use st;
(3) Query to create table -
create table student
(
roll_no int,
same. varchar(20),
dob date,
percentage. float
);
(4) Query to insert data into table -
insert into student
values
( 101, 'tanya', '2004-11-01', 96.2);
(5) Query to display data into table -
select* into student;
=====================================
Query to view of an already created table-
describe table_ name;
Ex- describe student;
====================================
Query to remove database and table -
drop database. database_name;
Ex - drop database st;
drop table table_name;
Ex - drop table student;
====================================
Select statement - It is used to retrieve data from the tables and output is also displayed in the form of table .
No comments:
Post a Comment
if you have any doubt. please let me know.