Professional Documents
Culture Documents
] - A schema could be
considered as a group of related database objects such as tables, views, indexes
etc.
Anything that is followed by hyphen hyphen(i.e. --) is treated as comment in MySQL.
-- Create a new database with name DemoDB and with the character set
-- utf8 which stands for unicode text format 8 which is widely used for supporting
international character set.
In MySQL
SELECT CONCAT (col1, CONCAT(' ', Col2)) AS Newcolname FROM Table-name;
-- IMPORTANT
-- NULL is not equal to zero (0) and it is not equal to empty string ('')
-- NULL could be considered as undetermined or the value is not known.
-- In the below command CreatedDTTM takes the default value i.e. NOW()
-- which is the current system date time.
-- With the below insert command CreatedDTTM takes the default value i.e. NOW()
-- but LastName takes NULL as there is no default value given for LastName.
INSERT INTO `Employee`(`EmpID`, `FirstName`, `Salary`)
VALUES(3, 'C', 1000);
select
c.name,
c.UserId,
from Submissions s
join Candidates c
on s.UserId=c.UserId
join Problems p
on s.ProblemName=p.ProblemName
group by 1,2
order by 3 desc