0% found this document useful (0 votes)
380 views28 pages

Database: SQL Commands

This document discusses SQL commands and creating and manipulating databases. It defines what a database is and provides an example table. It then describes various SQL commands like CREATE TABLE, INSERT INTO, and SELECT that allow you to structure and interact with data in a database. Examples are given for how to use these commands to generate tables and insert, read, and select data from databases.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
380 views28 pages

Database: SQL Commands

This document discusses SQL commands and creating and manipulating databases. It defines what a database is and provides an example table. It then describes various SQL commands like CREATE TABLE, INSERT INTO, and SELECT that allow you to structure and interact with data in a database. Examples are given for how to use these commands to generate tables and insert, read, and select data from databases.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 28

DATABASE

SQL COMMANDS

Elizabeth Vinitha - ICT


What is a Database?

Elizabeth Vinitha - ICT


Elizabeth Vinitha - ICT
Elizabeth Vinitha - ICT
Example for a table

Elizabeth Vinitha - ICT


Elizabeth Vinitha - ICT
Elizabeth Vinitha - ICT
Elizabeth Vinitha - ICT
Elizabeth Vinitha - ICT
Elizabeth Vinitha - ICT
Elizabeth Vinitha - ICT
Commands

Elizabeth Vinitha - ICT


Datatypes

Elizabeth Vinitha - ICT


Basic syntax of CREATE TABLE statement

CREATE TABLE table_name( column1


datatype, column2 datatype, column3
datatype, ..... columnN datatype, PRIMARY
KEY( one or more columns ) );

Elizabeth Vinitha - ICT


EXAMPLE

Elizabeth Vinitha - ICT


Elizabeth Vinitha - ICT
www.sqlfiddle.com

Try from your home

Elizabeth Vinitha - ICT


Create Table login (
username varchar (20),
password varchar (20)
);

Elizabeth Vinitha - ICT


basic syntaxes of INSERT INTO statement

INSERT INTO TABLE_NAME (column1,


column2, column3,...columnN) VALUES
(value1, value2, value3,...valueN);

Here, column1, column2,...columnN are the names of the


columns in the table into which you want to insert data.

Elizabeth Vinitha - ICT


Elizabeth Vinitha - ICT
Elizabeth Vinitha - ICT
insert into login (username, password)
values(1, 'siva'),
(2, ' anu');

Elizabeth Vinitha - ICT


SELECT STATEMENT

Elizabeth Vinitha - ICT


select * from login;

Elizabeth Vinitha - ICT


Elizabeth Vinitha - ICT
Elizabeth Vinitha - ICT
Create a table called student
Fields/columns are ID, name, subject, mark

ID name subject mark


2 anu maths 90
5 manu science 68
6 tinu maths 89

Elizabeth Vinitha - ICT


ASSIGNMENT check you blog
DEADLINE for submission : 16 2- 2017

spgrade8.blogspot.ae

Elizabeth Vinitha - ICT

You might also like