Join Bill Weinman for an in-depth discussion in this video Defining a table in SQL, part of PostgreSQL 9 with PHP Essential Training.
Creating a table in Postgres is accomplished with the SQL CREATE TABLE…statement, and it looks like this.…We're here in the SID application, and you'll notice I've got the test database…selected. And I'm going to go ahead and create a table called foo,…so I will type CREATE TABLE. And I am going to name that table foo. And I'm…going to give it a column definition here.…First column will be animal, and that's a text column, and the second column…will be sound, and that is also a text column.…
There are a lot of different column types available in Postgres, and we will…cover what those are and how they work in another chapter.…So I'll go ahead and press the Go button now and lapse time 6 milliseconds, and…that table is now created.…If I try to create the table again, if I press Go again, you'll notice I'll…get an error that that relation, as it calls it, already exists and so it…cannot create that table.…And if I take a look at the tables that are already defined in this database, by…typing SELECT * FROM view_tables;--and this is a view that I've created that's…
- Installing PostgreSQL
- Understanding database architecture
- Inserting, updating, and deleting data in a table
- Creating a database library
- Indexing ID fields
- Storing numbers, text, and Boolean values
- Reading data
- Using casts to force type
- Using mathematical functions
- Concatenating strings
- Working with date and time functions and operators
- Defining CRUD
- Using PHP to insert, read, update, and delete rows in a database
Skill Level Beginner
1. Quick Start
2. Creating a Database
3. Data Types
4. Storing and Reading Data
5. SQL Expressions
6. Mathematical Functions and Operators
Using math functions3m 2s
7. String Functions and Operators
8. Date and Time Functions and Operators
9. PHP Interfaces
10. Web Applications
- Mark as unwatched
- Mark all as unwatched
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.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.