Join Bill Weinman for an in-depth discussion in this video Databases and tables, part of SQL Essential Training.
A database is, fundamentally, a collection of tables. Depending on which database management system you're using, a database may also include any number of other things, indexes, triggers, stored procedures, and other metadata. But fundamentally, a database is a collection of tables. A table is a collection of data organized in rows and columns. Normally a table is a collection of relate things, like countries in a country table. Or customers in a customer table. Tables may have relationships with other tables, for example.
A customer may have one or more addresses, so the address table would have a customer ID column, that links to records in the customer table. These kinds of relationships are common, customers have addresses, record albums, have tracks, countries have cities. Likewise, the tables in the database are generally related to each other. While many systems allow queries to cross databases, the tables in a database are typically used by one application, Or a set of applications and the tables used by different applications are typically kept in different databases.
So a database is organized as a set of tables where each table contains a common set of data. The specifics of how a database is defined and what it contains varies somewhat From system to system, but generally the tables in a database tend to be related to each other like countries, regions, and cities. Or customers and addresses. Understanding how a database is organized can help you to understand your application or the application you need to work with.
- Understanding SQL terminology and syntax
- Creating new tables and records
- Inserting and updating data
- Writing basic SQL queries
- Sorting and filtering
- Accessing related tables with JOIN
- Working with strings
- Finding the numeric type of a value
- Using aggregate functions and transactions
- Updating a table with triggers
- Creating views
Skill Level Beginner
Q: For Mac OS X: When I try to start the Apache Web Server from the XAMPP control panel, it doesn't start, and when I open "localhost" in my web browser, I see a white screen that says "It Works!" instead of the XAMPP page.
sudo apachectl stop
Q: I'm on a Mac, and I get an error in SID that says "attempt to write a read only database." How can I fix this?
A: This usually means that the database folder does not have sufficient permissions for writing by the web user. This can happen if you create the SQL folder new, rather than copying it from the Exercise Files. Here's how to fix this:
- Open a Finder window and Navigate to /Applications/XAMPP/htdocs/SQL
- Control-click on the SQL folder and select "Get Info" from the context menu.
- Under "Sharing and Permissions" (you may need to open the disclosure triangle), in the "everyone" row, select "Read & Write."Then you can close the Info window.
- Now repeat the process for the three *.db files inside the folder.