Introduction
The relational model helps us organize data in tables so we can easily find and use information.
CREATE TABLE table_name ( column1 datatype PRIMARY KEY, column2 datatype, column3 datatype );
CREATE TABLE Customers ( CustomerID INT PRIMARY KEY, Name VARCHAR(100), Phone VARCHAR(15) );
CREATE TABLE Orders ( OrderID INT PRIMARY KEY, CustomerID INT, OrderDate DATE );
CREATE TABLE Employees ( EmployeeID INT PRIMARY KEY, FirstName VARCHAR(50), LastName VARCHAR(50), Department VARCHAR(50) ); INSERT INTO Employees (EmployeeID, FirstName, LastName, Department) VALUES (1, 'Alice', 'Smith', 'Sales'), (2, 'Bob', 'Jones', 'HR'), (3, 'Carol', 'Taylor', 'IT'); SELECT * FROM Employees;
Employees with columns EmpID (primary key), Name, and Department, what will the following SQL query return?SELECT Name FROM Employees WHERE Department = 'Sales';CREATE TABLE Products (ProductID INT, Name VARCHAR(50), Price DECIMAL);
ALTER TABLE Products ADD PRIMARY KEY (ProductID);
INSERT INTO Products VALUES (1, 'Pen', 1.5), (1, 'Pencil', 0.5);Orders(OrderID, CustomerID, Amount) and Customers(CustomerID, Name). Which relational model concept explains why CustomerID appears in both tables?Pass the test and this pattern moves unknown