0% found this document useful (0 votes)
3 views20 pages

DBMS_UNIT-02(1)

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)
3 views20 pages

DBMS_UNIT-02(1)

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/ 20

RELATIONAL DATA MODEL

UNIT 2
INTRODUCTION TO SQL

SQL or Structured Query Language is a programming language that is used


to communicate and manipulate databases.
• Raymond Boyce and Donald Chamberlin using E F CODD RULES(12 rules) developed database
called system R FOR banks using sql programming language
• in the 1970s by IBM researchers .
• later called it ORACLE in 1979.
• Sql is best programing language by ANSI AND ISO.

Many companies use a database management system that has SQL already built in to it.
Developed and distributed by Oracle company ie MySQL
MYSQL is one of the most popular SQL database management systems currently available. The
software is an open source version, which means it can be downloaded and used for free.

Currently, many of the world's largest and most well-known brands rely on MySQL to make their
websites function properly, including Facebook, Google, Adobe, Alcatel Lucent and Zappos.
• A website that uses MySQL may include Web pages
that access information from a database,
DATA TYPES IN SQL
.

MySQL supports all standard SQL numeric data types.

1. These types include the exact numeric data types


(INTEGER, SMALLINT, DECIMAL, and NUMERIC),
as well as the approximate numeric data types (FLOAT, REAL, and DOUBLE PRECISION).

2.Date data types

CREATE TABLE t1 (t TIME(3), dt DATETIME(6), ts TIMESTAMP(0));

3. String Data Type Syntax


The string data types are CHAR, VARCHAR, BLOB, TEXT, ENUM.
CREATE TABLE t
(
c1 VARCHAR(20),
c2 blob
);

CREATE TABLE t
(
c1 VARBINARY(10),
c2 BLOB,
c3 ENUM('a','b','c') CHARACTER SET binary
);
Relational Model
Stud_id Stud_Name DOB

101 Prajakta 01/2/2001

Table
102 Rakesh 13/4/1999

103 Rahul 17/3/1990


• IN DATABASE
• Data is organized in row and column form.
• The rows are called Tuple or Record.
• Each attribute have data types
(integer, char, varchar, float,date,time).
Eg i) personid integer
ii) joindate date
iii) pname varchar
• the columns(personid, joindate,pname) are
often called Domain or Attribute.
What does the table/relation contain
• Each row is known as a tuple.
• Attribute: It contains the name of a column in a particular table
• Domain: Columns.
• Relation- Table with rows and columns
PERSONID JOINDATE PNAME

90 12/5/2001 DAVID

102 15/6/2000 JOHN

55 6/5/2000 PETER

PERSONID
JOINDATE
PNAME
Domain /Columns
Components of SQL
SQL commands are divided into five categories:
DATA DEFINITION LANGUAGE
The Data Definition Language (DDL) consist of SQL statements used to define the database structure or schema.
DATA MANIPULATION LANGUAGE
A Data Manipulation Language (DML) is a computer programming language used for adding (inserting),
removing (deleting), and modifying (updating) data in a database.
DATA CONTROL LANGUAGE
A Data Control Language (DCL) is a programming language used to control the access of data stored in a
database.

It is used for controlling privileges in the database


Thank YOU

You might also like