본문 바로가기

DB

(26)
[Syntax] Writing Efficient Query 1. Views In a database, a View is the result set of a stored query on the data, which the database users can query just as they would in a persistent database collection object. This pre-established query command is kept in the database dictionary. Unlike ordinary base tables in relational database, a view doesn't form part of physical schema. A a result, it is a virtual table computed or collec..
[Syntax] Merging Tables 1. What is MERGE? The MERGE statement in SQL is a clause that can handle insert, update, and deletes all in a single transaction without having to write sepatate logic for each of these. Using the MERGE statement in SQL gives us better flexibility in customizing our complex SQL scripts and also enhances the readability of our scripts. 2. Kinds of Merge clause We can join data from more than two ..
[Syntax] Data Manipulation Language 1. What is DML? DML(Data Manipulation Language) is a family of computer language including commands permitting users to manipulate data in database. This manipulation involves inserting data into database tables, retreiving existing data, deleting data from existing tables and modifying existing data. 2. Select Cluases Query is a precise request for information retreval with database and informa..
[Theorem] What is SQLite? 1. What is SQL? SQL(Structured Query Language) is specific purposed programming language to manipulate tables from relational database management system(RDBMS). SQL was structured for createing and manipulating schemas, querying data and handling accessment of database object. 2. What is SQLite? SQLite is a database engine written in the C language. It is not a standlaone app; rather, it is a li..
[Syntax] See Records with NULL In MySQL, NULL values excluded automatically while we querying data. So to see values with all NULL values, we have to add more condition to original query statement. SELECT name FROM customer WHERE referee_id 2 OR referee_id IS NULL; Source from : https://www.w3schools.com/mysql/mysql_null_values.asp https://www.w3schools.com/mysql/mysql_where.asp
[Syntax] DELETE 1. What is DELETE Statement? DELETE is a Data Manipulation Language command, DML command and is used to remove tuples/records from a relation/table. 2. Syntax DELETE FROM table WHERE [conditions]; 3. Error : You can't specify target table When we use subquery in DELTE statement, there is error called : you can't specify target table. The reason why this error raised is because of feature of MySQ..