×
          
              
          
      
      Clear all filters including search bar
          
        Valeri Tandilashvili's Personal Professional Blog
      
    12000SELECT 
    '12000' AS original_string,
    AES_ENCRYPT('12000', 'some secret key') AS encrypted_string,
    AES_DECRYPT(AES_ENCRYPT('12000', 'some secret key'), 'some secret key') decrypted_stringAESSELECT 
    '12000' AS original_string,
    AES_ENCRYPT('12000', 'some secret key') AS encrypted_stringSELECT
    SHA2('passwd', 256) password_hash2560d6be69b264717f2dd33652e212b173104b4a647b7c11ae72e9885f11cd312fbSELECT 
    (REPEAT('abc-123', 10) = UNCOMPRESS(COMPRESS(REPEAT('abc-123', 10)))) comparison7022SELECT 
    REPEAT('abc-123', 10) full_string,
    LENGTH(REPEAT('abc-123', 10)) full_string_length,
    COMPRESS(REPEAT('abc-123', 10)) compressed_string,
    LENGTH(COMPRESS(REPEAT('abc-123', 10))) compressed_string_lengthaabc-12310SELECT 
    REPEAT('abc-123', 10) #1356 - View 'university.student_notes' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use themDROP VIEW IF EXISTS student_notes;
CREATE VIEW student_notes AS
SELECT 
    students.first_name,
    students.last_name,
    students.points,
    notes.*
FROM students
JOIN notes ON notes.student_id = students.id- UNION
- DISTINCT
- HAVING
- LEFT / RIGHT JOINs
- Sub-queries
- GROUP BY
- Aggregate Functionsnotes.idImplicit JOINUPDATE notes, students
SET points = points+1
WHERE notes.student_id = students.id
	AND notes.note = 'My first note'notes.idexplicit JOINUPDATE notes
INNER JOIN students ON notes.student_id = students.id
SET students.points = students.points + 1
WHERE notes.id = 1notes.idUPDATE students 
SET points = points + 1 
WHERE student_id = (
        SELECT student_id 
        FROM notes 
        WHERE notes.id = 1
    )notes.idVIEWDROP VIEW IF EXISTS student_notes;
CREATE VIEW student_notes AS
SELECT 
    students.first_name,
    students.last_name,
    students.points,
    notes.*
FROM students
JOIN notes ON notes.student_id = students.idUPDATE `student_notes` 
SET points = points + 1 
WHERE id = 1;SELECT student_id FROM `notes` WHERE id = 5;
UPDATE students SET points = points + 1 WHERE id = 3;student_notesstudentsCREATE VIEW IF NOT EXISTS student_notes AS
SELECT 
    students.first_name,
    students.last_name,
    students.points,
    notes.*
FROM students
JOIN notes ON notes.student_id = students.idUPDATE `student_notes` 
SET points = points + 1 
WHERE id = 1;