What’s a database? Data stored in a structured format that lends itself to easy manipulation and recall.

Slides:



Advertisements
Similar presentations
NMED 3850 A Advanced Online Design February 25, 2010 V. Mahadevan.
Advertisements

CSE 190: Internet E-Commerce Lecture 10: Data Tier.
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.
30-Jun-15 SQL A Brief Introduction. SQL SQL is Structured Query Language Some people pronounce SQL as “sequel” Other people insist that only “ess-cue-ell”
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.
Database Management System LICT 3011 Eyad H. Elshami.
1ISM - © 2010 Houman Younessi Lecture 3 Convener: Houman Younessi Information Systems Spring 2011.
Structured Query Language SQL: An Introduction. SQL (Pronounced S.Q.L) The standard user and application program interface to a relational database is.
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.
A Guide to SQL, Eighth Edition Chapter Three Creating Tables.
Session 5: Working with MySQL iNET Academy Open Source Web Development.
Chapter 5 Introduction to SQL. Structured Query Language = the “programming language” for relational databases SQL is a nonprocedural language = the user.
Database Lecture # 1 By Ubaid Ullah.
LOGO 1 Lab_02: Basic SQL. 2 Outline  Database Tables  SQL Statements  Semicolon after SQL Statements?  SQL DML and DDL  SQL SELECT Statement  SQL.
PHP Programming with MySQL Slide 8-1 CHAPTER 8 Working with Databases and MySQL.
 SQL stands for Structured Query Language.  SQL lets you access and manipulate databases.  SQL is an ANSI (American National Standards Institute) standard.
Introduction to SQL Steve Perry
Web Services Week 8 Aims: –Using web services as front ends to databases Objectives: –Review of relational databases –Connecting to and querying databases.
Web Server Administration Chapter 7 Installing and Testing a Programming Environment.
Chapter 7 Working with Databases and MySQL PHP Programming with MySQL 2 nd Edition.
Chapter 7 Working with Databases and MySQL PHP Programming with MySQL 2 nd Edition.
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.
Introduction to MySQL Lab no. 10 Advance Database Management System.
Web Scripting [PHP] CIS166AE Wednesdays 6:00pm – 9:50pm Rob Loy.
CSC 2720 Building Web Applications Database and SQL.
NMED 3850 A Advanced Online Design January 12, 2010 V. Mahadevan.
Database and mySQL Week 07 Dynamic Web TCNJ Jean Chu.
CPS120: Introduction to Computer Science Lecture 19 Introduction to SQL.
Open Source Server Side Scripting ECA 236 Open Source Server Side Scripting MySQL – Selecting Data.
1 Structured Query Language (SQL). 2 Contents SQL – I SQL – II SQL – III SQL – IV.
SQL Basics. 5/27/2016Chapter 32 of 19 Naming SQL commands are NOT case sensitive SQL commands are NOT case sensitive But user identifier names ARE case.
Chapter 5 MYSQL Database. Introduction to MYSQL MySQL is the world's most popular open-source database. Open source means that the source code, the programming.
A Guide to MySQL 3. 2 Introduction  Structured Query Language (SQL): Popular and widely used language for retrieving and manipulating database data Developed.
SQL Structured Query Language 1. Data Definition Language (DDL) is used to manage table and define data structure i.e. CREATE, ALTER, DROP Data Control.
Web Server Administration Chapter 7 Installing and Testing a Programming Environment.
Database Fundamental & Design by A.Surasit Samaisut Copyrights : All Rights Reserved.
Visual Programing SQL Overview Section 1.
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,
Module Review Basic SQL commands: Create Database, Create Table, Insert and Select 2. Connect an SQL Database to PHP 3. Execute SQL Commands in.
>> Introduction to MySQL. Introduction Structured Query Language (SQL) – Standard Database Language – Manage Data in a DBMS (Database Management System)
Relational Databases and MySQL. Relational Databases Relational databases model data by storing rows and columns in tables. The power of the relational.
There are two types of MySQL instructions (Data Definition Language) DDL: Create database, create table, alter table,,,. (Data Manipulation Language) DML.
Distribution of Marks For Second Semester Internal Sessional Evaluation External Evaluation Assignment /Project QuizzesClass Attendance Mid-Term Test Total.
Working with MySQL A290/A590, Fall /07/2014.
Databases and SQL CSCI 201L Jeffrey Miller, Ph.D. HTTP :// WWW - SCF. USC. EDU /~ CSCI 201 USC CSCI 201L.
CS320 Web and Internet Programming SQL and MySQL Chengyu Sun California State University, Los Angeles.
MySQL Tutorial. Databases A database is a container that groups together a series of tables within a single structure Each database can contain 1 or more.
Programming for the Web MySQL Command Line Using PHP with MySQL Dónal Mulligan BSc MA
 MySQL  DDL ◦ Create ◦ Alter  DML ◦ Insert ◦ Select ◦ Update ◦ Delete  DDL(again) ◦ Drop ◦ Truncate.
Introduction to Databases & SQL Ahmet Sacan. What you’ll need Firefox, SQLite plugin Mirdb and Targetscan databases.
Open Source Server Side Scripting ECA 236 Open Source Server Side Scripting Intro to MySQL.
1 Section 1 - Introduction to SQL u SQL is an abbreviation for Structured Query Language. u It is generally pronounced “Sequel” u SQL is a unified language.
Introduction to Database Programming with Python Gary Stewart
Big Data Yuan Xue CS 292 Special topics on.
 MySQL is a database system used on the web  MySQL is a database system that runs on a server  MySQL is ideal for both small and large applications.
3 A Guide to MySQL.
Chapter 5 Introduction to SQL.
CS320 Web and Internet Programming SQL and MySQL
Open Source Server Side Scripting Permissions & Users
Chapter 8 Working with Databases and MySQL
Database.
CS1222 Using Relational Databases and SQL
PHP and MySQL.
CS3220 Web and Internet Programming SQL and MySQL
CS3220 Web and Internet Programming SQL and MySQL
Presentation transcript:

What’s a database? Data stored in a structured format that lends itself to easy manipulation and recall

Where it gets interesting… In a database, tables can be linked: Tables, columns, rows, “keys”, joins

What is SQL? A standard language for accessing databases SELECT P_id, FirstName, LastName, Age FROM tbl_people WHERE Age > 18 ORDER BY LastName An underlying language used by Relational Database Management System’s (RDBMS) such as MySQL, MS SQL Server, Oracle, Microsoft Access Note: SQL is NOT case senSiTive SQL Statement

Data types Describe type of data (text, numeric, date/time, binary) Depends on RDBMS Size matters! (for performance) See s.asp s.asp

Practice Time

Injecting Malicious Data submit query = “SELECT Username, UserID, Password FROM Users WHERE Username = 'bob‘; DROP Users-- ‘AND Password = ‘‘”

xkcd.com

Setting up database on your virtual server On the virtual server, log into mysql: []$ mysql –u root Now, you’re in mysql. Note the cursor. Create the database: > Create database mgbbase; Set it up for a particular user: > Grant all privileges on mgbbase.* to identified by ‘password’;

Working with a database []$ mysql –u mbailey –p mgbbase Now, at the > prompt, you can proceed to make new tables and manipulate data within them using ‘queries’

Setting up table create table assessment ( fullName varchar(20), idNum int not null primary key, year varchar(10), grade char(2), explaination text, graduates char(3), ta char(3), outtaHere char(3));

Other useful queries insert into table (column1, column2,…) values (value1, value2,…); select columns from table [where column = value]; update table set column=value [where column=value [and/or …]]; delete from table where column=value [and/or …]; Note that: ‘=‘ can be ‘ ’, etc, or can be LIKE, allowing wildcards

More queries Set password: update user set Password=password('NewPw') where User='root'; flush privileges; List tables: show tables; List fields in a table: show columns from xxx ;

Relational Database Terminology *Table=Relation; Column=Attribute; Row=Tuple Keys make tuples unique in relation SQL –Select (columns) from (tables) where (attribute value tests); –Returns a new table –Select * from person; Returns entire contents of table “person” –Select * from person where name=“Johnson” Returns a table with all columns and all rows with name==Johnson *Know these!