You are on page 1of 22

WEEK-1A

WELCOME TO DBMS
• DATABASE MANAGEMENT SYSTEM

INSTRUCTOR : KENAN ÇETİNKAYA


What is Database ?
• A database is a collection of information
that is organized so that it can easily be
accessed, managed, and updated. In one
view, databases can be classified
according to types of content:
bibliographic, full-text, numeric, and
images.

•You can think of a database as an


electronic filing system.
• Traditional databases are organized by fields
, records, and files.
• A field is a single piece of information;
• A record is one complete set of fields;
• A file is a collection of records.

• For example, a telephone book is


analogous to a file. It contains a list of
records, each of which consists of three
fields: name, address, and telephone
number.
TABLE ?
• A table is a set of data elements (values)
that is organized using a model of
horizontal rows and vertical columns
ID CLASS NAME AGE GENDER
1 6A YERLAN 15 MALE
2 6A ASEL 15 FEMALE

How
How many
many fields areare
there in the table “student”
3
records
6A AYGERIM
there in the
16
table
FEMALE
4 6A KANAT 14 “student”
MALE
5 6A JANDOS 15 MALE
6 7A JANAR 16 MALE
7 7A MARAT 16 MALE
8 7A BAURJAN 17 MALE
9 7A AYGUL 16 FEMALE
10 7A ALIYA 16 FEMALE
11 7A NURGUL 16 FEMALE
12 8A ASEL 18 FEMALE
13 8A SANJAR 19 MALE
14 8A ALIBEK 18 MALE
15 8A JANAR 19 FEMALE
Each column holds data of a particular type
-Integer
-String
-Decimal
-Date

•If a column in a row contains no data, it is


NULL.
•It can indicate no possible value or
unavailable data.
VARCHAR2
NUMBER

ID CLASS NAME AGE GENDER


1 6A YERLAN 15 MALE
2 6A ASEL 15 FEMALE
3 6A AYGERIM 16 FEMALE
4 6A KANAT 14 MALE
5 6A JANDOS 15 MALE
6 7A JANAR 16 MALE
7 7A MARAT 16 MALE
8 7A BAURJAN 17 MALE
9 7A AYGUL 16 FEMALE
10 7A ALIYA 16 FEMALE
11 7A NURGUL 16 FEMALE
12 8A ASEL 18 FEMALE
13 8A SANJAR 19 MALE
14 8A ALIBEK 18 MALE
15 8A JANAR 19 FEMALE
Introduction

SQL is the Structured Query Language

It is used to interact with the DBMS

SQL Commands are used to organize database.


USING SQL*PLUS
• SQL*PLUS is a small program that you allow to
connect to oracle database.

•Start / Run
Install <<Oracle 10g>> on your notebook
1-Open my intranet site
2-Download 10201_database_win32.zip
3-Unzip and run Setup
SQL Basics

•Basic SQL statements include


–CREATE –a data structure
–SELECT –read one or more rows from
a table
–INSERT –one of more rows into a table
–DELETE –one or more rows from a
table
–UPDATE –change the column values in
a row
–DROP –a data structure
•In this lecture the focus is on SELECT.
SELECT

SELECT column FROM tablename

SELECT column1,column2,column3
FROM tablename

SELECT * FROM tablename

EXAMPLE :
SELECT * FROM STUDENT;
SELECT name,age FROM STUDENT;
How can you see all tables in a current
database?

SELECT * FROM TAB


How can you see all records in
a table “STUDENT”?

SELECT * FROM student

* Means “all fields (columns)


How can you see the names and ages of all
students in a table “STUDENT” ?

SELECT name,age
FROM student
How do you know the data types of all fields in
table “STUDENT” ?

DESC student
How do you see the records as sorted by age
in ascending order?

SELECT * FROM STUDENT


ORDER BY AGE
How do you see the records as sorted by age
in descending order?

SELECT * FROM STUDENT


ORDER BY AGE DESC
• NOW, IT IS YOUR TURN
TASKS

1-Connect to the database as SCOTT, in command prompt.


2-Connect to the database as SCOTT, in graphic windows.
3-Connect to the database as SCOTT, in web interface from intranet.
4-Connect to the database as SCOTT, in web interface from internet.
5-List all tables from the current database.
6-List all records from EMP table.
7-List all student name from EMP table.
8-List all rows from EMP table in Ascending order.
9-List all rows from EMP table in Descending order.
10-Copy Oracle 10g and install on your notebook( OS :windows XP )

You might also like