chapter03 - Concepts of Database Management Fifth Edition...

Info icon This preview shows pages 1–11. Sign up to view the full content.

View Full Document Right Arrow Icon
Concepts of Database  Concepts of Database  Management, Fifth Edition Management, Fifth Edition Chapter 3:  Chapter 3:  The Relational Model 2: SQL The Relational Model 2: SQL
Image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
2 3 Objectives Introduce the structured query language (SQL) Use simple and compound conditions in SQL Use computed fields in SQL Use built-in SQL functions Use subqueries in SQL Group records in SQL
Image of page 2
3 3 Objectives (Con’t) Join tables using SQL Perform union operations in SQL Use SQL to update database data Use an SQL query to create a table in a database
Image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
4 3 SQL (Structured Query Language) Provides users with the capability to query a relational database Must enter commands to obtain desired results Developed under the name SEQUEL at IBM
Image of page 4
5 3 Table Creation SQL CREATE TABLE Used to describe layout of a table Typical restrictions placed by DBMS Names cannot exceed 18 characters Names must start with a letter Names can contain only letters, numbers, and underscores (_) Names cannot contain spaces
Image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
6 3 Typical Data Types INTEGER Numbers without a decimal point SMALLINT Uses less space than INTEGER DECIMAL(p,q) P number of digits; q number of decimal places CHAR(n) Character string n places long DATE Dates in DD-MON-YYYY or MM/DD/YYYY
Image of page 6
7 3 Simple Retrieval SELECT-FROM-WHERE-- basic form of SQL retrieval command SELECT clause – lists fields that you wish to display FROM clause – lists table or tables that contain data to display in query results WHERE clause – optional section used to list any conditions to be applied to the data to retrieve
Image of page 7

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
8 3 Figures 3.1-3.2: Simple Retrieval
Image of page 8
9 3 Figures 3.3-3.4: SQL Query to List Part Table
Image of page 9

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
10 3 Figures 3.5-3.6: SQL Query with Where Condition
Image of page 10
Image of page 11
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern