Working with Derby. RHS – 2009 2 Creating tables We know how to create a database in Derby – an empty database Next step is to add tables to the database.

Slides:



Advertisements
Similar presentations
How to Create a Local Collection
Advertisements

Build a database I: Design tables for a new Access database
Quick-and-dirty.  Commands end in a semi-colon ◦ If you forget, another prompt line shows up  Either continue the command or…  End it with a semi-colon.
Maintenance Modifying the data –Add records –Delete records –Update records Modifying the design –Add fields into tables –Remove fields from a table –Change.
ISP 121 Week 1 Introduction to Databases. ISP 121, Winter Why a database and not a spreadsheet? You have too many separate files or too much data.
SQL Data Definition II Stanislava Armstrong 1SQL Data Definition II.
Introduction to Databases CIS 5.2. Where would you find info about yourself stored in a computer? College Physician’s office Library Grocery Store Dentist’s.
Creating a Blank Database 1. Open up Microsoft Access 2. Click on Blank document button 3. On the right panel, Specify the location for saving your database.
DT211 Stage 2 Databases Lab 1. Get to know SQL Server SQL server has 2 parts: –A client, running on your machine, in the lab. You access the database.
Chapter Extension 6 Using Microsoft Access © 2008 Pearson Prentice Hall, Experiencing MIS, David Kroenke.
Tables. Any database must contain one or more tables, because that’s where the data is stored. For any table there are two views provided: Datasheet view.
Database Design.  Define a table for each entity  Give the table the same name as the entity  Make the primary key the same as the identifier of the.
DAY 21: MICROSOFT ACCESS – CHAPTER 5 MICROSOFT ACCESS – CHAPTER 6 MICROSOFT ACCESS – CHAPTER 7 Akhila Kondai October 30, 2013.
BSC Food Distribution 8181 NW 36 Street, Suite 14-D Doral, FL Phone: Fax:
Advanced Tables Lesson 9. Objectives Creating a Custom Table When a table template doesn’t suit your needs, you can create a custom table in Design view.
1 Microsoft Access 2002 Tutorial 5 – Enhancing a Table’s Design, and Creating Advanced Queries and Custom Forms.
Database Applications – Microsoft Access Lesson 2 Modifying a Table and Creating a Form 45 slides in presentation Accessibility check 9/14.
CSCI 6962: Server-side Design and Programming
Chapter 5 Introduction to SQL. Structured Query Language = the “programming language” for relational databases SQL is a nonprocedural language = the user.
ACCESS. » Access is a database management system. » This system lets you create and process data. » A database is a collection of data that is organized.
LSP 121 Week 1 Intro to Databases. Welcome to LSP 121 Quantitative Reasoning and Technological Literacy II Continuation of quantitative data concepts.
Create Database Tables
DAY 15: ACCESS CHAPTER 2 Larry Reaves October 7,
Mail merge letters are used to send the same or similar documents to many different people. Since they contain the recipient’s name, address, and other.
Data-mining & Data As we used Excel that has capability to analyze data to find important information, the data-mining helps us to extract information.
Viewing Tip: While viewing this presentation in your browser, select Browse, Full Screen. Then, when you want to pause the show, Right Click and select.
PHP meets MySQL.
Microsoft Access 2003 Define some key Access terminology: Field – A single characteristic or attribute of a person, place, object, event, or idea. Record.
Create Forms Lesson 5. Objectives Software Orientation The Forms group (below) is located on the Create tab in the Ribbon and can be used to create a.
Chapter 17 Creating a Database.
DATABASE EVIDENCE Zosia Staniaszek. FIELD NAMES AND DATA TYPES I switched to design view to enter the field names and change the data types. I entered.
Introduction to Derby. RHS – What is Derby…? Derby is a DBMS –Database –GUI for administration –GUI for data maintenance Best part; integrated.
M1G Introduction to Database Development 2. Creating a Database.
Stored Procedure. Objective At the end of the session you will be able to know :  What are Stored Procedures?  Create a Stored Procedure  Execute a.
IE 423 – Design of Decision Support Systems Database development – Building Tables
A Skills Approach Access 2010 Working with Tables © 2012 The McGraw-Hill Companies, Inc. All rights reserved Chapter 2.
Access Forms and Queries. Entering Data in Your Table  You can add data to your table in Datasheet view, by typing in the columns and rows.  This.
Database Applications – Microsoft Access Lesson 4 Working with Queries 36 Slides in Presentation.
Using Microsoft Access Now that data has been entered we are ready to sort or data To do this, first click on the field label which you want to sort If.
Database Copyright 2006 South-Western/Thomson Learning.
# 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.
Microsoft Access 4 Database Creation and Management.
CSC 240 (Blum)1 Introduction to Access CSC 240 (Blum)2 Click on the Access desktop icon or go to Start/Programs/Microsoft Office/Microsoft Office.
Databases 101 © Dolinski What you will learn How relational databases work What are the components that make up a database How to create each component.
CSC 240 (Blum)1 Introduction to Access CSC 240 (Blum)2 Click on the Access desktop icon or go to Start/All Programs/Microsoft Office/Microsoft Office.
Lesson 4.  After a table has been created, you may need to modify it. You can make many changes to a table—or other database object—using its property.
Mr C Johnston ICT Teacher
Task #1 Create a relational database on computers in computer classroom 308, using MySQL server and any client. Create the same database, using MS Access.
Chapter 9 Vocabulary Databases. 1.Table – a collection of information, or data arranged in columns and rows. 2.Record – all of the information about one.
Understand Primary, Foreign, and Composite Keys Database Administration Fundamentals LESSON 4.2.
1 MySQL and SQL. 2 Topics  Introducing Relational Databases  Terminology  Managing Databases MySQL and SQL.
Classwork: Common Errors Primary keys: don’t forget them! Primary keys: choose the best one! – “Name” and “birthday” are not the best choices. – “Phone.
CS 111 – Nov. 8 Databases Database Management Systems (DBMS) Structured Query Language (SQL) Commitment –Please review sections 9.1 – 9.2.
Connecting (relating) Data Tables to get Custom Records (Queries) Database Basics.
Key Applications Module Lesson 22 — Managing and Reporting Database Information Computer Literacy BASICS.
Lecture Access – Queries. What’s a Query? A question you ask a database –ie: “Who are my Stockton customers?” –ie: “How much did Bob sell on the 14th?”
Introduction to MySQL Ullman Chapter 4. Introduction MySQL most popular open-source database application Is commonly used with PHP We will learn basics.
Fall Lab 131 CS105 Lab 13 – Logical Operator Precedence and Joining Tables Announcements: MP 3 released Friday, 11/20 Honors project due: Tuesday,
Working with MySQL. SWC – Creating tables We know how to create a database in MySQL – an empty database Next step is to add tables to the database.
1 CPE 332 Introduction DBMS: Relational Database Managment Systems Instructor:Suthep Madarasmi, Ph.D. ดร. สุเทพ มาดารัศมี
MICROSOFT ACCESS – CHAPTER 5 MICROSOFT ACCESS – CHAPTER 6 MICROSOFT ACCESS – CHAPTER 7 Sravanthi Lakkimsety Mar 14,2016.
Database (Microsoft Access). Database A database is an organized collection of related data about a specific topic or purpose. Examples of databases include:
Lec-7. The IN Operator The IN operator allows you to specify multiple values in a WHERE clause. SQL IN Syntax SELECT column_name(s) FROM table_name WHERE.
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.
Copyright © 2014 Pearson Canada Inc. Ext. 5b-1 Copyright © 2014 Pearson Canada Inc. Application Extension 5b Using Microsoft Access Part 2: Using Information.
Chapter 5 Introduction to SQL.
MySQL - Creating donorof database offline
Introduction to Access 2003
Creating and Modifying Queries
PHPMyAdmin.
Presentation transcript:

Working with Derby

RHS – Creating tables We know how to create a database in Derby – an empty database Next step is to add tables to the database After adding tables, we can enter data into the tables Remember; design your tables BEFORE using Derby to enter them

RHS – Creating tables Before using a database, we must connect to it Right-click on database, and choose ”Connect”

RHS – Creating tables Enter whatever we chose when crea- ting the database (hopefully just blanks…)

RHS – Creating tables Now we can access the tables in the database – but there are none yet

RHS – Creating tables Right-click on ”Tables”, and choose ”Create table”

RHS – Creating tables

RHS – Creating tables Recall what we need in order to define a table –A proper name for the table –A set of field definitions – a name and a type for each field –A key field – one or more fields the combination of which is always unique

RHS – Creating tables Enter a proper name for the table

RHS – Creating tables For each data field (also called column), we must add quite a lot of information: –Column name: Name of the data field –Key: Is the field part of the key field –Index: Leave as-is… –Null: Can we omit the value –Unique: Must the value be unique –Data type: Proper type of data –Size: How large can the data be

RHS – Creating tables Example: a Name field –Column name: Name –Key: Yes –Null: No –Unique: (decided by choosing ”Key”) –Data type: VARCHAR (means ”String”) –Size: 50 (how long can a name be…?)

RHS – Creating tables Example: a Phone field –Column name: Phone –Key: Yes –Null: No –Unique: (decided by choosing ”Key”) –Data type: NUMERIC (number) –Size: 8 (a Danish phone number)

RHS – Creating tables

RHS – Creating tables A database called Phone Book A table called Friend Two data fields: Name, Phone Red indicates that field is part of key field

RHS – Creating tables We can add more data fields later Right-click on the table, choose ”Add Column…”

RHS – Creating tables Same as before, but different dialog…

RHS – Creating tables Exercise –Create a database called WebShop in Derby –Create three tables in WebShop, called Item, Customer, Sale –Definitions of the tables are given below (key fields are in red) Item ItemNumber ItemName Price Weight NumberInStock IsFragile Description Customer CustomerNumber Name Address ZipCode ClubMember LastSale Sale CustomerNumber ItemNumber Date NumberOfItems TotalAmount SentToCustomer PaymentReceived

RHS – Adding data With the table defini- tion in place, we can now begin to add data to the table Right-click on the table, choose ”View Data…”

RHS – Adding data Data in the table is shown here (none yet….)

RHS – Adding data Press this icon to add new data

RHS – Adding data Type in data for this particular record

RHS – Adding data

RHS – Adding data Table now con- tains one record

RHS – Adding data And so on, and so on…

RHS – Adding data What can go wrong…? We might try to type in some data, that does not match the type specification for a particular field Derby will complain…

RHS – Adding data What is wrong here…?

RHS – Adding data

RHS – Adding data The error messages can be more or less easy to understand… It is almost always a matter of trying to enter data of the wrong type Might also be data of incorrect size Some errors are more subtle, like a wrong date ( )

RHS – Adding data What is this…? An SQL query!

RHS – Adding data Exercise –Add a few records to the tables created in the earlier exercise. Try to experiment with the data, such that you also try to add some data with errors. Observe the errors messages that Derby returns when data has errors –Do you now feel comfortable working with Derby, with regards to creating databases, tables and fields, and entering data into tables? If not, then try to invent some more tables, enter them into a database, and enter some data into the tables