click below
click below
Normal Size Small Size show me how
PHP - Week 3
WTWD 410 - SQL Vocabulary
Term | Definition | Example |
---|---|---|
SQL Data Table | A collection of related data held in a structured format within a database. | CREATE TABLE users (id INT AUTO_INCREMENT PRIMARY KEY, name VARCHAR(100), email VARCHAR(100)); |
SQL Data Element | An individual unit of data within a data field in a database table. | INSERT INTO users (name, email) VALUES ('Alice', 'alice@example.com'); |
SQL Data Record | A single, complete set of information within a table, typically a row in the database. | SELECT * FROM users WHERE id = 1; |
SQL Data Field | A specific column within a table designed to hold a particular type of data. | SELECT name, email FROM users; |
Unique ID | A unique identifier for a record within a table, often a primary key. | CREATE TABLE orders (order_id INT AUTO_INCREMENT PRIMARY KEY, user_id INT, order_date DATE); |
SQL Statement | A command used to perform tasks such as retrieving data from a database or updating records. | SELECT * FROM users; |
SQL Select Statement | A command used to fetch data from a database table. | SELECT name, email FROM users; |
SQL Update Statement | A command used to modify existing records in a database table. | UPDATE users SET email = 'newemail@example.com' WHERE id = 1; |
SQL Delete Statement | A command used to remove records from a database table. | DELETE FROM users WHERE id = 1; |
SQL Insert Statement | A command used to add new records to a database table. | INSERT INTO users (name, email) VALUES ('Bob', 'bob@example.com'); |
SQL Create Table Statement | A command used to create a new table in a database. | CREATE TABLE products (product_id INT AUTO_INCREMENT PRIMARY KEY, product_name VARCHAR(100), price DECIMAL(10, 2)); |
SQL Alter Table Statement | A command used to modify the structure of an existing table. | ALTER TABLE users ADD COLUMN phone VARCHAR(15); |
SQL Drop Table Statement | A command used to delete an entire table from a database. | DROP TABLE old_users; |
Prepared Statement | A feature used to execute the same or similar SQL statements repeatedly with high efficiency. | $stmt = $conn->prepare("SELECT * FROM users WHERE email = ?"); $stmt->bind_param("s", $email); $stmt->execute(); |
SQL Operation | Any action performed on a database, such as inserting, updating, or deleting data. | INSERT INTO users (name, email) VALUES ('Charlie', 'charlie@example.com'); |
SQL Target | The specific data or table that an SQL statement aims to affect or retrieve. | UPDATE products SET price = 19.99 WHERE product_id = 1; |
SQL Condition | A clause in SQL statements used to specify criteria for data retrieval or manipulation. | SELECT * FROM users WHERE age > 18; |
SQL Wild Card | Special characters used in SQL statements to represent one or more other characters, typically used in search patterns (e.g., % and _). | SELECT * FROM users WHERE name LIKE 'A%'; |
Order of Execution | The sequence in which SQL operations are processed by the database engine. | SELECT * FROM users ORDER BY name ASC; |
Exception Handling | Mechanisms to handle errors or exceptions that occur during SQL execution. | try { $stmt->execute(); } catch (Exception $e) { echo 'Caught exception: ', $e->getMessage(), "\n"; } |
SQL Injection | A code injection technique that might destroy your database, commonly used by attackers to exploit vulnerabilities in an application. | $unsafe_variable = $_POST['user_input']; $query = "SELECT * FROM users WHERE name = '$unsafe_variable'"; $stmt = $conn->prepare("SELECT * FROM users WHERE name = ?"); $stmt->bind_param("s", $_POST['user_input']); $stmt->execute(); |