Start your free trial now, and begin learning software, business and creative skills—anytime, anywhere—with video instruction from recognized industry experts.

Start Your Free Trial Now

Understanding databases and tables in SQLite


From:

SQLite 3 with PHP Essential Training

with Bill Weinman

Video: Understanding databases and tables in SQLite

SQLite is different than other database management systems in two significant ways. First, SQLite is a database management system in a driver, and two, SQLite stores an entire database in one file. So SQLite itself, the code base that comprises the database management system, lives inside your application as a driver. So when it needs to access its database, which is contained in a file, SQLite must first go through the application, and then the application accesses the file.
Expand all | Collapse all
  1. 5m 44s
    1. Welcome
      1m 26s
    2. What is SQLite and what are the prerequisites?
      1m 49s
    3. Using the exercise files
      2m 29s
  2. 41m 36s
    1. Getting the most out of the quick start
      4m 8s
    2. Creating and using a database
      10m 33s
    3. Inserting data into a table
      8m 17s
    4. Getting data from a table
      4m 38s
    5. Updating data in a table
      4m 31s
    6. Deleting data from a table
      4m 12s
    7. Creating a database library
      5m 17s
  3. 39m 19s
    1. Installing XAMPP on a Mac
      5m 59s
    2. Installing XAMPP on a PC
      4m 45s
    3. Setting up SID and exercise files on a Mac
      9m 10s
    4. Setting up SID and exercise files on a PC
      8m 12s
    5. Using the command-line tools
      11m 13s
  4. 30m 44s
    1. Understanding databases and tables in SQLite
      2m 34s
    2. Creating a database
      5m 45s
    3. Setting permissions for a database
      5m 24s
    4. Defining a table in SQL
      2m 21s
    5. Creating a table in PHP
      3m 34s
    6. Creating indexes
      4m 38s
    7. Indexing ID fields
      6m 28s
  5. 36m 35s
    1. Taking care with data types in SQLite
      9m 33s
    2. Storing numbers with INTEGER
      5m 17s
    3. Storing numbers with REAL
      2m 15s
    4. Storing text
      3m 15s
    5. Storing large data with BLOB
      9m 31s
    6. Storing booleans
      2m 24s
    7. Storing dates and times
      4m 20s
  6. 22m 47s
    1. Storing data with INSERT
      4m 1s
    2. Updating data with UPDATE
      3m 12s
    3. Reading data with SELECT
      6m 14s
    4. Reading data from multiple tables with JOIN
      5m 29s
    5. Deleting data with DELETE
      3m 51s
  7. 24m 45s
    1. Understanding expressions in SQLite
      2m 31s
    2. Comparing values with comparison operators
      4m 36s
    3. Matching patterns with LIKE
      4m 28s
    4. Building simple math with arithmetic operators
      3m 13s
    5. Matching values in a list with IN
      2m 22s
    6. Choosing from multiple conditions with the CASE expression
      4m 45s
    7. Forcing a data type with CAST
      2m 50s
  8. 24m 38s
    1. Finding the LENGTH of a string
      1m 52s
    2. Changing case with UPPER and LOWER
      2m 15s
    3. Reading parts of a string with SUBSTR
      2m 34s
    4. Changing parts of a string with REPLACE
      1m 17s
    5. Trimming blank spaces with TRIM
      1m 59s
    6. Reading absolute values with ABS
      1m 6s
    7. Rounding values with ROUND
      1m 42s
    8. Finding the data type of an expression with TYPEOF
      1m 14s
    9. Finding the last inserted record with LAST_INSERT_ROWID
      1m 7s
    10. Getting the version of your SQLite library
      1m 16s
    11. Creating user-defined functions
      4m 51s
    12. Building aggregate user-defined functions
      3m 25s
  9. 18m 58s
    1. Understanding aggregate functions
      2m 15s
    2. Counting rows with COUNT
      3m 30s
    3. Building with the SUM and TOTAL functions
      2m 9s
    4. Finding minimum and maximum values with MIN and MAX
      4m 33s
    5. Finding averages with AVG
      1m 50s
    6. Grouping results with GROUP BY
      2m 23s
    7. Selecting for aggregation with HAVING
      2m 18s
  10. 13m 54s
    1. Understanding SQLite support for dates and times
      4m 31s
    2. Getting readable, sortable dates and times
      3m 36s
    3. Getting high-resolution dates and times with JULIANDAY
      2m 49s
    4. Formatting dates and times with STRFTIME
      2m 58s
  11. 18m 7s
    1. Understanding collation
      1m 0s
    2. Sorting results with ORDER BY
      1m 30s
    3. Removing duplicate results with DISTINCT
      2m 5s
    4. Understanding indexes
      3m 18s
    5. Working with primary key indexes
      4m 12s
    6. Understanding how to use the INTEGER PRIMARY KEY function
      6m 2s
  12. 7m 52s
    1. Understanding transactions
      1m 10s
    2. Using transactions in SQLite
      6m 42s
  13. 16m 6s
    1. Understanding subselects
      1m 29s
    2. Creating a simple subselect
      3m 18s
    3. Searching within a result set
      2m 35s
    4. Searching within a joined result
      3m 59s
    5. Creating a view
      2m 17s
    6. Searching within a joined view
      2m 28s
  14. 15m 56s
    1. Understanding triggers in SQLite
      52s
    2. Automatically updating a table with a trigger
      5m 18s
    3. Logging transactions with triggers
      2m 41s
    4. Improving performance with triggers
      2m 3s
    5. Preventing unintended updates with triggers
      2m 50s
    6. Adding automatic time stamps
      2m 12s
  15. 16m 25s
    1. Choosing an interface
      1m 21s
    2. Using the SQLite3 interface
      2m 41s
    3. Using the PDO interface
      3m 0s
    4. Creating a library
      9m 23s
  16. 16m 33s
    1. Defining CRUD
      4m 5s
    2. Using PHP to open and use an SQLite database
      3m 36s
    3. Using PHP to insert into an SQLite database
      4m 18s
    4. Using PHP to read from an SQLite database
      2m 20s
    5. Using PHP to update an SQLite database
      1m 2s
    6. Using PHP to delete from an SQLite database
      1m 12s
  17. 11m 32s
    1. An overview of the testimonials application
      4m 48s
    2. Managing the database in PHP
      4m 5s
    3. Displaying the testimonials using PHP
      2m 39s
  18. 33s
    1. Goodbye
      33s

please wait ...
Watch the Online Video Course SQLite 3 with PHP Essential Training
6h 2m Beginner Oct 20, 2010

Viewers: in countries Watching now:

In SQLite 3 with PHP Essential Training, Bill Weinman addresses all of SQLite’s major features in the context of the PHP environment. This course covers the fundamentals of SQLite, including a thorough overview of its unique data type system, expressions, functions, transactions, views, and event triggers. A functional CRUD application and web site testimonial engine are demonstrated, and a quick-start guide is included to get experienced developers up and running fast. Exercise files are included in the course.

Topics include:
  • Creating a database
  • Setting permissions for a database
  • Storing data with SQLite data types
  • Using SQL statements like SELECT and UPDATE
  • Understanding expressions in SQLite
  • Matching patterns and values
  • Working with core functions
  • Counting, finding, and grouping with aggregates
  • Formatting dates and times
  • Sorting and indexing
  • Reusing queries with subselects and views
  • Automating queries with triggers
Subjects:
Business Developer Web
Software:
SQLite
Author:
Bill Weinman

Understanding databases and tables in SQLite

SQLite is different than other database management systems in two significant ways. First, SQLite is a database management system in a driver, and two, SQLite stores an entire database in one file. So SQLite itself, the code base that comprises the database management system, lives inside your application as a driver. So when it needs to access its database, which is contained in a file, SQLite must first go through the application, and then the application accesses the file.

What this means is the directory where you're creating your files, and the files themselves, must be accessible by the application. So the application, whatever user it's running under, has to have access to that file, read and write access to the file, and read and write access to the directory the file is contained in, because SQLite creates and destroys a few temporary files along way, as it's managing your database. This becomes a little bit more complicated when your application is a web application.

What this means is that the application itself lives inside the web server. So when SQLite needs to access the file, it must first go through the application, and then the application must go through the web server, and then the web server accesses the file. So this means that the database file itself, and the directory of the database file it's living in must have permissions that will allow read and write access to the web server. So, especially if your web server is a shared UNIX web server, or it's running on a Mac, the web server itself is probably running as a user different than your login user.

This means that your directory and your files must have read/write access to everyone. Keep in mind also that SQLite stores all of the data for a given database in one file. This means that all of your tables are stored in this one file. This can be very convenient for small and medium-sized applications, but it also is significant when you're planning the permissions for your files, and we'll talk more about this as we go on. So, as you create your databases and tables, be aware of how SQLite creates and accesses database files.

Maintain permissions so that the SQLite driver, and its host application, and even the web server has access to the directories and files that it needs. This will keep your development and maintenance cycles smooth and stress free.

There are currently no FAQs about SQLite 3 with PHP Essential Training.

 
Share a link to this course

What are exercise files?

Exercise files are the same files the author uses in the course. Save time by downloading the author's files instead of setting up your own files, and learn by following along with the instructor.

Can I take this course without the exercise files?

Yes! If you decide you would like the exercise files later, you can upgrade to a premium account any time.

Become a member Download sample files See plans and pricing

Please wait... please wait ...
Upgrade to get access to exercise files.

Exercise files video

How to use exercise files.

Learn by watching, listening, and doing, Exercise files are the same files the author uses in the course, so you can download them and follow along Premium memberships include access to all exercise files in the library.


Exercise files

Exercise files video

How to use exercise files.

For additional information on downloading and using exercise files, watch our instructional video or read the instructions in the FAQ .

This course includes free exercise files, so you can practice while you watch the course. To access all the exercise files in our library, become a Premium Member.

* Estimated file size

Are you sure you want to mark all the videos in this course as unwatched?

This will not affect your course history, your reports, or your certificates of completion for this course.


Mark all as unwatched Cancel

Congratulations

You have completed SQLite 3 with PHP Essential Training.

Return to your organization's learning portal to continue training, or close this page.


OK

Upgrade to View Courses Offline

login

With our new Desktop App, Annual Premium Members can download courses for Internet-free viewing.

Upgrade Now

After upgrading, download Desktop App Here.

Become a member to add this course to a playlist

Join today and get unlimited access to the entire library of video courses—and create as many playlists as you like.

Get started

Already a member ?

Exercise files

Learn by watching, listening, and doing! Exercise files are the same files the author uses in the course, so you can download them and follow along. Exercise files are available with all Premium memberships. Learn more

Get started

Already a Premium member?

Exercise files video

How to use exercise files.

Ask a question

Thanks for contacting us.
You’ll hear from our Customer Service team within 24 hours.

Please enter the text shown below:

Exercise files

Access exercise files from a button right under the course name.

Mark videos as unwatched

Remove icons showing you already watched videos if you want to start over.

Control your viewing experience

Make the video wide, narrow, full-screen, or pop the player out of the page into its own window.

Interactive transcripts

Click on text in the transcript to jump to that spot in the video. As the video plays, the relevant spot in the transcript will be highlighted.

Learn more, save more. Upgrade today!

Get our Annual Premium Membership at our best savings yet.

Upgrade to our Annual Premium Membership today and get even more value from your lynda.com subscription:

“In a way, I feel like you are rooting for me. Like you are really invested in my experience, and want me to get as much out of these courses as possible this is the best place to start on your journey to learning new material.”— Nadine H.

Start your FREE 10-day trial

Begin learning software, business, and creative skills—anytime,
anywhere—with video instruction from recognized industry experts.
lynda.com provides
Unlimited access to over 4,000 courses—more than 100,000 video tutorials
Expert-led instruction
On-the-go learning. Watch from your computer, tablet, or mobile device. Switch back and forth as you choose.
Start Your FREE Trial Now
 

A trusted source for knowledge.

 

We provide training to more than 4 million people, and our members tell us that lynda.com helps them stay ahead of software updates, pick up brand-new skills, switch careers, land promotions, and explore new hobbies. What can we help you do?

Thanks for signing up.

We’ll send you a confirmation email shortly.


Sign up and receive emails about lynda.com and our online training library:

Here’s our privacy policy with more details about how we handle your information.

Keep up with news, tips, and latest courses with emails from lynda.com.

Sign up and receive emails about lynda.com and our online training library:

Here’s our privacy policy with more details about how we handle your information.

   
submit Lightbox submit clicked
Terms and conditions of use

We've updated our terms and conditions (now called terms of service).Go
Review and accept our updated terms of service.