Skip to content

Latest commit

 

History

History
60 lines (36 loc) · 1.34 KB

database-notes.md

File metadata and controls

60 lines (36 loc) · 1.34 KB
lang title author description keywords
en-GB
SQL Notes
Jerry Sky
Notes on SQL-related stuff.
notes, SQL, query, database

Resources


Show columns from a SELECT query

-- create a temporary table
CREATE TEMPORARY TABLE exportTable AS (your_query);
-- show the columns
SHOW COLUMNS FROM exportTable;

Source


TRUNCATE all tables in a database

SET FOREIGN_KEY_CHECKS = 0;

truncate table "yourTableName";

SET FOREIGN_KEY_CHECKS = 1;

Source


Big data

A data set of 9 million tuples is nothing for a relational database. For maintaining sufficient performance as always use indexes and all will be well.

Source