Tables And SQL basics

Loading...

Flash Player 9 (or above) is needed to view presentations.
We have detected that you do not have it on your computer. To install it, go here.

2 comments

Comments 1 - 2 of 2 previous next Post a comment

Post a comment
Embed Video
Edit your comment Cancel

5 Favorites

Tables And SQL basics - Presentation Transcript

  1. TABLES AND SQL Controlling Tables Programmatically By: Amit Kumar Singh
  2. Tables
    • 2 Dimensional matrix
    • Unique name
  3. SQL
    • S tructured Q uery L anguage
    • ANSI standard computer language
    • Allows you to access a database
    • Execute queries, retrieve, insert, delete, update records
    • Freedom from intricacy & details of database softwares.
    • EASY TO LEARN
  4. Creating Tables
    • CREATE TABLE table_name
    • ( column_name1 data_type , column_name2 data_type , ....... ) ;
    • Example,
    • CREATE TABLE Person   (
    • LastName varchar(30), FirstName varchar, Address varchar, Age int(3)   ) ;
    • Create Table tbldemo
    • ( Name text(30),
    • Age integer,
    • Gender text(1)
    • );
    • Data type depends on the Database management software you are using
  5. SQL ALTER TABLE
    • ALTER TABLE table_name ADD COLUMN _name datatype
    • ALTER TABLE table_name DROP COLUMN column_name
    • Example,
    • ALTER TABLE tbldemo ADD COLUMN date_of_birth datetime
    • ALTER TABLE tbldemo DROP COLUMN marks;
  6. SQL INSERT
    • INSERT INTO table_name VALUES (value1, value2,....)
    • INSERT INTO table_name (column_name1,column_name2,...) VALUES (value1, value2,....)
    • Example,
    • INSERT INTO tbldemo VALUES ( 'Amit', 22, 'm', #8/22/1982#, 27474017 ) ;
    • INSERT INTO tbldemo ( Name, Age, Gender, date_of_birth )
    • VALUES ('Preeti', 22, 'f', #2/18/1982#);
  7. SQL SELECT
    • SELECT column_name(s) FROM table_name
    • SELECT * FROM table_name
    • SELECT * INTO new_table_name FROM original_table_name
    • SELECT column_name(s) FROM table_name WHERE condition
    • Example,
    • SELECT Name FROM tbldemo WHERE GENDER='f';
  8. SQL UPDATE
    • UPDATE table_name SET column_name=new_value [, column_name=new_value] WHERE column_name=some_value ;
    • Example,
    • UPDATE tbldemo SET phone_no = 22523250 WHERE name='ShriRam';
  9. SQL DELETE
    • DELETE FROM table_name WHERE condition
    • DELETE FROM table_name ( Note: Deletes the entire table!!)
    • Example,
    • DELETE FROM tbldemo WHERE Gender='f';
  10. SQL DROP TABLE
    • DROP TABLE table_name
    • Example,
    • DROP TABLE tbldemo;
  11. More SQL…
    • http://www.w3schools.com/sql/default.asp
    • http://w3.one.net/~jhoffman/sqltut.htm

+ teamphpteamphp, 3 years ago

custom

4319 views, 5 favs, 5 embeds more stats

it is very basic introduction to SQL statements, u more

More info about this document

© All Rights Reserved

Go to text version

  • Total Views 4319
    • 3622 on SlideShare
    • 697 from embeds
  • Comments 2
  • Favorites 5
  • Downloads 368
Most viewed embeds
  • 690 views on http://www.techbaba.com
  • 3 views on http://www.brijj.com
  • 2 views on http://www.classes4you.net
  • 1 views on http://209.85.175.132
  • 1 views on http://74.125.153.132

more

All embeds
  • 690 views on http://www.techbaba.com
  • 3 views on http://www.brijj.com
  • 2 views on http://www.classes4you.net
  • 1 views on http://209.85.175.132
  • 1 views on http://74.125.153.132

less

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate. If needed, use the feedback form to let us know more details.

Cancel
File a copyright complaint
Having problems? Go to our helpdesk?

Categories