Presentation is loading. Please wait.

Presentation is loading. Please wait.

SQL Jan 20,2014. DBMS Stores data as records, tables etc. Accepts data and stores that data for later use Uses query languages for searching, sorting,

Similar presentations


Presentation on theme: "SQL Jan 20,2014. DBMS Stores data as records, tables etc. Accepts data and stores that data for later use Uses query languages for searching, sorting,"— Presentation transcript:

1 SQL Jan 20,2014

2 DBMS Stores data as records, tables etc. Accepts data and stores that data for later use Uses query languages for searching, sorting, reporting etc and help users to make sense of collected data Provides multiuser access to data, along with security features

3 DBMS ADVANTAGES Reduced updating errors Systematic storage of data Improved data access to users through use of query languages Improved data security Reduced data entry, storage, and retrieval costs Helps in development of new applications program

4 RDBMS Relational Database Management System RDBMS store the data into collection of tables, which might be related by common fields A RDBMS is a DBMS in which data is stored in the form of tables The relationship among the data is also stored in the form of tables.

5 Structured Query Language SQL stands for Structured Query Language. SQL is used to communicate with a database. It is the standard language for relational database management systems All SQL statements should end with a ";".

6 SQL statements are used to perform tasks like Creating new database and tables Deleting tables update data on a database retrieve data from a database etc. Structured Query Language

7 Examples Some common RDBMS that use SQL are: Oracle, Microsoft SQL Server, My SQL Access etc.

8 SQL can be divided into two parts: The Data Manipulation Language (DML) The Data Definition Language (DDL). Structured Query Language

9 Data Definition Language (DDL) The DDL part of SQL permits database tables to be created or deleted. defines indexes (keys), specify links between tables, imposes constraints between tables.

10 Data Manipulation Language (DML) The DML part of SQL permits Retrieving records. Updating records Adding new records, Deleting records etc.

11 DDL - CREATE TABLE used to create a new table SYNTAX CREATE TABLE "table_name" ("column 1" "data_type_for_column_1", "column 2" "data_type_for_column_2",... )

12 DDL - CREATE TABLE EXAMPLE CREATE TABLE customer (First_Name char(50), Last_Name char(50), Address char(50), City char(50), Country char(25), Birth_Date date, Amount number(6)) ; Create a table ‘customer’ with fields First_Name, Last_Name, Address, City, Country, Birth_date, amount

13 DML - Insert into used to insert a new row in a table Syntax: INSERT INTO "table_name" ("column1", "column2",...) VALUES ("value1", "value2",...)

14 DML - Insert into Example: INSERT INTO Customers (First_Name,Last_Name,Address,City, Country, Birth_Date,amount) VALUES(‘Roshan’,’Mathew’,’Palayam’,’Trivandrum’,’India’,’19- Jan-76’,2000);

15 Home Work Write SQL statement to create a table called ‘Friends_tb’ with fields Friend_name, Address, Phone, Email, Birthday Write Sql statements to Insert any two records


Download ppt "SQL Jan 20,2014. DBMS Stores data as records, tables etc. Accepts data and stores that data for later use Uses query languages for searching, sorting,"

Similar presentations


Ads by Google