As promised I'm back with another SQL tutorial, this one throws in some more basic concepts.
The code I used is below:
/*///////////////////////////////////////////////////////////////////////// NOT NULL = Ensures that a column cannot have a NULL value /////////////////////////////////////////////////////////////////////////// SELECT * FROM Persons; INSERT INTO Persons(ID,LastName,FirstName,Age) VALUES( INSERT INTO Persons(ID,LastName,FirstName,Age) VALUES( CREATE TABLE Class( INSERT INTO Class(ID,Present,Ddate) VALUES( SELECT * FROM Class ALTER TABLE Class ADD signed VARCHAR(3) ALTER TABLE friends ADD PRIMARY KEY (contact) ▶️ 3Speak
BASICS 2
UNIQUE = Ensures that all values in a column are different
PRIMARY KEY = A combination of a NOT NULL and UNIQUE
FOREIGN KEY = Prevents actions that would destroy links
*/
CREATE TABLE Persons (
ID int NOT NULL PRIMARY KEY,
LastName varchar(255) NOT NULL,
FirstName varchar(255),
Age int
);
001,
'Abdul Rahman',
'',
24
);
002,
'Abdul Kahar',
NULL,
24
);
ID INT FOREIGN KEY REFERENCES Persons(ID),
Present VARCHAR(3) NOT NULL,
Ddate VARCHAR(12) NOT NULL
);
002,
'Yes',
'13/12/22'
);