CS 3630 Database Design and Implementation. Your Oracle Account UserName is the same as your UWP username Followed Not case sensitive Initial.

Slides:



Advertisements
Similar presentations
Let’s try Oracle. Accessing Oracle The Oracle system, like the SQL Server system, is client / server. For SQL Server, –the client is the Query Analyser.
Advertisements

1 A GUIDE TO ORACLE8 CHAPTER 2: Creating and ModifyingDatabaseTables 2.
1 Chapter 2: Creating and Modifying Database Tables.
A Guide to SQL, Seventh Edition. Objectives Understand the concepts and terminology associated with relational databases Create and run SQL commands in.
Creating Database Tables © Abdou Illia MIS Spring /21/2015.
Murali Mani SQL DDL and Oracle utilities. Murali Mani Datatypes in SQL INT (or) INTEGER FLOAT (or) REAL DECIMAL (n, m) CHAR (n) VARCHAR (n) DATE, TIME.
A Guide to MySQL 3. 2 Objectives Start MySQL and learn how to use the MySQL Reference Manual Create a database Change (activate) a database Create tables.
Structured Query Language. Brief History Developed in early 1970 for relational data model: –Structured English Query Language (SEQUEL) –Implemented with.
Database Management System LICT 3011 Eyad H. Elshami.
DAT702.  Standard Query Language  Ability to access and manipulate databases ◦ Retrieve data ◦ Insert, delete, update records ◦ Create and set permissions.
DATABASES AND SQL. Introduction Relation: Relation means table(data is arranged in rows and columns) Domain : A domain is a pool of values appearing in.
Your Oracle Account UserName is the same as your UWP username Followed Not case sensitive Initial Password: UWPstudent Password is case sensitive.
Introduction To Databases IDIA 618 Fall 2014 Bridget M. Blodgett.
Introduction to SQL  SQL or sequel  It is a standardised language with thousands of pages in the standard  It can be in database system through GUI,
Oracle Data Definition Language (DDL)
Copyright © Curt Hill SQL The Data Definition Language.
A Guide to SQL, Eighth Edition Chapter Three Creating Tables.
Chapter 5 Introduction to SQL. Structured Query Language = the “programming language” for relational databases SQL is a nonprocedural language = the user.
Structured Query Language. Brief History Developed in early 1970 for relational data model: –Structured English Query Language (SEQUEL) –Implemented with.
CHAPTER:14 Simple Queries in SQL Prepared By Prepared By : VINAY ALEXANDER ( विनय अलेक्सजेंड़र ) PGT(CS),KV JHAGRAKHAND.
Chapter 8 Part 1 SQL-99 Schema Definition, Constraints, Queries, and Views.
CSC 2720 Building Web Applications Database and SQL.
Oracle Data Definition Language (DDL) Dr. Bernard Chen Ph.D. University of Central Arkansas Fall 2008.
SQL SQL Server : Overview SQL : Overview Types of SQL Database : Creation Tables : Creation & Manipulation Data : Creation & Manipulation Data : Retrieving.
Chapter 5: Part 1: DDL STRUCTURED QUERY LANGUAGE (SQL)
1 Structured Query Language (SQL). 2 Contents SQL – I SQL – II SQL – III SQL – IV.
1 Creating and Modifying Database Objects. 2 An Oracle database consists of multiple user accounts Each user account owns database objects Tables Views.
11 3 / 12 CHAPTER Databases MIS105 Lec15 Irfan Ahmed Ilyas.
CS 3630 Database Design and Implementation. Assignment 3 Style! Agreement between database designer and the client. UserName1_EasyDrive UserName2_EasyDrive.
Creating Tables and Inserting Records -- Not easy to edit! -- check constraints! Create table test1 ( C1 char(5) primary key, C2 Varchar2(15) not null.
Topic 1: Introduction to SQL. SQL stands for Structured Query Language. SQL is a standard computer language for accessing and manipulating databases SQL.
A Guide to MySQL 3. 2 Introduction  Structured Query Language (SQL): Popular and widely used language for retrieving and manipulating database data Developed.
Features of SQL SQL is an English-like language . It uses words such as select , insert , delete as part of its commend set. SQL is an a non-procedural.
SQL Fundamentals  SQL: Structured Query Language is a simple and powerful language used to create, access, and manipulate data and structure in the database.
CS 3630 Database Design and Implementation. Database Schema Branch (Bno…) Staff (Sno…Bno) Owner (Ono…) PropertyForRent (Pno…Ono) Renter (Rno…) Viewing.
Database Lab Lecture 1. Database Languages Data definition language ( DDL ) Data definition language –defines data types and the relationships among them.
Prince Sultan University Dept. of Computer & Information Sciences CS 340 Introduction to Database Systems.
SQL: Part 1 Original materials supplied by the Oracle Academic Initiative (OAI). Edited for classroom use by Professor Laku Chidambaram. Not for commercial.
Database Fundamental & Design by A.Surasit Samaisut Copyrights : All Rights Reserved.
# 1# 1 Creating Tables, Setting Constraints, and Datatypes What is a constraint and why do we use it? What is a datatype? What does CHAR mean? CS 105.
Visual Programing SQL Overview Section 1.
Data types  CHAR (size): This data type is used to store character strings values of fixed length. The size in brackets determines the number of characters.
1 Chapter 2: Creating and Modifying Database Objects.
Sql DDL queries CS 260 Database Systems.
Week 8-9 SQL-1. SQL Components: DDL, DCL, & DML SQL is a very large and powerful language, but every type of SQL statement falls within one of three main.
©Silberschatz, Korth and Sudarshan1 Structured Query Language (SQL) Data Definition Language Domains Integrity Constraints.
ITS232 Introduction To Database Management Systems Siti Nurbaya Ismail Faculty of Computer Science & Mathematics, Universiti Teknologi MARA (UiTM), Kedah.
Relational Database Management System(RDBMS) Structured Query Language(SQL)
Distribution of Marks For Second Semester Internal Sessional Evaluation External Evaluation Assignment /Project QuizzesClass Attendance Mid-Term Test Total.
Starting with Oracle SQL Plus. Today in the lab… Connect to SQL Plus – your schema. Set up two tables. Find the tables in the catalog. Insert four rows.
Basic SQL*Plus edit and execute commands SQL*Plus buffer and built-in editor holds the last SQL statement Statements are created in free-flow style and.
CS242 SQL. What is SQL? SQL:  stands for Structured Query Language  allows you to access a database  is an ANSI standard computer language  can execute.
3 A Guide to MySQL.
CS 3630 Database Design and Implementation
Chapter 5 Introduction to SQL.
CS320 Web and Internet Programming SQL and MySQL
Managing Tables, Data Integrity, Constraints by Adrienne Watt
CS 3630 Database Design and Implementation
ORACLE SQL Developer & SQLPLUS Statements
DATABASE MANAGEMENT SYSTEM
STRUCTURED QUERY LANGUAGE
Oracle Data Definition Language (DDL)
SQL-1 Week 8-9.
Session - 6 Sequence - 1 SQL: The Structured Query Language:
Chapter 2: Creating And Modifying Database Tables
CS3220 Web and Internet Programming SQL and MySQL
Chapter # 7 Introduction to Structured Query Language (SQL) Part I.
CS3220 Web and Internet Programming SQL and MySQL
Introduction to Oracle
SQL (Structured Query Language)
Presentation transcript:

CS 3630 Database Design and Implementation

Your Oracle Account UserName is the same as your UWP username Followed Not case sensitive Initial Password: UWPUserName1 (all lower case) Example: yangq1 Password is case sensitive Reset password to HelpDesk at from your UWP account if you forget your new password 2

Oracle Client SQL*Plus SQL*Plus Oracle All labs in Ullrich Hall Not available from home or any other lab on campus 3

Structured Query Language (SQL) One language for Relational Databases ANSI Standard Oracle: SQL*Plus MS SQL Server: Transact-SQL IBM DB2 MySQL Sybase... 4

Structured Query Language (SQL) Case insensitive (like VB) Free style (like C++ and Java) Statement terminator – semicolon (like C++ and Java) Programming Rule: Style Each clause of a query on a separate line When creating tables Each field on a separate line Each table constraint on a separate line 5

Structured Query Language (SQL) DDL (Data Definition Language) Create Table (user)... Drop Table (user)... Alter Table (user)... DML (Data Manipulation language) Select * From Branch … Insert into Branch... Update branch... Delete from BRANCH... 6

Change Your Oracle Password inside Oracle -- Oracle Command Prompt SQL> -- Change your password -- Remember your new password! SQL> Alter User yourUserName identified by newPassword; -- Every ANSI SQL standard command ends with ; 7

Oracle Data Types Char(size) fixed length string up to 2000 bytes default is 1 byte blanks are padded on right when fewer chars entered Varchar2(size) variable size string up to 2000 bytes must specify the limit (size) Varchar(size) same as Varchar2(size) better to use Varchar2 8

Oracle Data Types Integer, int, smallint Float Date Valid dates from 1-Jan-4712 B.C. to 31-Dec-4712 A.D. Default format: DD-MON-YY 23-Mar-09 Including time 9

Oracle Data Types Number(l, d) l: length (total) d: decimal digits number (5, 2): largest value is Decimal(l, d), Numeric(l, d) same as number(l, d) SQL standard blob: binary large object, up to 4 GB clob: character large object, up to 4 GB raw(size): raw binary data, up to 2000 bytes... 10

Create a Table SQL> Create Table Test1 ( C1 char(5) Primary Key, C2 Varchar2(50), C3 Integer, C4 Date); 11

Show Table Schema SQL> Describe Test1 Or SQL> Desc Test1 Describe is a SQL*Plus command and no semicolon is required. 12

Insert Records Insert into Test1 Values (‘cs363', ‘s1', 44, ‘28-feb-12’); Insert into Test1 Values (‘cs334', ‘s2', 45, ‘29-feb-12’); One record at a time! Single quotes for string Date is entered as string in the default format 13

Retrieve Records Select * From test1; -- Each clause on a separate line Select * From Test1; -- to start a comment line 14

Entity Integrity Insert into Test1 Values (‘cs363', ‘q2', 17, ‘2-Mar-12’); PK must be Unique! 15

Null Values Insert into Test1 Values (‘cs387', ‘q2', 17, null); Null is a key word, not a string! NULL, null and Null are the same SQL is not case sensitive 16

Entity Integrity Insert into Test1 Values (null, ‘q2', 17, ‘2-Mar-12’); PK cannot be null! 17

Command Commit DDL commands are sent back to server and executed there DML commands are executed at client site Use commit to send results back to server 18

Update Records Update test1 Set c3 = 50 Where c1 = ‘cs363’; -- Each clause on a separate line 19

Delete Records Delete from test1 Where c1 = ‘cs363’; -- select to check Delete from test1; -- select to check -- desc to check 20

Drop Table Drop table test1; Desc test1 -- to check ERROR: ORA-04043: object test1 does not exist 21

Log out SQL> exit 22

Remember Your Password! 23

Quiz2 Any Questions? 24

Assignment62 Any Questions? 25