Complete_PHP_and_Database_Interview_Questions
Complete_PHP_and_Database_Interview_Questions
====================================================
-------------------
Example:
class Car {
public $brand;
public $color;
$myCar->brand = "Toyota";
$myCar->color = "Red";
--------------
Inheritance allows a class to inherit properties and methods from another class.
Example:
class Vehicle {
public $type;
return "Moving!";
public $brand;
$bike->type = "Two-wheeler";
$bike->brand = "Yamaha";
====================================================
1. What is a database?
----------------------
Answer: A database is an organized collection of data that can be easily accessed, managed, and
updated.
2. What is SQL?
---------------
Answer: SQL (Structured Query Language) is a standard language used to communicate with
relational databases to perform operations like querying, updating, inserting, and deleting data.
-----------------------------------------------------
- DDL (Data Definition Language): Defines the structure of the database (e.g., CREATE, ALTER,
DROP).
- DML (Data Manipulation Language): Handles data manipulation (e.g., INSERT, UPDATE,
DELETE, SELECT).
- DCL (Data Control Language): Controls access to data (e.g., GRANT, REVOKE).
-------------------------
Answer: A primary key is a unique identifier for a record in a table. It ensures that no duplicate
Example:
Name VARCHAR(50)
);
-------------------------
Answer: A foreign key is a field in one table that refers to the primary key in another table,
Example:
UserID INT,
);