Pertemuan ke 2 Tipe data & ERD Kurniawan Eka Permana.

Slides:



Advertisements
Similar presentations
VTYS 2012 Mehmet Emin KORKUSUZ Ders  Create  Alter  Drop Data Defination Language.
Advertisements

MySQL. To start go to Login details: login: labuser password:macimd15 – There.
SQL Pertemuan 26. Range Operator ‘Between dan Not Between’
Day 3 - Basics of MySQL What is MySQL What is MySQL How to make basic tables How to make basic tables Simple MySQL commands. Simple MySQL commands.
MySQL-Database Teppo Räisänen Oulu University of Applied Sciences School of Business and Information Management.
SLIDE 1IS 257 – Fall 2010 Physical Database Design and Referential Integrity University of California, Berkeley School of Information IS 257:
CIT 381 Data Types - data types - create table statement - constraints.
IMS1907 Database Systems Summer Semester 2004/2005 Lecture 9 Structured Query Language – SQL Data Definition Language - DDL.
Structured query language This is a presentation by JOSEPH ESTRada on the beauty of Structured Query Language.
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.
Creating Database Tables CS 320. Review: Levels of data models 1. Conceptual: describes WHAT data the system contains 2. Logical: describes HOW the database.
Kirkwood Center for Continuing Education By Fred McClurg, Introduction to PHP and MySQL Copyright © 2010 All Rights Reserved.
SQL Overview Defining a Schema CPSC 315 – Programming Studio Spring 2008 Project 1, Lecture 3 Slides adapted from those used by Jeffrey Ullman, via Jennifer.
Phonegap Bridge – File System CIS 136 Building Mobile Apps 1.
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 SQL  SQL or sequel  It is a standardised language with thousands of pages in the standard  It can be in database system through GUI,
DBMS 3. course. Reminder Data independence: logical and physical Concurrent processing – Transaction – Deadlock – Rollback – Logging ER Diagrams.
SQL Overview Defining a Schema CPSC 315 – Programming Studio Slides adapted from those used by Jeffrey Ullman, via Jennifer Welch Via Yoonsuck Choe.
Copyright © Curt Hill SQL The Data Definition Language.
MySQL. Introduction: MySQL is a DBMS (DataBase Management System) i.e. it is a databse software. MySQL is 5.0 can be downloaded from the website
Database Design lecture 3_1 1 Database Design Lecture 3_1 Data definition in SQL.
CS 3630 Database Design and Implementation. Your Oracle Account UserName is the same as your UWP username Followed Not case sensitive Initial.
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.
Ms. Hatoon Al-Sagri CCIS – IS Department SQL-99 :Schema Definition, Constraints, Queries, and Views 1.
Chapter 7 SQL HUANG XUEHUA. SQL SQL server2005 introduction Install components  management studio.
CHAPTER 8 Database: SQL, MySQL. Topics  Introduction  Relational Database Model  Relational Database Overview: Books.mdb Database  SQL (Structured.
Chapter 4 Introduction to MySQL. MySQL “the world’s most popular open-source database application” “commonly used with PHP”
CSC 2720 Building Web Applications Database and SQL.
SQL Data Definition Language (DDL) Using Microsoft SQL Server 1SDL Data Definition Language (DDL)
SQL SQL Server : Overview SQL : Overview Types of SQL Database : Creation Tables : Creation & Manipulation Data : Creation & Manipulation Data : Retrieving.
1 SQL Tarek El-Shishtawy Professor Ass. Of Computer Engineering.
SQL FUNDAMENTALS SQL ( Structured Query Language )
11 3 / 12 CHAPTER Databases MIS105 Lec15 Irfan Ahmed Ilyas.
SQL Fundamentals  SQL: Structured Query Language is a simple and powerful language used to create, access, and manipulate data and structure in the database.
SQL Basics. What is SQL? SQL stands for Structured Query Language. SQL lets you access and manipulate databases.
Advanced Database CS-426 Week 1 - Introduction. Database Management System DBMS contains information about a particular enterprise Collection of interrelated.
MySQL More… 1. More on SQL In MySQL, the Information Schema is the “Catalog” in the SQL standard SQL has three components: Data definition Data manipulation.
Advanced Web 2012 Lecture 3 Sean Costain What is a Database? Sean Costain 2012 A database is a structured way of dealing with structured information.
Prince Sultan University Dept. of Computer & Information Sciences CS 340 Introduction to Database Systems.
Fox MIS Spring 2011 Database Week 6 ERD and SQL Exercise.
Sql DDL queries CS 260 Database Systems.
Introduction to MySQL Lab no. 9 Advance Database Management System.
©Silberschatz, Korth and Sudarshan1 Structured Query Language (SQL) Data Definition Language Domains Integrity Constraints.
1 CS 430 Database Theory Winter 2005 Lecture 10: Introduction to SQL.
DBMS 3. course. Reminder Data independence: logical and physical Concurrent processing – Transaction – Deadlock – Rollback – Logging ER Diagrams.
1 CS 430 Database Theory Winter 2005 Lecture 11: SQL DDL.
1 © Prentice Hall, 2002 Chapter 7: SQL Modern Database Management 6 th Edition Jeffrey A. Hoffer, Mary B. Prescott, Fred R. McFadden.
Class 3Intro to Databases Class 4 Simple Example of a Database We’re going to build a simple example of a database, which will allow us to register users.
Relational Databases and MySQL. Relational Databases Relational databases model data by storing rows and columns in tables. The power of the relational.
Oracle & SQL. Oracle Data Types Character Data Types: Char(2) Varchar (20) Clob: large character string as long as 4GB Bolb and bfile: large amount of.
Introduction to Database SEM I, AY Department of Information Technology Salalah College of Technology Chapter No.3 SQL.
Lecture # 24 Introduction to SQL Muhammad Emran Database Systems.
LECTURE FOUR Introduction to SQL DDL with tables DML with tables.
Physical Model Lecture 11. Physical Data Model The last step is the physical design phase, In this phase data is – Store – Organized and – Access.
Relational Algebra and Calculus: Introduction to SQL
CS 3630 Database Design and Implementation
Managing Tables, Data Integrity, Constraints by Adrienne Watt
Understanding SQL Statements
MySQL-Database Jouni Juntunen Oulu University of Applied Sciences
لغة قواعد البيانات STRUCTURED QUERY LANGUAGE SQL))
Database systems Lecture 2 – Data Types
مقدمة في قواعد البيانات
Session - 6 Sequence - 1 SQL: The Structured Query Language:
MySQL Database System Installation Overview SQL summary
Kirkwood Center for Continuing Education
Session - 6 Sequence - 1 SQL: The Structured Query Language:
Database Instructor: Bei Kang.
SQL (Structured Query Language)
Presentation transcript:

Pertemuan ke 2 Tipe data & ERD Kurniawan Eka Permana

Basis Data Relational Struktur: – tabel, kolom, dan tipe data Integritas: – unicity contraints, primary keys – NOT NULL constraint – Foreign keys – Other constraints Manipulasi data: – retrieving information – inserting, updating, and deleting data

Structured Language Query (SQL) Terdiri dari: Data Definition Language (DDL): – CREATE tables, indexes, views, Establish primary / foreign keys, DROP / ALTER tables.... Etc Data Manipulation Language (DML): – INSERT / UPDATE / DELETE, SELECT.... etc. Data Control Language (DCL): – COMMIT / ROLLBACK work, GRANT / REVOKE.... etc

Statement Select

DML Klausa statemen SELECT: – FROM --> menentukan tabel(-tabel) sumber – WHERE --> memilih baris(-baris) yang memenuhi kondisi (-kondisi) – GROUP BY --> menggabungkan baris(-baris) yang kolomnya memiliki nilai yang sama – HAVING --> memilih grup yang memenuhi kondisi(-kondisi) – SELECT --> memilih kolom(-kolom) – ORDER BY --> mengurutkan baris-baris berdasarkan nilainilai yang ada dalam kolom(-kolom)

Contoh SELECT * FROM employee WHERE dno >1 GROUP BY superssn HAVING COUNT( * ) >1 ORDER BY salary

Hasil FROM WHERE

Hasil…..lanjutan ORDER BY GROUP BY HAVING

Data table EMPLOYEE Nama tabel Kolom Baris Nama kolom DEPARTMENT

Data table….lanjutan DEPENDENT DEPARTMENT LOCATIONPROJECT

Tipe data numeric BIT A bit-field, from 1 to 64 bits wide. (Prior to MySQL 5 BIT was functionally equivalent to TINYINT) BIGINT Integer value, supports numbers from to (or 0 to if UNSIGNED) BOOLEAN (or BOOL) Boolean flag, either 0 or 1, used primarily for on/off flags DECIMAL (or DEC) Floating point values with varying levels of precision DOUBLE Double-precision floating point values FLOAT Single-precision floating point values

Tipe data numeric….. lanjutan INT (or INTEGER) Integer value, supports numbers from to (or 0 to if UNSIGNED) MEDIUMINT Integer value, supports numbers from to (or 0 to if UNSIGNED) REAL 4-byte floating point values SMALLINT Integer value, supports numbers from to (or 0 to if UNSIGNED) TINYINT Integer value, supports numbers from -128 to 127 (or 0 to 255 if UNSIGNED)

Tipe data string CHAR Fixed-length string from 1 to 255 chars long. Its size must be specified at create time, or MySQL assumes CHAR(1) ENUM Accepts one of a predefined set of up to 64K strings LONGTEXT Same as TEXT, but with a maximum size of 4GB MEDIUMTEXT Same as TEXT, but with a maximum size of 16K SET Accepts zero or more of a predefined set of up to 64 strings

Tipe data string….. lanjutan TEXT Variable-length text with a maximum size of 64K TINYTEXT Same as TEXT, but with a maximum size of 255 bytes VARCHAR Same as CHAR, but stores just the text. The size is a maximum, not a minimum BLOB Blob with a maximum length of 64K MEDIUMBLOB Blob with a maximum length of 16MB LONGBLOB Blob with a maximum length of 4GB TINYBLOB Blob with a maximum length of 255 bytes

Tipe data tanggal DATE Date from to in the format YYYY-MM-DD TIME Time in the format HH:MM:SS YEAR A 2 or 4 digit year, 2 digit years support a range of 70 (1970) to 69 (2069), 4 digit years support a range of 1901 to 2155 DATETIME A combination of DATE and TIME TIMESTAMP Functionally equivalent to DATETIME (but with a smaller range)